Nginx internal server

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.10
Operating system and version (eg, Ubuntu 20.04): 22.04 LTS
Apache or nginx version (eg, Apache 2.4.25): nginx 1.25.2-1
PHP version (eg, 7.4): 8.1

The issue you are facing:
After doing a release-upgrade from 20.04, first my Nextcloud was available via its URL (still in maintenance mode).
I had the ondrej-ppa version of PHP installed, but purged it and installed the ubuntu-version 8.1.
After configuring it the same as the old version, i’ve got an internal server error when i try to reach my NC.
The nginx-error log states:
2023/09/07 13:17:55 [crit] 4660#4660: *108 connect() to unix:/run/php/php8.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.>

The file is there and has its permissions set to srw-rw---- 1 www-data www-data

There’s also this link in that directory: php-fpm.sock -> /etc/alternatives/php-fpm.sock
Should i worry about that?

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

Steps to replicate it: Not sure …

The output of your Nextcloud log in Admin > Logging:

not availible (see above) but also useless in this case, i think

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

<?php
$CONFIG = array (
  'instanceid' => ++++++++++++
  'passwordsalt' => +++++++++++++++++++++
  'secret' => +++++++++++++++++++
  'trusted_domains' =>
  array (
    0 => '+++++++++++++',
    1 => '+++++++++++++++',
  ),
  'datadirectory' => '/var/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '25.0.10.1',
  'overwrite.cli.url' => ++++++++++++++++++++,
  'dbname' => ++++++++++++++++++++,
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => +++++++++++++++++++++,
  'dbpassword' => +++++++++++++++++++++,
  'installed' => true,
  'maintenance' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'overwriteprotocol' => 'https',
  'logtimezone' => 'Europe/Berlin',
  'auth.bruteforce.protection.enabled' => false,
  'mail_from_address' => 'webmaster',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => ++++++++++++++++++,
  'mail_smtpauth' => 1,
  'mail_smtphost' => ++++++++++++++++++++++++,
  'mail_smtpname' => ++++++++++++++++++++++,
  'mail_smtppassword' => ++++++++++++++++++++++++++++,
  'mail_smtpport' => '465',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'share_folder' => '/Mit mir geteilt',
  'skeletondirectory' => '/var/nextcloud_defaultfiles',
  'default_language' => 'de',
  'default_locale' => 'de',
  'loglevel' => 0,
  'theme' => '',
  'app_install_overwrite' =>
  array (
    0 => 'spreed',
    1 => 'documentserver_community',
  ),
  'default_phone_region' => 'DE',

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

2023/09/07 13:14:49 [crit] 4660#4660: *96 connect() to unix:/run/php/php8.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.1>
2023/09/07 13:14:49 [crit] 4660#4660: *99 connect() to unix:/run/php/php8.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.1>
2023/09/07 13:15:51 [crit] 4660#4660: *102 connect() to unix:/run/php/php8.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.>
2023/09/07 13:16:53 [crit] 4660#4660: *105 connect() to unix:/run/php/php8.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.>
2023/09/07 13:17:55 [crit] 4660#4660: *108 connect() to unix:/run/php/php8.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.>

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

Yes. Since you’re using the built-in PHP now, your NGINX php-handler needs to be pointed at that one instead. Just change the reference to /run/php/php8.1-fpm.sock to /run/php/php-fpm.sock and restart NGINX.

I did as you suggested, but unfortunately to no avail.

To be precise:
I’ve changed the listen = /run/php/php-fpm.sock entry in /etc/php/8.1/fpm/pool.d/www.conf
and the upstream php-handler {server unix:/run/php/php-fpm.sock;} entry in my example.com.conf-file

This is against what i’ve copied from the tutorial with which i got the NC running in the past.

Ok, now that i got back to my original setup (/run/php/php8.1-fpm.sock;), the formentioned error-message is gone, but now there’s a bunch of different errors:

2023/09/08 10:59:43 [warn] 56723#56723: no resolver defined to resolve r3.o.lencr.org while requesting certificate status, responder: r3.o.lencr.org, certificate: "/etc/letsencrypt/DOMAIN 2023/09/08 10:44:43 [error] 53051#53051: *540 connect() failed (111: Connection refused) while connecting to upstream, client: 46.114.152.200, server:DOMAIN.TLD, request: "GET /nextcloud/remote.php/dav/public-calendars/qbxm33ngLLtSccAt?export HTTP/2.0", upstream: 2023/09/08 10:59:43 [warn] 56723#56723: no resolver defined to resolve r3.o.lencr.org while requesting certificate status, responder: r3.o.lencr.org, certificate: "/etc/letsencrypt/DOMAIN.TLD/fullchain.pem" [… and many more like that]

Which to me still looks like a php-problem. But i don’t see an entry point for a solution.