502 Bad Gateway after 1.x -> 2.0.10 upgrade
-
- OMV 2.x
- Upgrade 1.x -> 2.x
- colbond
-
-
Yep they were incorrect. Reset to match your example and restarted php5-fpm service. Now at least I get this error (both owncloud and openmediavault webgui):
2015/09/12 13:19:50 [crit] 30006#30006: *12010 connect() to unix:/var/run/php5-fpm-openmediavault-webgui.sock failed (13: Permission denied) while connecting to upstream, client: 192.168.1.150, server: openmediavault, request: "GET /status.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm-openmediavault-webgui.sock:", host: "openmediavault:8443"
Code
Alles anzeigen[openmediavault-webgui] user = openmediavault group = openmediavault listen = /var/run/php5-fpm-openmediavault-webgui.sock listen.owner = www-data listen.group = www-data listen.mode = 0600 pm = ondemand pm.max_children = 25 pm.process_idle_timeout = 10s chdir = / ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; OpenMediaVault php.ini settings ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories php_value[include_path] = ".:/usr/share/php:/var/www/openmediavault" ; Pam Authentication Support (see /etc/pam.d) ; php_value[pam.servicename] = "openmediavault-webgui"; ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize php_value[upload_max_filesize] = 25M ; Maximum size of POST data that PHP will accept. ; http://php.net/post-max-size php_value[post_max_size] = 25M ; Do not expose to the world that PHP is installed on the server. ; http://php.net/expose-php php_value[expose_php] = Off ; Name of the session (used as cookie name). ; http://php.net/session.name php_value[session.name] = OMVSESSID ; Default timeout for socket based streams (seconds) ; http://php.net/default-socket-timeout php_value[default_socket_timeout] = 90 ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI php_value[max_execution_time] = 90
Code
Alles anzeigen[openmediavault-owncloud] user = www-data group = www-data listen = /var/run/php5-fpm-openmediavault-owncloud.sock listen.owner = www-data listen.group = www-data listen.mode = 0600 pm = ondemand pm.max_children = 25 pm.process_idle_timeout = 10s chdir = / ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ownCloud php.ini settings ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories php_value[include_path] = ".:/usr/share/php:/var/www/owncloud" ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize php_value[upload_max_filesize] = 2000M ; Maximum size of POST data that PHP will accept. ; http://php.net/post-max-size php_value[post_max_size] = 2000M ; Do not expose to the world that PHP is installed on the server. ; http://php.net/expose-php php_value[expose_php] = Off ; Name of the session (used as cookie name). ; http://php.net/session.name php_value[session.name] = OWNCLOUDSESSID ; Default timeout for socket based streams (seconds) ; http://php.net/default-socket-timeout php_value[default_socket_timeout] = 90 ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI php_value[max_execution_time] = 90 ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ; http://php.net/upload-tmp-dir php_value[upload_tmp_dir] = /var/www/owncloud/data
ls -lA /var/run:
Codesrw------- 1 www-data www-data 0 Sep 12 13:18 php5-fpm-openmediavault-owncloud.sock srw------- 1 www-data www-data 0 Sep 12 13:18 php5-fpm-openmediavault-webgui.sock
I definitely did plenty of troubleshooting before posting here so I'm sure I did modify it at some point. Thanks for posting what the correct config should be so I can rule that out. Definitely appreciate the help as this has been bugging me for a while now!
-
This error can also happen if you have an error in your nginx / webgui config file. Check the reference to the .sock file.
Please post /etc/nginx/sites-enabled/openmediavault-webgui
-
Good to know.
Code
Alles anzeigenserver { server_name openmediavault-webgui; root /var/www/openmediavault; index index.php; autoindex off; server_tokens off; sendfile on; large_client_header_buffers 4 32k; client_max_body_size 25M; error_log /var/log/nginx/openmediavault-webgui_error.log error; access_log /var/log/nginx/openmediavault-webgui_access.log combined; location /extjs/ { alias /usr/share/javascript/extjs5/; } location /images/ { alias /var/www/openmediavault/images/; } location ~ \.php$ { try_files $uri = 404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm-openmediavault-webgui.sock; fastcgi_index index.php; fastcgi_read_timeout 60s; include fastcgi_params; } listen [::]:8080 default_server ipv6only=off; listen [::]:443 default_server ipv6only=off ssl deferred; ssl_certificate /etc/ssl/certs/openmediavault-378223d6-e3a1-426f-ab98-3b4663594d7f.crt; ssl_certificate_key /etc/ssl/private/openmediavault-378223d6-e3a1-426f-ab98-3b4663594d7f.key; include /etc/nginx/openmediavault-webgui.d/*.conf; }
-
Also you could change
listen.mode = 0600
to
listen.mode = 0660
in /etc/php5/fpm/pool.d/openmediavault-webgui.conf
and restart the php5-fpm service
-
The nginx config files looks fine.
-
Please post
/etc/nginx/sites-enabled/openmediavault-owncloud
as well.
I notice your error
2015/09/12 13:19:50 [crit] 30006#30006: *12010 connect() to unix:/var/run/php5-fpm-openmediavault-webgui.sock failed (13: Permission denied) while connecting to upstream, client: 192.168.1.150, server: openmediavault, request: "GET /status.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm-openmediavault-webgui.sock:", host: "openmediavault:8443"
says port 8443, but your webgui runs on port 8080. Each virtual host must have its own php5-fpm.sock file.
-
owncloud is running on 8443 so that's interesting. Here's the owncloud config:
Code
Alles anzeigenupstream php-handler { server unix:/var/run/php5-fpm-openmediavault-webgui.sock; } server { listen 8443 ssl; server_name openmediavault; # ssl_certificate /etc/ssl/nginx/cloud.example.com.crt; # ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key; # ssl_certificate /etc/ssl/certs/openmediavault-378223d6-e3a1-426f-ab98-3b4663594d7f.crt; # ssl_certificate_key /etc/ssl/private/openmediavault-378223d6-e3a1-426f-ab98-3b4663594d7f.key; ssl_certificate /etc/ssl/certs/owncloud-2015.crt; ssl_certificate_key /etc/ssl/private/owncloud-2015.key; # Path to the root of your installation root /var/www/owncloud; client_max_body_size 10G; # set max upload size fastcgi_buffers 64 4K; rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; index index.php; error_page 403 /core/templates/403.php; error_page 404 /core/templates/404.php; location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ ^/(data|config|\.ht|db_structure\.xml|README) { deny all; } location / { # The following 2 rules are only needed with webfinger rewrite ^/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; try_files $uri $uri/ index.php; } location ~ ^(.+?\.php)(/.*)?$ { try_files $1 = 404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$1; fastcgi_param PATH_INFO $2; fastcgi_param HTTPS on; # fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php5-fpm-openmediavault-webgui.sock; # Or use unix-socket with 'fastcgi_pass unix:/var/run/php5-fpm.sock;' } # Optional: set long EXPIRES header on static assets location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { expires 30d; # Optional: Don't log access to assets access_log off; } }
Definitely appreciate the help!
-
I see from pasting that config that owncloud is using the wrong php5-fpm sock. Modified that and restarting services.
-
yes exactly
it should be fastcgi_pass unix:/var/run/php5-fpm-openmediavault-owncloud.sock;
-
Ok made that edit, restarted nginx and php5-fpm, same result. Owncloud loads fine, omv-webgui is a blank page. NOTHING in any of the nginx error logs, and just this in the access log:
Code::ffff:192.168.1.150 - - [15/Sep/2015:11:58:10 -0600] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
nothing in the php5-fpm log except the service restart.
-
hmm
Do you mean completely blank / white page or do you see the "Gateway error" ?
-
Now it's basically always a blank white page where even yesterday morning it would load a gateway error then sometimes a refresh would give me a white page. Wish I could be more consistent than that but it's been really hard to predict what I'll see.
-
Did you try this?
change
listen.mode = 0600
tolisten.mode = 0660
in /etc/php5/fpm/pool.d/openmediavault-webgui.conf
and restart the php5-fpm service
-
-
Hmm.. We need an error in a log file now. I have no more ideas.
-
Have you tried to run
omv-firstaid
and then choose option 2: Configure Webgui ?
-
Agreed I wish I had more to go on. After all that these are the only errors I get:
Code2015/09/15 12:56:42 [error] 11977#11977: *1 open() "/var/www/openmediavault404" failed (2: No such file or directory), client: ::ffff:192.168.1.150, server: openmediavault-webgui, request: "GET /status.php HTTP/1.1", host: "cloud.<domain>.com" 2015/09/15 12:56:42 [error] 11977#11977: *1 open() "/var/www/openmediavault404" failed (2: No such file or directory), client: ::ffff:192.168.1.150, server: openmediavault-webgui, request: "GET /owncloud/status.php HTTP/1.1", host: "cloud.<domain>.com"
So not sure why owncloud errors are being logged in the openmediavault-webgui_error.log
-
Okay now i see what you are missing in /etc/nginx/sites-available/openmediavault-owncloud
error_log /var/log/nginx/openmediavault-owncloud_error.log error;
access_log /var/log/nginx/openmediavault-owncloud_access.log combined;and
root must be defined as well
root /var/www/owncloud;
or something like this.
-
Ok there are actually no owncloud files in /etc/nginx/sites-available (just default, openmediavault-webgui, and openmediavault-webgui.save). Kind of new to nginx so I'm not sure what to expect there.
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!