-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kong can't find nginx #610
Comments
@jason-riddle I am looking into this. On a side note may I ask how did you install Kong? |
@thefosk I've been trying to get kong working on the heroku platform. In order to do this, I created a Dockerfile to compile openresty and luarocks from source. Heroku has a readonly filesystem which resulted in a lot of "hacks" in order to get this to work. |
@jason-riddle can you try again with the |
I don't believe it did? There's not much available in the form of logging, so I'm unable to confirm if anything else weird is going on.
|
@jason-riddle I have just updated the branch with more logging messages. Would you be able to retry again and paste the output? |
|
It seems like the $ echo $PATH && kong start -c kong.yml |
|
This makes me very confused. I hope you don't mind pulling again the branch and try again. This time I will be printing exactly how Kong parses the |
More logs. Just a small note, this isn't a huge issue as there are more important things to work on for kong. I just wanted to see if I could get this running on heroku. I'll probably follow up in a month or so.
|
As explained in #612 and as you rightfully quoted the comment @jason-riddle, searching in the $PATH should already be done by the line I pointed out there. I don't believe this is an issue with the current code, could it be related to Heroku? |
It could be, trying to figure it out. Heroku was on a very old issue (#178) and on our roadmap, so happy to sort this out. @jason-riddle how can I replicate this problem? |
(Rough) Steps to Create an App and Reproduce..
You are now running a shell on heroku. Now just run kong..
Note: I'm using a custom build pack, heroku-buildpack-openresty which downloads tools-latest.tar.gz which includes some binaries (openresty, luarocks, lua), libraries, header files, etc. |
Since IO.file_exists was being called and of course returned false when called with just `nginx`, the command was never executed, and no chance was given to the shell to try to find the executable in the $PATH. Fix #610
Fixed, will be included in 0.5.2. |
Awesome! Looks good. 👍 |
I'm getting this issue on 0.5.4 |
@scottschulthess
|
I am as well:
Installed kong from source with
also
and the find commands produces
|
Yeah I installed kong and nginx through homebrew.
|
I just ran into the same issue. I also installed both Nginx and kong via homebrew. My version of kong is 0.5.2 which I guess is the latest version as of the time of writing this. Has this issue been fixed? |
@ojengwa latest version is 0.7 |
I am having a similar problem running on mesos. Running local goes ok, but on mesos I have the "Cant find nginx" error:
Could it be related to low free memory on the container? |
@chicoandrade how did you install Kong? Can you run the following command to check where nginx is? $ find / -type f -name "nginx" |
Hi @thefosk , Here is the output:
I'm installing kong through dpkg:
And running with
|
@chicoandrade what OS are you running? |
@thefosk , kong is running on Debian GNU/Linux 8 (jessie) |
As we discovered investigating the issue with @thibaultcha, the problem that @chicoandrade is having occurs when the Ruxit agent is running in the host. |
Hi, just a new info in the ruxit/kong/nginx issue |
Interesting. I wonder why a monitoring agent would interfere with the nginx executable lookup. |
Anybody banging their head against the wall because openresty nginx is on the path, you should be aware that Kong crashes with the exact same message if it does find nginx but nginx fails to start. In my case, I was missing |
Facing the same problem from past few hours. I am running kong on mac os and i dont have ruxit installed in my machine output of sudo find / -type f -name "nginx" /usr/local/Cellar/nginx-full/1.10.1/bin/nginx Can someone please help in resolving the problem when I try to start nginx alone using sudo nginx in mac i get below error nginx: [error] [lua] kong.lua:161: init(): Startup error: /usr/local/share/lua/5.1/kong/tools/io.lua:66: bad argument #1 to 'open' (string expected, got nil) |
@thibaultcha could this be a Homebrew problem? |
Can't tell without more informations such as the actual installation method used, the desired Kong version, the full trace for the error, etc... |
'could not find OpenResty 'resty' executable'
Has anybody had any luck with kong on Ubuntu Trusty? Would 16.04 work better? Tail of log: 2016/11/03 07:36:00 [verbose] stopped services |
Make sure that the path to the "resty" command is in your PATH environment variable. export PATH=$PATH:/usr/local/openresty/bin Marco Palladino | CTO @ Mashape | mashape.com | +1 (415) 361-3858
|
Hello, |
Partial temporary fix, diagnosis and notes ( with the usual claim of - I do not get Lua ). Setting the PATH does not fix the issue. ( in case of Ubuntu 14.0.4 / Kong 9.5/ 1.11.2.1 ) The issue does seems to come from the start up script throwing an incorrect error 'cannot find resty'. In my case the issue was that on launching resty a 'Location not set' warning is being thrown by Perl. The fix was to set a Perl environment variable to squelch the warning 'export PERL_BADLANG=0'. The error is probably difficult to reproduce because it 'probably' comes(in my case) from the Mac terminal SSH client and its passing the locale settings to the server. |
I concur with you assessment that by setting the ENV variable If anyone is interested, i've attached the output
|
export PERL_BADLANG=0 worked for me. Thanks |
Bug:
Kong is unable to find nginx even though it it defined in my path.
Background:
My path looks like the following
and typing in
nginx -v
returnsand the path to nginx is
/app/tools/opt/bin/nginx
Potential Culprit?
My knowledge on Lua is limited, but it looks like the paths used to search for the nginx binary are defined here:
https://github.com/Mashape/kong/blob/6cc0d183deceb9c3008553ad3ae144fb2d532c40/kong/cli/utils/signal.lua#L55-L60
Where the logic to find the nginx binary is done here:
https://github.com/Mashape/kong/blob/6cc0d183deceb9c3008553ad3ae144fb2d532c40/kong/cli/utils/signal.lua#L64-L72
So it looks like only
NGINX_SEARCH_PATHS
is used to search for the binary and not$PATH
? I ask because I see the following comment which makes it seem like$PATH
is being searched?https://github.com/Mashape/kong/blob/6cc0d183deceb9c3008553ad3ae144fb2d532c40/kong/cli/utils/signal.lua#L62
-- Try to find an `nginx` executable in defined paths, or in $PATH
The text was updated successfully, but these errors were encountered: