NextCloud (php-fpm) locks up after a few days @ /var/www/html/nextcloud/status.php

Nextcloud version: 20.0.1.1
Operating system and version: CentOS 8
Apache or nginx version: 2.4.37
PHP version:7.4.11

Have two installations, same problem.

The issue you are facing:

Hi,

after about 2 days, Nextcloud stop responding, because all php-fpm threads are busy with “/var/www/html/nextcloud/status.php”.

Thanks

Henri

$ps -ef | grep php-fpm | wc -l -> 252

Executing the script by hand works w/o issues.

sudo -u apache php $PWD/status.php
Array
(
[installed] => 1
[maintenance] =>
[needsDbUpgrade] =>
[version] => 20.0.1.1
[versionstring] => 20.0.1
[edition] =>
[productname] => Nextcloud
[extendedSupport] =>
)

Messages in Apache log:

AH01075: Error dispatching request to : (polling)

More messages:

–f3524b65-A–
[28/Oct/2020:23:05:19 +0100] X5nq43UryyeK83eHVScMygAAAEI 10.0.205.88 44400 172.20.50.155 443
–f3524b65-B–
GET /nextcloud/status.php HTTP/1.1
Host: ncloud.domain.tld
Authorization: Basic
User-Agent: Mozilla/5.0 (Macintosh) mirall/3.0.1git (build 3355) (Nextcloud)
Accept: /
X-Request-ID: a9223c3c-883c-45ad-8ee7-5a05f91e9179
Cookie: Accept-Language: en-DE,*
X-Forwarded-Proto: https
X-Forwarded-For: 92.50.68.86
X-Forwarded-Host: ncloud.domain.tld
X-Forwarded-Server: ncloud.domain.tld
Connection: Keep-Alive

–f3524b65-F–
HTTP/1.1 504 Gateway Timeout
Strict-Transport-Security: max-age=15552000; includeSubDomains
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-XSS-Protection: 1; mode=block
Content-Length: 247
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1

–f3524b65-E–

–f3524b65-H–
Apache-Error: [file “mod_proxy_fcgi.c”] [line 980] [level 3] [status 70007] AH01075: Error dispatching request to : (polling)
Apache-Handler: proxy:unix:/run/php-fpm/www.sock|fcgi://localhost
Stopwatch: 1603922659005814 60063158 (- - -)
Stopwatch2: 1603922659005814 60063158; combined=17, p1=2, p2=11, p3=1, p4=0, p5=3, sr=0, sw=0, l=0, gc=0
Response-Body-Transformed: Dechunked
Producer: ModSecurity for Apache/2.9.2 (http://www.modsecurity.org/).
Server: Apache/2.4.37 (centos) OpenSSL/1.1.1c
Engine-Mode: “ENABLED”

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

Steps to replicate it:

  1. Reboot
  2. wait 2 days

Messages from php-fpm monitor:

      pool         www
 process manager    dynamic
    start time      27/Oct/2020:08:35:25 +0100
   start since      135693
  accepted conn     14367
   listen queue     0
 max listen queue   0
 listen queue len   0
  idle processes    4
 active processes   237
 total processes    241

max active processes 237
max children reached 0
slow requests 0

pid state start time start since requests request duration request
method request uri content length user script last request cpu last
request memory
462356 Running 28/Oct/2020:17:51:14 +0100 15944 89 7399878460 GET
/nextcloud/status.php 0 henri /var/www/html/nextcloud/status.php 0.00 0
460964 Running 28/Oct/2020:17:41:45 +0100 16513 94 7463938373 PROPFIND
/nextcloud/remote.php 114 henri /var/www/html/nextcloud/remote.php 0.00
0

about 240 times:
461936 Running 28/Oct/2020:17:48:59 +0100 16079 91 7438794983 PROPFIND
/nextcloud/remote.php 105 henri /var/www/html/nextcloud/remote.php 0.00
0

conf.modules.d]# cat 15-php.conf

PHP is an HTML-embedded scripting language which attempts to make it

easy for developers to write dynamically generated webpages.

Cannot load both php5 and php7 modules

<IfModule !mod_php5.c>

LoadModule php7_module modules/libphp7.so

[root@ncloud conf.modules.d]# cat 10-worker.conf

ServerLimit 250
StartServers 20
MinSpareThreads 75
MaxSpareThreads 250
ThreadLimit 64
ThreadsPerChild 32
MaxClients 8000
MaxRequestsPerChild 10000

cat config.php

<?php $CONFIG = array ( 'trusted_domains' => array ( 0 => 'ncloud.o.domain.tld', 1 => 'ncloud', 2 => 'ncloud.domain.tld', ), 0 => array ( 0 => 'ncloud', ), 'datadirectory' => '/data', 'dbtype' => 'mysql', 'version' => '20.0.1.1', 'overwrite.cli.url' => 'http://ncloud.o.domain.tld:/nextcloud', 'dbname' => 'NextCloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'nextcloud', 'installed' => true, 'filelocking.enabled' => true, 'memcache.distributed' => '\\OC\\Memcache\\Redis', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'memcache.local' => '\\OC\\Memcache\\APCu', 'redis' => array ( 'host' => '/run/redis/redis-server.sock', 'port' => 0, 'dbindex' => 0, 'password' => 'secret', 'timeout' => 1.5, ), 'ldapIgnoreNamingRules' => false, 'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory', 'log_type' => 'file', 'logfile' => '/var/log/nextcloud.log', 'maintenance' => false, 'loglevel' => 2, 'encryption.legacy_format_support' => true, 'encryption.key_storage_migrated' => false, 'twofactor_enforced' => 'true', 'twofactor_enforced_groups' => array ( 0 => 'admin', ), 'twofactor_enforced_excluded_groups' => array ( ), 'theme' => '', );