502 Bad Gateway after 1.x -> 2.0.10 upgrade

  • I was talking about the owncloud config, i have added the two lines after root /var/www/owncloud


    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;


    error_log /var/log/nginx/openmediavault-owncloud_error.log error;
    access_log /var/log/nginx/openmediavault-owncloud_access.log combined



    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;
    }
    }

    ----------------------------------------------------------------------------------------------
    Software:
    Openmediavault 4.1.x.x (Arrakis) | omvextrasorg 3.3.16 | Nginx 1.12.2 | Nextcloud 13.x


    Hardware:
    Chassis: Fractal Design Node 304
    Board: ASROCK Z87E-ITX
    CPU: Intel Core i5-4670T
    CPU Cooler Noctua NH-U12S
    System storage: 30GB - Kingston SMS200S3/30G
    Data storage: 4 x 4TB - WD Red WD40EFRX 4TB
    RAM: 16GB
    Ethernet Adapter TP-Link TG-3468 (PCIe)

  • Add the two lines. Dont copy everything.

    ----------------------------------------------------------------------------------------------
    Software:
    Openmediavault 4.1.x.x (Arrakis) | omvextrasorg 3.3.16 | Nginx 1.12.2 | Nextcloud 13.x


    Hardware:
    Chassis: Fractal Design Node 304
    Board: ASROCK Z87E-ITX
    CPU: Intel Core i5-4670T
    CPU Cooler Noctua NH-U12S
    System storage: 30GB - Kingston SMS200S3/30G
    Data storage: 4 x 4TB - WD Red WD40EFRX 4TB
    RAM: 16GB
    Ethernet Adapter TP-Link TG-3468 (PCIe)

  • Ok added. I don't see any new logs showing up, but i thought this was interesting. I noticed that in sites-enabled the webgui config was a symlink to sites-available, so I copied the owncloud config to there from the sites-enabled folder and created the symlink. That results is neither site working properly.

  • Why don't you give us a package list for OMV related:


    dpkg -l | grep openmediavault



    Maybe a plugin is causing an issue.



    You should be putting server configs in /etc/nginx/sites-availabe. To create the symlinks you do not have to do it manually via ln -s.


    To enable a site that is in sites-available folder:
    nginx_ensite nameofsite
    service nginx restart


    To disable a site that has symlink in /etc/nginx/sites-enabled:
    nginx_dissite nameofsite
    service nginx restart


    A little easier than creating symlinks as you do not need to enter path.


    @Rocologo nice job helping him.

  • Ah thanks for the tip on nginx_ensite. That didn't look right having one symlink and nothing for owncloud in sites-enabled.


    Code
    dpkg -l | grep openmediavault
    ii  openmediavault                        2.1.14                            all          Open network attached storage solution
    ii  openmediavault-clamav                 2.1                               all          OpenMediaVault ClamAV plugin
    ii  openmediavault-keyring                0.4                               all          GnuPG archive keys of the OpenMediaVault archive
    ii  openmediavault-lvm2                   2.1                               all          OpenMediaVault Logical Volume Manager (LVM2) plugin
    ii  openmediavault-mumble                 1.0.2                             all          Mumble server plugin for OpenMediaVault.
    ii  openmediavault-netatalk               2.0                               all          OpenMediaVault netatalk (AppleTalk Protocol Suite) plugin
    ii  openmediavault-nut                    2.0                               all          OpenMediaVault Network UPS Tools (NUT) plugin
    ii  openmediavault-omvextrasorg           2.2                               all          OMV-Extras.org Package Repositories for OpenMediaVault
    ii  openmediavault-owncloud               2.0.3                             all          OpenMediaVault ownCloud plugin
  • Everything looks OK with your plugins. I have used Mumble in OMV 2.x too so I know that does not cause any problems.


    I think the owncloud plugin puts it's config file in the sites enabled instead of creating a symlink from sites available. At least it used to.


    Give listing of these:
    ls -la /etc/nginx/sites-availabe
    ls -la /etc/nginx/sites-enabled
    ls -la /etc/nginx/openmediavault-webgui.d

  • Code
    ls -la /etc/nginx/sites-available/
    total 24
    drwxr-xr-x 2 root root 4096 Sep 16 07:17 .
    drwxr-xr-x 7 root root 4096 Jul  4 11:05 ..
    -rw-r--r-- 1 root root 2163 May  4 13:02 default
    -rw-r--r-- 1 root root 1163 Aug 30 09:05 openmediavault-webgui
    -rw-r--r-- 1 root root 1865 Feb  3  2015 openmediavault-webgui.save
    -rw-r--r-- 1 root root 2748 Sep 15 14:55 owncloud


    Code
    ls -la /etc/nginx/sites-enabled/
    total 8
    drwxr-xr-x 2 root root 4096 Sep 16 07:18 .
    drwxr-xr-x 7 root root 4096 Jul  4 11:05 ..
    lrwxrwxrwx 1 root root   40 Jan 27  2015 openmediavault-webgui -> ../sites-available/openmediavault-webgui
    lrwxrwxrwx 1 root root   27 Sep 16 07:18 owncloud -> ../sites-available/owncloud


    Code
    ls -la /etc/nginx/openmediavault-webgui.d/
    total 12
    drwxr-xr-x 2 root root 4096 Jul  4 11:05 .
    drwxr-xr-x 7 root root 4096 Jul  4 11:05 ..
    -rw-r--r-- 1 root root 1414 Aug 30 09:05 security.conf
  • Did you make the openemediavault-webgui.save file??? Move that to another location. I make a scratch folder in the root of my system drive to save things like this. I am not sure if this file is causing a problem but for now get it out of there.


    Then:
    service php5-fpm restart
    service nginx restart


    PS- I take that back. It was in sites-available.

  • 99% sure I didn't, since I generally rename file backups with .bak not .save.


    Moved that config, restarted services. I also stopped an owncloud client that was running so I can more clearly see what's happening in the logs.


    Nothing in any of the error logs. This is what I see in the webgui_access.log when loading the webui:

    Code
    ::ffff:192.168.1.150 - - [16/Sep/2015:07:51:53 -0600] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36"
    ::ffff:192.168.1.150 - - [16/Sep/2015:07:51:53 -0600] "GET /favicon.ico HTTP/1.1" 200 1150 "https://omv.<domain>.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36"
  • I think I mentioned it farther up but I still think it's relevant. I created a phpinfo page in the owncloud directory and copied it to the openmediavault directory. The one in owncloud loads normally. The one in openmediavault shows the same blank page that the index.php file does. If I 'su - www-data' and 'php index.php':


    Code
    $ php index.php
    PHP Warning:  DOMDocument::load(/etc/openmediavault/config.xml): failed to open stream: Permission denied in /usr/share/php/openmediavault/config.inc on line 113
    Failed to load configuration (Warning 1549: failed to load external entity "/etc/openmediavault/config.xml" (line=0, column=0))
    Error #3008:<br/>exception 'OMVException' with message 'Failed to load configuration (Warning 1549: failed to load external entity "/etc/openmediavault/config.xml" (line=0, column=0))' in /usr/share/php/openmediavault/config.inc:577<br/>Stack trace:<br/>#0 /usr/share/php/openmediavault/env.inc(22): require_once()<br/>#1 /var/www/openmediavault/index.php(23): require_once('/usr/share/php/...')<br/>#2 {main}


    I honestly don't know if that error is relevant (since many files are owned by openmediavault) but it's the first error I've seen that might be related.

  • I recommend that you always keep a phpinfo.php test file in the webroot. This way I can check if Nginx and Php run. If the you can see the PHP information you know the error is in the application and not Nginx+PHP.


    If don't get any errors, my guess is that you are looking in the wrong log-file.

    ----------------------------------------------------------------------------------------------
    Software:
    Openmediavault 4.1.x.x (Arrakis) | omvextrasorg 3.3.16 | Nginx 1.12.2 | Nextcloud 13.x


    Hardware:
    Chassis: Fractal Design Node 304
    Board: ASROCK Z87E-ITX
    CPU: Intel Core i5-4670T
    CPU Cooler Noctua NH-U12S
    System storage: 30GB - Kingston SMS200S3/30G
    Data storage: 4 x 4TB - WD Red WD40EFRX 4TB
    RAM: 16GB
    Ethernet Adapter TP-Link TG-3468 (PCIe)

  • webroot isn't publicly available at the moment so I can try that later. Cleared the logs and restarted services, then force refreshed the webui page:


  • Okay no errors. What about the php5-fpm.log file ?

    ----------------------------------------------------------------------------------------------
    Software:
    Openmediavault 4.1.x.x (Arrakis) | omvextrasorg 3.3.16 | Nginx 1.12.2 | Nextcloud 13.x


    Hardware:
    Chassis: Fractal Design Node 304
    Board: ASROCK Z87E-ITX
    CPU: Intel Core i5-4670T
    CPU Cooler Noctua NH-U12S
    System storage: 30GB - Kingston SMS200S3/30G
    Data storage: 4 x 4TB - WD Red WD40EFRX 4TB
    RAM: 16GB
    Ethernet Adapter TP-Link TG-3468 (PCIe)

  • Code
    [16-Sep-2015 11:40:54] NOTICE: Finishing ...
    [16-Sep-2015 11:40:54] NOTICE: exiting, bye-bye!
    [16-Sep-2015 11:40:54] NOTICE: fpm is running, pid 9276
    [16-Sep-2015 11:40:54] NOTICE: ready to handle connections


    Nothing other than the service restart.

  • Code
    [16-Sep-2015 11:40:54] NOTICE: Finishing ...
    [16-Sep-2015 11:40:54] NOTICE: exiting, bye-bye!
    [16-Sep-2015 11:40:54] NOTICE: fpm is running, pid 9276
    [16-Sep-2015 11:40:54] NOTICE: ready to handle connections


    Nothing other than the service restart.


    If the nginx logs and php5-fpm does not show any errors, you need to test if you can read phpinfo.php through your webbrowser.

    ----------------------------------------------------------------------------------------------
    Software:
    Openmediavault 4.1.x.x (Arrakis) | omvextrasorg 3.3.16 | Nginx 1.12.2 | Nextcloud 13.x


    Hardware:
    Chassis: Fractal Design Node 304
    Board: ASROCK Z87E-ITX
    CPU: Intel Core i5-4670T
    CPU Cooler Noctua NH-U12S
    System storage: 30GB - Kingston SMS200S3/30G
    Data storage: 4 x 4TB - WD Red WD40EFRX 4TB
    RAM: 16GB
    Ethernet Adapter TP-Link TG-3468 (PCIe)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!