### Steps to reproduce
1. Perform manual upgrade from 13.0.6 to 14.0.3 using `s…udo -u www-data php /var/www/nextcloud/occ upgrade`
### Expected behaviour
Upgrade should run and complete (this has been my upgrade method for the past year without any issue!).
### Actual behaviour
occ command throws an unhandled exception
`An unhandled exception has been thrown:`
`TypeError: Argument 4 passed to OCA\Theming\ThemingDefaults::__construct() must implement interface OCP\Files\IAppData, instance of OC\Memcache\Factory given, called in /var/www/nextcloud/lib/private/Server.php on line 952 and defined in /var/www/nextcloud/apps/theming/lib/ThemingDefaults.php:93`
`Stack trace:`
`#0 /var/www/nextcloud/lib/private/Server.php(952): 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))`
`#1 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))`
`#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('ThemingDefaults')`
`#3 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('ThemingDefaults')`
`#4 /var/www/nextcloud/lib/private/Server.php(1857): OC\ServerContainer->query('ThemingDefaults')`
`#5 /var/www/nextcloud/lib/private/Console/Application.php(71): OC\Server->getThemingDefaults()`
`#6 /var/www/nextcloud/console.php(93): OC\Console\Application->__construct(Object(OC\AllConfig), Object(Symfony\Component\EventDispatcher\EventDispatcher), Object(OC\AppFramework\Http\Request), Object(OC\Log), Object(OC\MemoryInfo))`
`#7 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')`
`#8 {main}`
### Server configuration
**Operating system:** Debian 9.6
**Web server:** 2.4.25
**Database:** MariaDB 10.1.26-MariaDB-0+deb9u1
**PHP version:** 7.0.30-0+deb9u1
**Nextcloud version:** 14.0.3
**Updated from an older Nextcloud/ownCloud or fresh install:** Update process from 13.0.6 to 14.0.3
**Where did you install Nextcloud from:** Nextcloud website
**Signing status:** Can't login right now.
**List of activated apps:** occ command also won't run when trying to get `app:list`
<details>
<summary>App list</summary>
```
An unhandled exception has been thrown:
TypeError: Argument 4 passed to OCA\Theming\ThemingDefaults::__construct() must implement interface OCP\Files\IAppData, instance of OC\Memcache\Factory given, called in /var/www/nextcloud/lib/private/Server.php on line 952 and defined in /var/www/nextcloud/apps/theming/lib/ThemingDefaults.php:93
Stack trace:
#0 /var/www/nextcloud/lib/private/Server.php(952): 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))
#1 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('ThemingDefaults')
#3 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('ThemingDefaults')
#4 /var/www/nextcloud/lib/private/Server.php(1857): OC\ServerContainer->query('ThemingDefaults')
#5 /var/www/nextcloud/lib/private/Console/Application.php(71): OC\Server->getThemingDefaults()
#6 /var/www/nextcloud/console.php(93): OC\Console\Application->__construct(Object(OC\AllConfig), Object(Symfony\Component\EventDispatcher\EventDispatcher), Object(OC\AppFramework\Http\Request), Object(OC\Log), Object(OC\MemoryInfo))
#7 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#8 {main}
```
</details>
**Nextcloud configuration:**
<details>
<summary>config.php</summary>
```
<?php
$CONFIG = array (
'instanceid' => 'ID',
'passwordsalt' => 'SALT',
'secret' => 'SECRET',
'trusted_domains' =>
array (
0 => 'DOMAIN0',
1 => 'DOMAIN1',
),
'datadirectory' => '/mnt/nextcloud_data',
'overwrite.cli.url' => 'https://DOMAIN',
'htaccess.RewriteBase' => '/',
'dbtype' => 'mysql',
'version' => '13.0.6.1',
'dbname' => 'nextclouddb',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'nextcloud',
'dbpassword' => 'SQLPASSWORD',
'installed' => true,
'default_language' => 'en',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'localhost',
'port' => 6379,
),
'mail_smtpmode' => 'smtp',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpsecure' => 'ssl',
'mail_from_address' => 'no-reply',
'mail_domain' => 'DOMAIN',
'mail_smtpauth' => 1,
'mail_smtphost' => 'MAILPROVIDER',
'mail_smtpport' => '465',
'mail_smtpname' => 'ADDRESS',
'mail_smtppassword' => 'PASSWORD',
'loglevel' => 2,
'maintenance' => false,
);
```
</details>
**Are you using external storage, if yes which one:** No
**Are you using encryption:** No
**Are you using an external user-backend, if yes which one:** No
### Client configuration
**Browser:** Doesn't apply.
**Operating system:** Doesn't apply.
### Logs
#### Web server error log
<details>
<summary>Web server error log</summary>
```
No relevant server log.
```
</details>
#### Nextcloud log (data/nextcloud.log)
<details>
<summary>Nextcloud log</summary>
```
...
...
...
{"reqId":"848iPZk8VzHUitiG5dVA","level":3,"time":"2018-11-18T09:47:45+00:00","remoteAddr":"172.16.20.12","user":"--","app":"PHP","method":"OPTIONS","url":"\/remote.php\/dav\/principals\/users\/goncaloheleno\/","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"iOS\/12.0 (16A366) dataaccessd\/1.0","version":"13.0.6.1"}
{"reqId":"eJNT6CeaGS0pYXP4scId","level":4,"time":"2018-11-18T09:47:45+00:00","remoteAddr":"172.16.20.12","user":"--","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/principals\/users\/goncaloheleno\/","message":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952","Code":0,"Trace":[{"function":"{closure}","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[{"__class__":"Closure"},["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":466,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["beforeMethod",["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"\/var\/www\/nextcloud\/remote.php","line":72,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/remote.php","line":168,"function":"handleException","args":[{"__class__":"TypeError"}]}],"File":"\/var\/www\/nextcloud\/remote.php","Line":70,"CustomMessage":"--"},"userAgent":"iOS\/12.0 (16A366) dataaccessd\/1.0","version":"13.0.6.1"}
{"reqId":"iAYM3Fcmsc9dIWaVZjJ2","level":3,"time":"2018-11-18T09:48:01+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"e68ZvUqAityaS8ZCmXmD","level":3,"time":"2018-11-18T09:48:33+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"YNcJsgjvOIz1mQAEDMX3","level":3,"time":"2018-11-18T09:49:05+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"UgH5ijpiCr5S0QzgDNhD","level":3,"time":"2018-11-18T09:49:37+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"tyDrLyvJRN6TXtAiYDBm","level":3,"time":"2018-11-18T09:50:09+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"aQW2AKlqCEWbgcBvOb2d","level":3,"time":"2018-11-18T09:50:41+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"U5pS1fBQXUlfbnf9hICB","level":3,"time":"2018-11-18T09:51:13+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"fEFB4B5NwqD7RMnvP2Qp","level":3,"time":"2018-11-18T09:51:45+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"f6ynwOLWLjERJfrBbS0R","level":3,"time":"2018-11-18T09:52:17+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"MHEIIxkeDhZWjg0D67ue","level":3,"time":"2018-11-18T09:52:49+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"vPSIOnP50NMxPS5Vtd6l","level":3,"time":"2018-11-18T09:53:21+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"0tPSnst7q6pyQUb6LL5m","level":3,"time":"2018-11-18T09:53:53+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"VgUXsUjYtulfy6dyzDCl","level":3,"time":"2018-11-18T09:54:25+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"6dN3ehe7lFPjW61LxWp0","level":3,"time":"2018-11-18T09:54:57+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"yFpIiYPHXJ2FD0aHuuSX","level":3,"time":"2018-11-18T09:55:29+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"zAa4aXUplhTry02fcYaU","level":3,"time":"2018-11-18T09:56:01+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"BixdYfK10yc3JnrojswS","level":3,"time":"2018-11-18T09:56:33+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
{"reqId":"7ShLVlzCgxFtzBjpjoMb","level":3,"time":"2018-11-18T09:57:05+00:00","remoteAddr":"172.16.20.11","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"TypeError: Argument 4 passed to OCA\\Theming\\ThemingDefaults::__construct() must implement interface OCP\\Files\\IAppData, instance of OC\\Memcache\\Factory given, called in \/var\/www\/nextcloud\/lib\/private\/Server.php on line 952 at \/var\/www\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php#93","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.3.3 (build 84) (Nextcloud)","version":"13.0.6.1"}
```
</details>
#### Browser log
<details>
<summary>Browser log</summary>
```
Doesn't apply.
```
</details>