PHP Errors and Bad Gateways after user creation

Hi :slight_smile:

Nextcloud version: 14.0.3.0
Operating system and version: CentOS Linux release 7.5.1804
Apache or nginx version: Nginx, bundled with gitlab-omnibus (1.12.1, if version is from here: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/config/software/nginx.rb)
PHP version: 7.1.8

The issue I am facing:

After a user is created via Registration plugin or admin web interface something bad starts to happen:
many web paths both for users and admin stops working with Bad gateway page and multiple PHP errors in the logs.

Is this the first time you’ve seen this error? No.

First it was on 14.0.1 yestarday: the user registers himself via plugin (if it is important, username was not a single word, but like “John Doe”). His (only his) All files page did not show any files, some paths both for user and for admin interface shows Bad Gateway. I deleted that user and update to 14.0.3 - errors gone.

I disabled registration plugin and try to create a user manually (username “john”, display name non-English) and once again errors appears - but this time the whole Admin / Settings path leads to Bad Gateway, so I deleted that user and reboot OS. After that system becomes accessible once again.
Current number of users is 5.

Steps to replicate it:

  1. Create a user (self registering or by admin).

The output of Nextcloud log in Admin > Logging:

|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:24:38+0300|
|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:22:27+0300|
|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:22:27+0300|
|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:22:27+0300|
|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:22:27+0300|
|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:22:27+0300|
|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:22:26+0300|
|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:22:26+0300|
|Error|PHP|Trait ' people by entering a user or group or an email address.' not found at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#35|2018-10-16T10:22:22+0300|
|Error|PHP|Error: Call to undefined method OC_DB::ø«ÉÀ4() at /var/www/nextcloud/lib/private/legacy/db.php#64|2018-10-16T10:22:11+0300|
|Error|PHP|call_user_func() expects parameter 1 to be a valid callback, class 'OCA\Files_Trashbin\Hooks' not found at /var/www/nextcloud/lib/private/legacy/hook.php#106|2018-10-16T10:22:11+0300|
|Error|PHP|Error: Call to undefined method OCA\Files_Sharing\External\Manager::HÝÈÀ4() at /var/www/nextcloud/apps/files_sharing/lib/Controller/RemoteController.php#137|2018-10-16T10:21:07+0300|
|Error|PHP|Trait '' not found at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#35|2018-10-16T10:20:52+0300|
|Error|PHP|Allowed memory size of 536870912 bytes exhausted (tried to allocate 139864550788376 bytes) at /var/www/nextcloud/lib/private/Log/ExceptionSerializer.php#115|2018-10-16T10:20:34+0300|
|Error|PHP|Cannot declare class , because the name is already in use at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#34|2018-10-16T10:20:22+0300|
|Error|PHP|Trait '™a' not found at /var/www/nextcloud/settings/Controller/PersonalSettingsController.php#35|2018-10-16T10:20:20+0300|
|Error|PHP|Trait '€' not found at /var/www/nextcloud/3rdparty/guzzlehttp/psr7/src/Request.php#14|2018-10-16T10:19:55+0300|

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

<?php
$CONFIG = array (
  'instanceid' => 'id',
  'passwordsalt' => 'salt',
  'secret' => 'secret',
  'trusted_domains' =>
  array (
    0 => 'cloud.example.local',
  ),
  'datadirectory' => '/var/opt/nextcloud/',
  'overwrite.cli.url' => 'https://cloud.example.local',
  'has_internet_connection' => false,
  'dbtype' => 'mysql',
  'version' => '14.0.3.0',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud_db_user',
  'dbpassword' => 'password',
  'logtype' => 'file',
  'logfile' => '/var/log/nc_logs/nextcloud.log',
  'logtimezone' => 'Europe/Moscow',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'mail.example.ru',
  'mail_smtpport' => '25',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'example.ru',
  'proxy' => 'proxy.example.local:8080',
  'proxyuserpwd' => 'user:password',
  'trusted_proxies' =>
  array (
    0 => 'proxy.example.local',
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => 'secret',
);

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

2018/10/16 10:19:55 [error] 2270#0: *1094 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Trait 'Ђ' not found in /var/www/nextcloud/3rdparty/guzzlehttp/psr7/src/Request.php on line 14" while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "POST /ocs/v2.php/cloud/users HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:20:04 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /ocs/v2.php/cloud/groups/users/users/details?offset=0&limit=25&search= HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:20:08 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /ocs/v2.php/cloud/groups/admin/users/details?offset=0&limit=25&search= HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:20:20 [error] 2270#0: *1094 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Trait '™ ' not found in /var/www/nextcloud/settings/Controller/PersonalSettingsController.php on line 35" while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:20:22 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:20:34 [error] 2268#0: *578 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /apps/files/api/v1/recent HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:20:52 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:21:05 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /apps/files/api/v1/recent HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:21:07 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /ocs/v1.php/apps/files_sharing/api/v1/remote_shares?format=json&include_tags=true HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:21:07 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /ocs/v1.php/apps/files_sharing/api/v1/shares?format=json&shared_with_me=true&include_tags=true HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:21:24 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /ocs/v2.php/cloud/groups/users/users/details?offset=0&limit=25&search= HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:21:27 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:21:58 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "DELETE /ocs/v2.php/cloud/users/john HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:03 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "DELETE /ocs/v2.php/cloud/users/john HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:14 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /ocs/v2.php/cloud/groups/admin/users/details?offset=0&limit=25&search= HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:16 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /ocs/v2.php/cloud/groups/admin/users/details?offset=0&limit=25&search= HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:19 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /ocs/v2.php/cloud/groups/admin/users/details?offset=0&limit=25&search= HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:22 [error] 2270#0: *1094 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Trait ' people by entering a user or group or an email address.' not found in /var/www/nextcloud/settings/Controller/PersonalSettingsController.php on line 35" while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:24 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:25 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:26 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:26 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:27 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:27 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:27 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:27 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:22:27 [error] 2270#0: *1094 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"
2018/10/16 10:24:38 [error] 2268#0: *578 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.101.18, server: cloud.example.local, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/rh-php-fpm.sock:", host: "cloud.example.local"