502 Bad Gateway with nginx, --> php troubles?

Nextcloud version (18.0.1):
Operating system and version (Ubuntu 18.04):
Apache or nginx version (nginx 1.17.10):
PHP version (7.4 is shown as active using “systemctl status php*”):

The issue you are facing:

Hi,

I’ve recently tried manually updating to php7.4 on my system because another web service I wanted to configure required it. Ever since then, nextcloud has been warning me about a misconfigured php service on the admin-overview panel. Today I wanted to fix php on my system but unfortunately,

systemctl restart php*

and

systemctl restart nginx

have resulted in my page no longer being accessible from the internet. I am now always greeted with a “502 bad gateway nginx” message. I know it has something to do with a wonky php configuration, but no idea how to fix it.

Is this the first time you’ve seen this error? (Y):

Steps to replicate it:

  1. Try to access Nextcloud

The output of your Nextcloud log in Admin > Logging:

2020/06/04 16:56:31 [crit] 30525#30525: *82569 connect() to unix:/run/php/php7.3-fpm.sock failed (2: No such file or         directory) while connecting to upstream, client: 185.210.219.156, server: blablabla.space, request: "GET /csrftoken HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host:               "blablabla.space" 
2020/06/04 16:56:51 [crit] 30525#30525: *82569 connect() to unix:/run/php/php7.3-fpm.sock failed (2: No such file or directory) while connecting to upstream, client:                  185.210.219.156, server: blablabla.space, request: "POST                                                                                                                                                 /apps/rainloop/app/?/Ajax/&q[]=/_kJ-VtTBcwlM8-wLZZfTdarOhGHdxM3FJzGN8Mc7uXYIk_E-5IgmdCPmqsvZ0ORxXZQGO_yf2GVemxNBHA5rE0J3zkq6wbFde_aysddbPsRK5ybpZ9vPLhyXlcLbCoMaqUp7vvdIF59YM-ACZADEY6n4XjGmn63vp1KDZ$HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "blablabla.space" 
2020/06/04 16:56:58 [crit] 30525#30525: *85139 connect() to unix:/run/php/php7.3-fpm.sock failed (2: No         such file or directory) while connecting to upstream, client: 185.210.219.156, server: blablabla.space, request: "PROPFIND /remote.php/dav/files/me/ HTTP/2.0", upstream:                             "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "blablabla.space" 
2020/06/04 16:57:28 [crit] 30525#30525: *85139 connect() to unix:/run/php/php7.3-fpm.sock failed (2: No such file or                 directory) while connecting to upstream, client: 185.210.219.156, server: blablabla.space, request: "PROPFIND /remote.php/dav/files/me/ HTTP/2.0", upstream:                                          "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "blablabla.space" 

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => 'blablabla',
  'secret' => 'blablabla',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'blablabla.space',
  ),
  'datadirectory' => '/var/nc-data',
  'dbtype' => 'mysql',
  'version' => '18.0.1.3',
  'overwrite.cli.url' => 'https://blablabla.space',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '',
  'installed' => true,
  'instanceid' => '',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => '0',
    'timeout' => '0.0',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'enable_previews' => 'true',
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\Movie',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\MP3',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
  ),
  'preview_max_x' => '1024',
  'preview_max_y' => '768',
  'preview_max_scale_factor' => '1',
  'auth.bruteforce.protection.enabled' => 'true',
  'trashbin_retention_obligation' => 'auto,7',
  'skeletondirectory' => '',
  'defaultapp' => 'file',
  'activity_expire_days' => '14',
  'integrity.check.disabled' => 'false',
  'updater.release.channel' => 'stable',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'webmaster',
  'mail_domain' => 'blablabla.space',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.blablabla.de',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'webmaster@blablabla.space',
  'mail_smtppassword' => 'blablabla',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
);


The output of your Apache/nginx/system log in /var/log/____:

I accessed the nginx error log. It really only has one (repeated ad infinitum), which after a quick googling seems to be unrelated (and has also appeared in the logs for a whole while now, so not connected to php is my guess):

2020/06/04 17:32:37 [error] 32418#32418: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53

I also present my
nginx.conf:

