chef-repo icon indicating copy to clipboard operation
chef-repo copied to clipboard

Nginx, passenger module is not installed

Open arturictus opened this issue 10 years ago • 10 comments

sudo nginx -t
nginx: [emerg] unknown directive "passenger_root" in /etc/nginx/conf.d/passenger.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx -V
nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_secure_link_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.4.6/debian/modules/headers-more-nginx-module --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-cache-purge --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-dav-ext-module --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-development-kit --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.4.6/debian/modules/ngx-fancyindex --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-http-push --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-lua --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-upload-progress --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.4.6/debian/modules/ngx_http_substitutions_filter_module

No passenger?

My run list:

"run_list":["role[mysql]","role[remove_applications]", "role[rails_passenger]", "role[sysadmins]"],

arturictus avatar Jul 05 '15 15:07 arturictus

After capistrano runs bundle install with the gem 'passenger' in the gem file all looks ok.

arturictus avatar Jul 05 '15 16:07 arturictus

My Nginx log was:

[emerg] 14487#0: unknown directive "passenger_root" in /etc/nginx/conf.d/passenger.conf:1

I had to run in the server:

apt-get install passenger

arturictus avatar Jul 05 '15 16:07 arturictus

@arturictus I believe I ran into this issue as well a little while ago. It had something to do with the servers of Passenger being down when running the chef cookbook. Thanks for reporting this! :yellow_heart:

@michiels I believe this is something we need to look in to.

jvanbaarsen avatar Jul 05 '15 18:07 jvanbaarsen

@jvanbaarsen definitely! Would be great if we could capture chef run logs somehow to see if the Passenger server timed out.

michiels avatar Jul 06 '15 07:07 michiels

@michiels, Couldn't find the chef log file. where is it? I'm using solo. I should have to flag it with '--force-logger' ? That's the documentation I found: https://docs.chef.io/ctl_chef_solo.html

I found this stackoverflow article: http://stackoverflow.com/questions/29255342/how-can-i-capture-chef-client-log-output-to-a-file-in-a-kitchen-run

could we setup in the repo to always write the log in a file?

arturictus avatar Jul 08 '15 21:07 arturictus

@arturictus Yeah that's a good suggestion. I believe the command currently only logs to standard out.

michiels avatar Jul 10 '15 07:07 michiels

The passenger recipe includes passenger, in the apt-sources. But I fail to see where it gets installed. Should there not be some code that actually installs it? Or am I overlooking something deadly obvious?

Edit: I'm understanding now that this simply overrides the location where nginx is fetched from. Seems ok. Removing (purging) nginx manually and reinstalling by rerunning cook solved this problem for me.

berkes avatar Jul 28 '15 15:07 berkes

@berkes That's correct. We use Phusion's repository that installs a binary nginx and passenger already installed. This is so we don't have to compile nginx on machines manually, which is normally required when doing a manual passenger install.

michiels avatar Jul 28 '15 19:07 michiels

I'm not sure how a deb- server should work, but passenger.list shows the url https://oss-binaries.phusionpassenger.com/apt/passenger, which leads to a 404. It may very well be that the passenger- apt is either misconfigured on their side, or that the wrong url is used in the apt-source. Will research this.

Edit: nope: it does not really matter, not on the first run nor when updating, that link is merely used as kind of template on how to build the urls where to find the actual packages.

berkes avatar Jul 29 '15 10:07 berkes

I've ran into this issue as well. The above suggested fixes do not work for me. Does anyone have any tips?

edit:

Finaly figured out how to get it working for now. It is what you guys said but in a specific order: Had to remove all the installed nginx stuff from the server apt-get purge nginx* After that i installed passenger apt-get install passenger Then recook

doncuomo avatar Jan 26 '16 11:01 doncuomo