Nextcloud 12 Upgrade Error

Nextcloud version: from 11 to 12.0.3
Operating system and version: Ubuntu 16.04
Apache or nginx version: Apache 2.4.18
PHP version: 7.0.22
Is this the first time you’ve seen this error?: Yes

Can you reliably replicate it? (If so, please outline steps): Yes,everytime I try to manually upgrade from 11 to 12.0.3 via command line

The issue you are facing:

trying to upgrade from 11 to 12.0.3 via command line. When running:

 sudo -u www-data php occ upgrade

The following error is received:

OCP\Lock\LockedException: “/themedinstancelogo” is locked
Update failed

I haven’t been able to find any resolution online. Any help is appreciated.

Thanks!!!

Full output:

Set log level to debug
Turned on maintenance mode
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Updater::maintenanceEnabled: Turned on maintenance mode",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:0,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“core”,“method”:"–",“url”:"–",“message”:“starting upgrade from 11.0.0.10 to 12.0.3.3”,“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:3,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“file_get_contents(/var/www/.htaccess): failed to open stream: No such file or directory at /var/www/lib/private/Setup.php#446”,“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Repair::step: Repair step: Repair MySQL collation",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Repair::info: Repair info: All tables already have the correct collation -> nothing to do",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Repair::step: Repair step: Repair SQLite autoincrement",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Repair::step: Repair step: Copy data from accounts table when migrating from ownCloud",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Repair::step: Repair step: Drop account terms table when migrating from ownCloud",“userAgent”:"–",“version”:“11.0.0.10”}
Updating database schema
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:58+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Updater::dbUpgradeBefore: Updating database schema",“userAgent”:"–",“version”:“11.0.0.10”}
Updated database
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Updater::dbUpgrade: Updated database",“userAgent”:"–",“version”:“11.0.0.10”}
Updating …
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Updater::appUpgradeStarted: Updating …",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Repair::step: Repair step: Move theming files to AppData storage",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:3,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“no app in context”,“method”:"–",“url”:"–",“message”:"$absolutePath must be relative to “files”, value is “%s”",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:3,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“core”,“method”:"–",“url”:"–",“message”:“Exception: {“Exception”:“OCP\\Lock\\LockedException”,“Message”:”\"\/themedinstancelogo\" is locked",“Code”:0,“Trace”:"#0 \/var\/www\/lib\/private\/Files\/View.php(1130): OC\\Files\\View->changeLock(’\/themedinstance…’, 2)\n#1 \/var\/www\/lib\/private\/Files\/View.php(701): OC\\Files\\View->basicOperation(‘unlink’, ‘\/themedinstance…’, Array)\n#2 \/var\/www\/lib\/private\/Files\/Node\/File.php(116): OC\\Files\\View->unlink(’\/themedinstance…’)\n#3 \/var\/www\/apps\/theming\/lib\/Migration\/ThemingImages.php(63): OC\\Files\\Node\\File->delete()\n#4 \/var\/www\/lib\/private\/Repair.php(89): OCA\\Theming\\Migration\\ThemingImages->run(Object(OC\\Repair))\n#5 \/var\/www\/lib\/private\/legacy\/app.php(1113): OC\\Repair->run()\n#6 \/var\/www\/lib\/private\/legacy\/app.php(1049): OC_App::executeRepairSteps(‘theming’, Array)\n#7 \/var\/www\/lib\/private\/Updater.php(379): OC_App::updateApp(‘theming’)\n#8 \/var\/www\/lib\/private\/Updater.php(262): OC\\Updater->doAppUpgrade()\n#9 \/var\/www\/lib\/private\/Updater.php(130): OC\\Updater->doUpgrade(‘12.0.3.3’, ‘11.0.0.10’)\n#10 \/var\/www\/core\/Command\/Upgrade.php(263): OC\\Updater->upgrade()\n#11 \/var\/www\/3rdparty\/symfony\/console\/Command\/Command.php(256): OC\\Core\\Command\\Upgrade->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#12 \/var\/www\/3rdparty\/symfony\/console\/Application.php(818): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#13 \/var\/www\/3rdparty\/symfony\/console\/Application.php(186): Symfony\\Component\\Console\\Application->doRunCommand(Object(OC\\Core\\Command\\Upgrade), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#14 \/var\/www\/3rdparty\/symfony\/console\/Application.php(117): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#15 \/var\/www\/lib\/private\/Console\/Application.php(170): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#16 \/var\/www\/console.php(100): OC\\Console\\Application->run()\n#17 \/var\/www\/occ(11): require_once(’\/var\/www\/consol…’)\n#18 {main}",“File”:"\/var\/www\/lib\/private\/Files\/View.php",“Line”:1960}",“userAgent”:"–",“version”:“11.0.0.10”}
OCP\Lock\LockedException: “/themedinstancelogo” is locked
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:3,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Updater::failure: OCP\Lock\LockedException: “/themedinstancelogo” is locked",“userAgent”:"–",“version”:“11.0.0.10”}
Update failed
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:3,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Updater::updateEnd: Update failed",“userAgent”:"–",“version”:“11.0.0.10”}
Maintenance mode is kept active
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Updater::maintenanceActive: Maintenance mode is kept active",“userAgent”:"–",“version”:“11.0.0.10”}
Reset log level
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:1,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"–",“url”:"–",“message”:"\OC\Updater::resetLogLevel: Reset log level to Warning(2)",“userAgent”:"–",“version”:“11.0.0.10”}
{“reqId”:“wMreMEs8yAmljFdwq03i”,“level”:3,“time”:“2017-11-24T17:05:59+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“chmod(): Operation not permitted at /var/www/lib/private/Log/File.php#134”,“userAgent”:"–",“version”:“11.0.0.10”}

This may help:

Thanks, that worked!!!