user www-data;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
                worker_connections 1024;
                multi_accept on;
                use epoll;
        }
http {
                server_names_hash_bucket_size 128;
                upstream php-handler {
                        server unix:/run/php/php7.4-fpm.sock;
                }
                upstream onlyoffice-docker {
                        server 127.0.0.1:8443;
                }


            set_real_ip_from 127.0.0.1;
            set_real_ip_from 10.0.0.0/8;
            set_real_ip_from 172.16.0.0/12;
            set_real_ip_from 192.168.2.0/24;
            real_ip_header X-Forwarded-For;
            real_ip_recursive on;

            include /etc/nginx/mime.types;
            #include /etc/nginx/ssl.conf;

            default_type application/octet-stream;
            log_format main '$remote_addr - $remote_user [$time_local] "$request" '
            '$status $body_bytes_sent "$http_referer" '
            '"$http_user_agent" "$http_x_forwarded_for" '
            '"$host" sn="$server_name" '
            'rt=$request_time '
            'ua="$upstream_addr" us="$upstream_status" '
            'ut="$upstream_response_time" ul="$upstream_response_length" '
            'cs=$upstream_cache_status' ;
            access_log /var/log/nginx/access.log main;
            sendfile on;
            send_timeout 3600;                                                                                      tcp_nopush on;                                                                                          tcp_nodelay on;                                                                                         open_file_cache max=500 inactive=10m;
            open_file_cache_errors on;                                                                              keepalive_timeout 65;                                                                                   reset_timedout_connection on;
            server_tokens off;
            resolver 127.0.0.1;
            resolver_timeout 10s;                                                                                   include /etc/nginx/conf.d/*.conf;

My nextcloud server block:

server {
        listen 80 default_server;
                server_name blablabla.space;
        #Your DDNS adress, (e.g. from desec.io or no-ip.com)
        location ^~ /.well-known/acme-challenge {
                proxy_pass http://127.0.0.1:81;
        }
        location / {
                return 301 https://$server_name:443;
        }
}
server {
        listen 443 ssl http2;
                server_name blablabla.space;
        root /var/www/nextcloud/;
        access_log /var/log/nginx/nextcloud.access.log main;
        error_log /var/log/nginx/nextcloud.error.log warn;

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location = /.well-known/carddav {
                return 301 $scheme://$host:443/remote.php/dav;
        }
        location = /.well-known/caldav {
                return 301 $scheme://$host:443/remote.php/dav;
        }
        location = /.well-known/webfinger {
                return 301 $scheme://$host:443/public.php?service=webfinger;
        }

        location ^~ /loleaflet {
                proxy_pass https://localhost:9980;
                proxy_set_header Host $http_host;
        }

        location ^~ /hosting/discovery {
                proxy_pass https://localhost:9980;
                proxy_set_header Host $http_host;
        }

        location ^~ /lool {
                proxy_pass https://localhost:9980;
                proxy_set_header Host $http_host;
                proxy_set_header Upgrade $http_upgrade;                                                                 proxy_set_header Connection "upgrade";
        }

        client_max_body_size 10240M;

        location / {
                rewrite ^ /index.php;
        }
        location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
                deny all;
        }
        location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
                deny all;
        }
        location ~* \.(?:flv|mp4|mov|m4a)$ {
                mp4;
                mp4_buffer_size 5m;
                mp4_max_buffer_size 10m;
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                include fastcgi_params;
                include /etc/nginx/conf.d/php_optimization.conf;
                fastcgi_pass php-handler;
                fastcgi_param HTTPS on;
 }
        location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provi$                fastcgi_split_path_info ^(.+\.php)(/.*)$;                                                               try_files $fastcgi_script_name =404;
                include fastcgi_params;
                include /etc/nginx/conf.d/php_optimization.conf;
                fastcgi_pass php-handler;
                fastcgi_param HTTPS on;
        }
        location ~ ^/(?:updater|ocs-provider)(?:$|/) {
                try_files $uri/ =404;
                index index.php;
        }
        location ~ \.(?:css|js|woff|svg|gif)$ {
                try_files $uri /index.php$uri$is_args$args;
                add_header Cache-Control "public, max-age=15778463";
                access_log off;
                expires 30d;
        }
        location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
                try_files $uri /index.php$uri$is_args$args;
                access_log off;
                expires 30d;
        }

either run a local dns server (e.g. dnsmasq) or change:

to a valid dns server. e.g. 8.8.8.8, or something with more privacy.


that doesn’t match. sure that there isn’t another php7.3-fpm.sock somewhere in your nginx conf? did you grep for php7.3-fpm.sock in /etc/nginx?

Thanks for your help with the dns resolver. I opted for Cloudflare’s 1.1.1.1 and put that in my nginx.conf, hoping it’ll get rid of that refused connection.

When I grep for php7.3-fpm.sock, this is my output:

me@nur1kleinerserver:/etc/nginx$ grep -nr php7.3-fpm.sock
sites-available/test:59:        #       fastcgi_pass unix:/run/php/php7.3-fpm.sock;
sites-available/office-test.conf:60:    #       fastcgi_pass unix:/run/php/php7.3-fpm.sock;
sites-available/default:60:     #       fastcgi_pass unix:/run/php/php7.3-fpm.sock;

I figure that both “test” server blocks / sites shouldn’t be a problem here, but went ahead and manually configured them all to use php7.4-fpm.sock. However, all three of these instances were comment lines leftover from the default site configuration, like so:

    # pass PHP scripts to FastCGI server
    #
    #location ~ \.php$ {
    #       include snippets/fastcgi-php.conf;
    #
    #       # With php-fpm (or other unix sockets):
    #       fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    #       # With php-cgi (or other tcp sockets):
    #       fastcgi_pass 127.0.0.1:9000;

Anyway, I went ahead and also grep’ed my var/www/nextcloud/ for “php7.3*” … which in retrospect I should have known was far too broad. Anyway, I did find a good number of references to all manner of older php versions, but I don’t know if those make a difference and if so, what to do about it:

3rdparty/nikic/php-parser/lib/PhpParser/Parser/Php5.php:14: *  * the grammar files grammar/php5.y or grammar/php7.y
3rdparty/nikic/php-parser/lib/PhpParser/Parser/Php7.php:14: *  * the grammar files grammar/php5.y or grammar/php7.y
3rdparty/nikic/php-parser/grammar/README.md:5: * `php7.y`:             PHP 7 grammar written in a pseudo language
3rdparty/composer.lock:3277:                "symfony/polyfill-php73": "^1.8",
3rdparty/composer.lock:3539:                "symfony/polyfill-php72": "^1.9"
3rdparty/composer.lock:3700:            "name": "symfony/polyfill-php72",
3rdparty/composer.lock:3704:                "url": "https://github.com/symfony/polyfill-php72.git",
3rdparty/composer.lock:3709:                "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e",
3rdparty/composer.lock:3755:            "name": "symfony/polyfill-php73",
3rdparty/composer.lock:3759:                "url": "https://github.com/symfony/polyfill-php73.git",
3rdparty/composer.lock:3764:                "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188",
3rdparty/symfony/polyfill-intl-idn/composer.json:21:        "symfony/polyfill-php72": "^1.9"
3rdparty/symfony/polyfill-php72/composer.json:2:    "name": "symfony/polyfill-php72",
3rdparty/symfony/polyfill-php73/composer.json:2:    "name": "symfony/polyfill-php73",
3rdparty/symfony/console/composer.json:21:        "symfony/polyfill-php73": "^1.8",
3rdparty/composer/autoload_psr4.php:14:    'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
3rdparty/composer/autoload_psr4.php:15:    'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
3rdparty/composer/autoload_static.php:21:        '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
3rdparty/composer/autoload_static.php:23:        '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
3rdparty/composer/autoload_static.php:171:            0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
3rdparty/composer/autoload_static.php:175:            0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
3rdparty/composer/autoload_static.php:1561:        'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
3rdparty/composer/autoload_static.php:2860:        'Symfony\\Polyfill\\Php72\\Php72' => __DIR__ . '/..' . '/symfony/polyfill-php72/Php72.php',
3rdparty/composer/autoload_static.php:2861:        'Symfony\\Polyfill\\Php73\\Php73' => __DIR__ . '/..' . '/symfony/polyfill-php73/Php73.php',
3rdparty/composer/installed.json:3381:            "symfony/polyfill-php73": "^1.8",
3rdparty/composer/installed.json:3651:            "symfony/polyfill-php72": "^1.9"
3rdparty/composer/installed.json:3817:        "name": "symfony/polyfill-php72",
3rdparty/composer/installed.json:3822:            "url": "https://github.com/symfony/polyfill-php72.git",
3rdparty/composer/installed.json:3827:            "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e",
3rdparty/composer/installed.json:3874:        "name": "symfony/polyfill-php73",
3rdparty/composer/installed.json:3879:            "url": "https://github.com/symfony/polyfill-php73.git",
3rdparty/composer/installed.json:3884:            "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188",
3rdparty/composer/autoload_classmap.php:1123:    'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
3rdparty/composer/autoload_classmap.php:2422:    'Symfony\\Polyfill\\Php72\\Php72' => $vendorDir . '/symfony/polyfill-php72/Php72.php',
3rdparty/composer/autoload_classmap.php:2423:    'Symfony\\Polyfill\\Php73\\Php73' => $vendorDir . '/symfony/polyfill-php73/Php73.php',
3rdparty/composer/autoload_files.php:20:    '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
3rdparty/composer/autoload_files.php:22:    '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',

Then there’s all the apps like Gpxpod and Mail, but I’ll leave those for now, figuring that they shouldn’t interfere with general server access.

When trying to access my nextcloud over the internet, I am now greeted with this generalized error message:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

So I figured I’d go have another look at error logs:
nextcloud.access.log:

`185.210.219.156 - me [05/Jun/2020:00:05:28 +0200] "PROPFIND /remote.php/dav/files/me/ HTTP/2.0" 200 20 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-" "blablabla.space" 

$185.210.219.156 - - [05/Jun/2020:00:05:44 +0200] "POST /apps/rainloop/app/?/Ajax/&q[]=/_kJ-VtTBcwlM8-wLZZfTdarOhGHdxM3FJzGN8Mc7uXYIk_E-5IgmdCPmqsvZ0ORxXZQGO_yf2GVemxNBHA5rE0J3zkq6wbFde_aysddbPsRK5ybpZ9vPLhyXlcL

$185.210.219.156 - me [05/Jun/2020:00:05:58 +0200] "PROPFIND /remote.php/dav/files/me/ HTTP/2.0" 200 20 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-" "blablabla.space" 

$185.210.219.156 - - [05/Jun/2020:00:06:03 +0200] "POST /apps/rainloop/app/?/Ajax/&q[]=/_kJ-VtTBcwlM8-wLZZfTdarOhGHdxM3FJzGN8Mc7uXYIk_E-5IgmdCPmqsvZ0ORxXZQGO_yf2GVemxNBHA5rE0J3zkq6wbFde_aysddbPsRK5ybpZ9vPLhyXlcL

$185.210.219.156 - me [05/Jun/2020:00:06:28 +0200] "PROPFIND /remote.php/dav/files/me/ HTTP/2.0" 200 20 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-" "blablabla.space"`

Unfortunately, the nextcloud.error.log located in /var/log/nginx seems to be empty?

EDIT: gained access to /var/nc-data/nextcloud.log,

tail

outputs:

{"reqId":"C6X4Xh8nI3cHF6eRv0jM","level":3,"time":"2020-05-31T22:07:14+00:00","remoteAddr":"185.220.70.149","user":"me","app":"PHP","method":"GET","url":"/ocs/v2.php/core/whatsnew?format=json","message":"Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0","version":"18.0.1.3"}
    {"reqId":"oE9sWxx8v43XInZt7aHe","level":3,"time":"2020-06-01T07:48:47+00:00","remoteAddr":"185.220.70.137","user":"me","app":"PHP","method":"GET","url":"/ocs/v2.php/core/whatsnew?format=json","message":"Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0","version":"18.0.1.3"}
    {"reqId":"jqvSTbNOGQH2TanBN8Lc","level":3,"time":"2020-06-03T08:30:54+00:00","remoteAddr":"132.230.195.195","user":"me","app":"PHP","method":"GET","url":"/ocs/v2.php/core/whatsnew?format=json","message":"Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0","version":"18.0.1.3"}
  {"reqId":"41GwQN6xzEjYNTcek0wx","level":3,"time":"2020-06-03T15:06:04+00:00","remoteAddr":"77.185.122.81","user":"me","app":"PHP","method":"GET","url":"/ocs/v2.php/core/whatsnew?format=json","message":"Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0","version":"18.0.1.3"}
    {"reqId":"fQBIcbaaPNqpGF6tuqnd","level":3,"time":"2020-06-04T13:13:25+00:00","remoteAddr":"77.185.92.241","user":"me","app":"PHP","method":"GET","url":"/ocs/v2.php/core/whatsnew?format=json","message":"Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0","version":"18.0.1.3"}

The nginx error.log itself stopped recording the dns resolver issue, so I’ll take that as a win :slight_smile:

Thanks again for your help and time!

Reviving my own thread here. Tried again with

sudo -u www-data /var/www/nextcloud/occ

and was thrown this chunk:

An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:68
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(420): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(380): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(324): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(683): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(155): Doctrine\DBAL\Connection->setTransactionIsolation()
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(195): OC\DB\Connection->__construct()
#6 /var/www/nextcloud/lib/private/DB/ConnectionFactory.php(157): Doctrine\DBAL\DriverManager::getConnection()
#7 /var/www/nextcloud/lib/private/Server.php(748): OC\DB\ConnectionFactory->getConnection()
#8 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}()
#9 /var/www/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\ServerContainer->query()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#12 /var/www/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/Server.php(1663): OC\ServerContainer->query()
#14 /var/www/nextcloud/lib/private/Server.php(421): OC\Server->getDatabaseConnection()
#15 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}()
#16 /var/www/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet()
#17 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(70): OC\ServerContainer->query()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(100): OC\AppFramework\Utility\SimpleContainer->buildClass()
#19 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(115): OC\AppFramework\Utility\SimpleContainer->resolve()
#20 /var/www/nextcloud/lib/private/ServerContainer.php(150): OC\AppFramework\Utility\SimpleContainer->query()
#21 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(70): OC\ServerContainer->query()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(100): OC\AppFramework\Utility\SimpleContainer->buildClass()
#23 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(115): OC\AppFramework\Utility\SimpleContainer->resolve()
#24 /var/www/nextcloud/lib/private/ServerContainer.php(150): OC\AppFramework\Utility\SimpleContainer->query()
#25 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\ServerContainer->query()
#26 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#27 /var/www/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet()
#28 /var/www/nextcloud/lib/private/Server.php(433): OC\ServerContainer->query()
#29 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}()
#30 /var/www/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet()
#31 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\ServerContainer->query()
#32 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet()
#34 /var/www/nextcloud/lib/private/Server.php(1539): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(801): OC\Server->getUserSession()
#36 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}()
#37 /var/www/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet()
#38 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\ServerContainer->query()
#39 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#40 /var/www/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet()
#41 /var/www/nextcloud/lib/private/Server.php(1834): OC\ServerContainer->query()
#42 /var/www/nextcloud/lib/private/legacy/app.php(347): OC\Server->getAppManager()
#43 /var/www/nextcloud/lib/private/legacy/app.php(114): OC_App::getEnabledApps()
#44 /var/www/nextcloud/lib/base.php(645): OC_App::loadApps()
#45 /var/www/nextcloud/lib/base.php(1089): OC::init()
#46 /var/www/nextcloud/console.php(48): require_once('/var/www/nextcl...')
#47 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

Hm. So for anyone googling/DDGing here, what finally helped solve this conundrum was, in fact, that OCC output. Unfortunately, none of the other logs or error messages contained any useful info (as pointed out above), so I was stuck. Then I remembered occ, which threw above error message, which in turn allowed me to research that, and it turned out that

While upgrading from PHP 7.3 to 7.4 some PHP modules integral to Nextcloud hadn’t gotten updated automatically. After running “sudo apt-get install php-intl” and a few others, everything was working smoothly again! :slight_smile: