Nexcloud 16 error

Hello Everyone,
On nextcloud 16 give error bellow


[root@canext00 nextcloud]# sudo -u nginx php occ files:scan --all
An unhandled exception has been thrown:
TypeError: Argument 4 passed to OCA\Theming\ThemingDefaults::__construct() must be an instance of OC_Defaults, instance of OC\Memcache\Factory given, called in /usr/share/nextcloud/lib/private/Server.php on line 965 and defined in /usr/share/nextcloud/apps/theming/lib/ThemingDefaults.php:58
Stack trace:
#0 /usr/share/nextcloud/lib/private/Server.php(965): OCA\Theming\ThemingDefaults->__construct(Object(OC\AllConfig), Object(OC\L10N\L10N), Object(OC\URLGenerator), Object(OC\Memcache\Factory), Object(OCA\Theming\Util), Object(OCA\Theming\ImageManager), Object(OC\App\AppManager), Object(OC\NavigationManager))
#1 /usr/share/php/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#2 /usr/share/nextcloud/lib/private/ServerContainer.php(125): Pimple\Container->offsetGet('ThemingDefaults')
#3 /usr/share/nextcloud/lib/private/Server.php(1885): OC\ServerContainer->query('ThemingDefaults')
#4 /usr/share/nextcloud/lib/private/Console/Application.php(71): OC\Server->getThemingDefaults()
#5 /usr/share/nextcloud/console.php(94): OC\Console\Application->__construct(Object(OC\AllConfig), Object(Symfony\Component\EventDispatcher\EventDispatcher), Object(OC\AppFramework\Http\Request), Object(OC\Log), Object(OC\MemoryInfo))
#6 /usr/share/nextcloud/occ(11): require_once('/usr/share/next...')

[/details]

Nextcloud version 16.1.1:
Operating system and version FedoraServer 29:
Apache or nginx version nginx-1.14.2-2.fc29.x86_64:
PHP version : php-7.2.20-1.fc29.x86_64

The issue you are facing:

Any command failing or request failing with error 500

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

N/A

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

Can’t login

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

<?php
$CONFIG = array (
  'log_type' => 'syslog',
  'datadirectory' => '/var/lib/nextcloud/data/',
  'updatechecker' => false,
  'check_for_working_htaccess' => false,
  'asset-pipeline.enabled' => false,
  'assetdirectory' => '/var/lib/nextcloud',
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/share/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 => 
    array (
      'path' => '/var/lib/nextcloud/apps',
      'url' => '/apps-appstore',
      'writable' => true,
    ),
  ),
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '',
    1 => '',
    2 => '',
  ),
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'dbtype' => 'pgsql',
  'version' => '16.0.1.1',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'logtimezone' => 'UTC',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_from_address' => '',
  'mail_domain' => '',
  'mail_smtphost' => '',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'mail_smtpauthtype' => 'LOGIN',
  'theme' => '',
);

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

- user [30/Jul/2019:09:51:07 -0400] "GET /nextcloud/status.php HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Linux) mirall/2.5.2git (Nextcloud)" "::ffff:"
- user [30/Jul/2019:09:51:36 -0400] "GET /nextcloud/status.php HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Linux) mirall/2.5.2git (Nextcloud)" "::ffff:"

Are you using your own themes? Does the default theme fail as well?

I just replaced back ground image and small logo.
I can’t load any pages it give 500 error

There is someone with a similar error from some time ago:

I can’t reinstall due existing very important data.

Worth checking if there is a permission problem? Nobody asks you to reinstall everything, many beginners tweaked their setup so much that at some point they find it easier to do a complete fresh install.

Did you check what is at this location:

require_once('/usr/share/next...')

perhaps related to the background image and logo?

I checked permissions and selinux. Everything looks ok.

nextcloud]# ls -laZ

   total 576
drwxr-xr-x.  15 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       4096 Aug  4 09:38 .
drwxr-xr-x. 151 root  root  system_u:object_r:usr_t:s0                        4096 Jul 29 09:39 ..
drwxr-xr-x.  32 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       4096 Jul 29 09:37 3rdparty
drwxr-xr-x.  53 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       4096 Jul 29 09:37 apps
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0      12063 May 20 22:16 AUTHORS
lrwxrwxrwx.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0         14 Jan  9  2019 config -> /etc/nextcloud
drwxr-xr-x.   2 nginx nginx unconfined_u:object_r:httpd_sys_rw_content_t:s0    117 Aug  4 10:17 config.bak
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       3805 May 20 22:16 console.php
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0      34520 May 20 22:16 COPYING
drwxr-xr-x.  23 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       4096 May 20 22:16 core
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       4986 May 20 22:16 cron.php
drwxrwx---.   5 nginx nginx unconfined_u:object_r:httpd_sys_rw_content_t:s0    150 May 11 13:23 data
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       2498 May 20 22:16 .htaccess
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0        156 May 20 22:16 index.html
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       3172 May 20 22:16 index.php
-rw-r--r--.   1 nginx nginx unconfined_u:object_r:httpd_sys_rw_content_t:s0 457626 May 15 13:52 keeweb-0.5.1.tar.gz
drwxr-xr-x.   6 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0        125 Aug  4 09:38 lib
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0        283 May 20 22:16 occ
drwxr-xr-x.   2 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0         23 May 20 22:16 ocm-provider
drwxr-xr-x.   2 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0         55 May 20 22:16 ocs
drwxr-xr-x.   2 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0         23 May 20 22:16 ocs-provider
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       2951 May 20 22:16 public.php
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       5139 May 20 22:16 remote.php
drwxr-xr-x.   4 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0        107 May 20 22:16 resources
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0         26 May 20 22:16 robots.txt
drwxr-xr-x.  12 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0        248 May 20 22:16 settings
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0       2232 May 20 22:16 status.php
drwxr-xr-x.   3 nginx nginx unconfined_u:object_r:httpd_sys_rw_content_t:s0     35 Jul 30 01:34 themes
drwxr-xr-x.   2 nginx nginx unconfined_u:object_r:httpd_sys_rw_content_t:s0     43 May 20 22:16 updater
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0        101 May 20 22:16 .user.ini
-rw-r--r--.   1 nginx nginx system_u:object_r:httpd_sys_rw_content_t:s0        362 May 20 22:16 version.php

Here all require_once

https://paste.fedoraproject.org/paste/3Knlyd18IAJbMDg~XbKssg

System is standard setup

I found as well some old issue where there was old app-code:

Did you update? If yes, from which version?

I was more referring to your error stack trace if there are more details on what file it failed?

I have just seen that you still have the asset-pipeline in your config file that was removed some time ago (NC 12 or so). So I suppose it is an older setup. How did you upgrade? If you do it manually, don’t just copy over new code, remove the older code and place the new one (keep of course your data and config folder). You have two apps folder. Are there any conflicts, a few apps might have moved to the apps that are shipped with Nextcloud and if you have a copy in your other folder, this might be a problem.