PHP is killing processes with Nextcloud (PHP7.2)

Nextcloud version (eg, 12.0.2): 13.0.6.1
Operating system and version (eg, Ubuntu 17.04): Alpine Linux in Docker
Apache or nginx version (eg, Apache 2.4.25): Nginx 14.0
PHP version (eg, 7.1): 7.0.30 / 7.2.10

The issue you are facing:
Let me describe whole situation :slight_smile:

I have docker images of Nginx + PHP-FPM which are updated every week and Nextcloud is restarted. I know that this was working after last Nextcloud upgrade (month ago), so I assume there is some problem between nginx or PHP.

When I try to login I type username + password after that I have 2FA, but when I click on U2F then I get 502 error and in php7/error.log is just:

[29-Sep-2018 10:06:29] WARNING: [pool www] child 16 exited on signal 9 (SIGKILL) after 22.467813 seconds from start
[29-Sep-2018 10:06:29] NOTICE: [pool www] child 21 started

So I start to digging what can be wrong… I tried to add more servers to PHP-FPM (by start_servers = 5, pm.max_requests = 100, etc.) but still same issue… then I found out, that there is also errors in list of apps (no apps are listed, just blank page with Nextcloud menu etc). I got also error in Settings, but if I force refresh, its shows page with error “Error occurred while checking server setup”. So I was like “mkey… something is wrong”. Went to docker php container… and try to check integrity of code, but no error there :-/ see log:

$ php7 occ integrity:check-core
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
$

So I tried to update to PHP7.2 when I find out that I am using old 7.0 version, but after upgrade (even to 7.1) I got just blank page, nothing in error log of PHP and in Nextcloud log is following:

{"reqId":"EPkoXzoLzYo7wI32mEUb","level":3,"time":"2018-09-29T09:57:55+00:00","remoteAddr":"192.168.0.1","user":"--","app":"index","method":"GET","url":"\/login","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to undefined function OC\\\\App\\\\simplexml_load_file()\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/app.php(621): OC\\\\App\\\\InfoParser->parse('\\\/var\\\/www\\\/ownclo...')\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(62): OC_App::getAppInfo('files')\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/app.php(220): OC\\\\AppFramework\\\\App::buildAppNamespace('files')\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/app.php(119): OC_App::registerAutoloading('files', '\\\/var\\\/www\\\/ownclo...')\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(662): OC_App::loadApps(Array)\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(1081): OC::init()\\n#6 \\\/var\\\/www\\\/owncloud\\\/index.php(40): require_once('\\\/var\\\/www\\\/ownclo...')\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/App\\\/InfoParser.php\",\"Line\":64}","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko\/20100101 Firefox\/62.0","version":"13.0.6.1"}
{"reqId":"EPkoXzoLzYo7wI32mEUb","level":3,"time":"2018-09-29T09:57:55+00:00","remoteAddr":"192.168.0.1","user":"--","app":"PHP","method":"GET","url":"\/login","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at \/var\/www\/owncloud\/lib\/private\/App\/InfoParser.php#64","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko\/20100101 Firefox\/62.0","version":"13.0.6.1"}

What I found on internet, there should be installed packages php7-xml, php7-zip, php7-gd, php7-curl, but I have all of them.

Docker images could be found on this page: https://git.vypni.net/ronny/docker_armhf/src/master/php7/Dockerfile (for PHP7.2 just change repo from v3.5 to v3.8) + https://git.vypni.net/ronny/docker_armhf/src/master/nginx/Dockerfile

Nextcloud config.php:

<?php
$CONFIG = array (
  'instanceid' => 'REMOVED',
  'passwordsalt' => 'REMOVED',
  'secret' => 'REMOVED',
  'trusted_domains' =>
  array (
    0 => '192.168.0.199',
    1 => 'REMOVED',
  ),
  'datadirectory' => '/var/www/owncloud/data',
  'overwrite.cli.url' => 'https://192.168.0.199',
  'dbtype' => 'sqlite3',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'version' => '13.0.6.1',
  'logtimezone' => 'UTC',
  'installed' => true,
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'htaccess.RewriteBase' => '/',
  'updater.release.channel' => 'stable',
);

Any ideas what can be wrong? Because I am out of ideas… :-/

Any ideas how to debug it more at least maybe? :slight_smile:

OK… so I tried to upgrade to 13.0.7 with tar.bz2 file. Tried php7 occ upgrade command, but it fails with following:

$ php7 occ upgrade
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Updating database schema
Updated database
Checking for update of app activity in appstore
Killed

So I tried to upgrade system under Docker… didnt help.

Then I tried to upgrade PHP in Docker image from 7.0 to 7.2, still the same.

And I also tried to change memory limit to -1 (just for test) and that didnt help either :-/ (memory_limit => -1 => -1)

Solved. Problem was that my main image was somehow build from different version (alpine:edge) and php packages were installed from old (v3.6). But it was not working even with v3.8. When I changed FROM image to alpine:latest (v3.8) then it start working. Woohooo :slight_smile:

1 Like