Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from Nextcoud 19.0.4 to 20.0.0 fails during execution of occ upgrade #876

Closed
ArmyOfMonkies opened this issue Oct 14, 2020 · 18 comments
Labels
API Impact API/Backend code bug

Comments

@ArmyOfMonkies
Copy link

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Start the web based updater from within nextcloud.
  2. The update process proceeds without erros and when asked if maintenance mode should be kept active answer yes
  3. Start terminal and do as the updater instructs, trigger the migration by running ./occ upgrade

Expected behaviour

I expect the upgrade to finish and me having an upgraded nextcloud installation.

Actual behaviour

The uppgrade process starts and then fails after a while. From what i can see it fails during the migration of data belonging to the news app.

Restarting the upgrade once again, by running ./occ upgrade finishes the upgrade with no further errors. But leaves me wondering what state my installation is in.

Server configuration

Operating system:
Ubuntu 20.04.1 LTS

Web server:
Apache 2.4.41-4ubuntu3.1

Database:
SQLite 3.31.1-4ubuntu0.2

PHP version:
Php 7.4.3-4ubuntu2.2

Nextcloud version: (see Nextcloud admin page) **
20.0.0

Updated from an older Nextcloud/ownCloud or fresh install:
19.0.4

Where did you install Nextcloud from:
web updater

Signing status:

Signing status No errors have been found.

List of activated apps:

App list

root@HOSTNAME:/var/www/nextcloud# sudo -u www-data php occ app:list
Enabled:

  • accessibility: 1.6.0
  • activity: 2.13.1
  • admin_audit: 1.10.0
  • apporder: 0.11.0
  • audioplayer: 2.12.0
  • bookmarks: 3.4.3
  • bruteforcesettings: 2.0.1
  • carnet: 0.22.3
  • cloud_federation_api: 1.3.0
  • comments: 1.10.0
  • contacts: 3.4.0
  • contactsinteraction: 1.1.0
  • dav: 1.16.0
  • deck: 1.1.2
  • federatedfilesharing: 1.10.1
  • federation: 1.10.1
  • files: 1.15.0
  • files_markdown: 2.3.1
  • files_mindmap: 0.0.23
  • files_pdfviewer: 2.0.1
  • files_rightclick: 0.17.0
  • files_sharing: 1.12.0
  • files_texteditor: 2.14.0
  • files_trashbin: 1.10.1
  • files_versions: 1.13.0
  • files_videoplayer: 1.9.0
  • firstrunwizard: 2.9.0
  • gpxpod: 4.2.3
  • logreader: 2.5.0
  • lookup_server_connector: 1.8.0
  • metadata: 0.12.0
  • news: 15.0.4
  • nextcloud_announcements: 1.9.0
  • notes: 4.0.0
  • notifications: 2.8.0
  • oauth2: 1.8.0
  • onlyoffice: 6.0.2
  • password_policy: 1.10.1
  • passwords: 2020.10.0
  • photos: 1.2.0
  • polls: 1.5.4
  • privacy: 1.4.0
  • provisioning_api: 1.10.0
  • qownnotesapi: 20.9.0
  • recommendations: 0.8.0
  • serverinfo: 1.10.0
  • settings: 1.2.0
  • sharebymail: 1.10.0
  • support: 1.3.0
  • systemtags: 1.10.0
  • tasks: 0.13.4
  • theming: 1.11.0
  • twofactor_backupcodes: 1.9.0
  • twofactor_totp: 5.0.0
  • updatenotification: 1.10.0
  • user_ldap: 1.10.2
  • user_status: 1.0.0
  • viewer: 1.4.0
  • weather_status: 1.0.0
  • workflowengine: 2.2.0
    Disabled:
  • calendar
  • circles
  • cms_pico
  • dashboard
  • documentserver_community
  • encryption
  • files_downloadactivity
  • files_ebookreader
  • files_external
  • files_lock
  • files_opds
  • files_retention
  • quicknotes
  • quota_warning
  • richdocuments
  • richdocumentscode
  • spreed
  • survey_client
  • text
  • twofactor_u2f

Nextcloud configuration:

Config report

root@HOSTNAME:/var/www/nextcloud# sudo -u www-data php occ config:list system
{
"system": {
"instanceid": "REMOVED SENSITIVE VALUE",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"localhost",
"HOSTNAME",
"REMOVED SENSITIVE VALUE",
"REMOVED SENSITIVE VALUE"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "sqlite3",
"version": "20.0.0.9",
"installed": true,
"forcessl": true,
"appcodechecker": false,
"theme": "",
"maintenance": false,
"secret": "REMOVED SENSITIVE VALUE",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_smtpmode": "smtp",
"mail_domain": "REMOVED SENSITIVE VALUE",
"appstore.experimental.enabled": true,
"loglevel": 0,
"trashbin_retention_obligation": "auto",
"enabledPreviewProviders": [
"OC\Preview\Image",
"OC\Preview\MP3",
"OC\Preview\TXT",
"OC\Preview\MarkDown",
"OC\Preview\Epub",
"OC\Preview\PDF"
],
"updatechecker": false,
"overwrite.cli.url": "REMOVED SENSITIVE VALUE",
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "OCA\User_LDAP\LDAPProviderFactory",
"memcache.local": "\OC\Memcache\APCu",
"app_install_overwrite": [
"files_opds",
"files_ebookreader",
"files_reader",
"dashboard"
],
"has_rebuilt_cache": true,
"updater.release.channel": "beta",
"updater.secret": "REMOVED SENSITIVE VALUE"
}
}

Are you using external storage, if yes which one: local/smb/sftp/...
None

Are you using encryption: yes/no
No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

Client configuration

Browser:
Firefox 81.0.1 (64-bit)

Operating system:
Fedora 32

Logs

root@HOSTNAME:/var/www/nextcloud# sudo -u www-data php7.4 ./occ upgrade
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
Setting log level to debug
Updating database schema
Updated database
Disabled incompatible app: calendar
Disabled incompatible app: circles
Disabled incompatible app: quicknotes
Disabled incompatible app: quota_warning
Disabled incompatible app: spreed
Updating ...
Migrate old user config

Done
2/2 [============================] 100%
Updated to 1.6.0
Updating ...
Updated to 1.1.0
Updating ...
Updated to 1.10.1
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 2.0.1
Updating <files_rightclick> ...
Updated <files_rightclick> to 0.17.0
Updating <files_videoplayer> ...
Updated <files_videoplayer> to 1.9.0
Updating ...
Updated to 2.5.0
Updating ...
Updated to 1.2.0
Updating ...
Updated to 1.4.0
Updating <provisioning_api> ...
Updated <provisioning_api> to 1.10.0
Updating ...
Updated to 0.8.0
Updating ...
Updated to 1.10.0
Updating ...
Updated to 1.2.0
Updating ...
Updated to 1.3.0
Updating <twofactor_backupcodes> ...
Updated <twofactor_backupcodes> to 1.9.0
Updating ...
Updated to 1.10.0
Updating ...
Updated to 1.4.0
Updating ...
Updated to 1.10.1
Updating <lookup_server_connector> ...
Updated <lookup_server_connector> to 1.8.0
Updating ...
Updated to 1.8.0
Updating <password_policy> ...
Updated <password_policy> to 1.10.1
Updating <user_ldap> ...
Updated <user_ldap> to 1.10.2
Updating ...
Updated to 1.15.0
Updating ...
Updated to 2.13.1
Updating <cloud_federation_api> ...
Updated <cloud_federation_api> to 1.3.0
Updating ...
Fix broken values of calendar objects
Done
0/0 [----->----------------------] 0%
Updated to 1.16.0
Updating <files_sharing> ...
Updated <files_sharing> to 1.12.0
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.10.1
Updating <files_versions> ...
Updated <files_versions> to 1.13.0
Updating ...
Updated to 1.10.0
Updating ...
Updated to 2.2.0
Updating <admin_audit> ...
Updated <admin_audit> to 1.10.0
Updating ...
Updated to 1.10.0
Updating ...
Updated to 2.9.0
Updating <nextcloud_announcements> ...
Updated <nextcloud_announcements> to 1.9.0
Updating ...
Updated to 2.8.0
Updating ...
Updated to 1.10.0
Updating ...
Updated to 1.11.0
Checking for update of app accessibility in appstore
Checked for update of app "accessibility" in appstore
Checking for update of app activity in appstore
Checked for update of app "activity" in appstore
Checking for update of app admin_audit in appstore
Checked for update of app "admin_audit" in appstore
Checking for update of app apporder in appstore
Checked for update of app "apporder" in appstore
Checking for update of app audioplayer in appstore
Checked for update of app "audioplayer" in appstore
Checking for update of app bookmarks in appstore
Checked for update of app "bookmarks" in appstore
Checking for update of app bruteforcesettings in appstore
Checked for update of app "bruteforcesettings" in appstore
Checking for update of app carnet in appstore
Checked for update of app "carnet" in appstore
Checking for update of app cloud_federation_api in appstore
Checked for update of app "cloud_federation_api" in appstore
Checking for update of app comments in appstore
Checked for update of app "comments" in appstore
Checking for update of app contacts in appstore
Checked for update of app "contacts" in appstore
Checking for update of app contactsinteraction in appstore
Checked for update of app "contactsinteraction" in appstore
Checking for update of app dav in appstore
Checked for update of app "dav" in appstore
Checking for update of app deck in appstore
Checked for update of app "deck" in appstore
Checking for update of app federatedfilesharing in appstore
Checked for update of app "federatedfilesharing" in appstore
Checking for update of app federation in appstore
Checked for update of app "federation" in appstore
Checking for update of app files in appstore
Checked for update of app "files" in appstore
Checking for update of app files_markdown in appstore
Checked for update of app "files_markdown" in appstore
Checking for update of app files_mindmap in appstore
Checked for update of app "files_mindmap" in appstore
Checking for update of app files_pdfviewer in appstore
Checked for update of app "files_pdfviewer" in appstore
Checking for update of app files_rightclick in appstore
Checked for update of app "files_rightclick" in appstore
Checking for update of app files_sharing in appstore
Checked for update of app "files_sharing" in appstore
Checking for update of app files_texteditor in appstore
Checked for update of app "files_texteditor" in appstore
Checking for update of app files_trashbin in appstore
Checked for update of app "files_trashbin" in appstore
Checking for update of app files_versions in appstore
Checked for update of app "files_versions" in appstore
Checking for update of app files_videoplayer in appstore
Checked for update of app "files_videoplayer" in appstore
Checking for update of app firstrunwizard in appstore
Checked for update of app "firstrunwizard" in appstore
Checking for update of app gpxpod in appstore
Update app gpxpod from appstore
Checked for update of app "gpxpod" in appstore
Checking for update of app logreader in appstore
Checked for update of app "logreader" in appstore
Checking for update of app lookup_server_connector in appstore
Checked for update of app "lookup_server_connector" in appstore
Checking for update of app metadata in appstore
Checked for update of app "metadata" in appstore
Checking for update of app news in appstore
Update app news from appstore
An unhandled exception has been thrown:
Error: Undefined class constant 'DEFAULT_SETTINGS' in /var/www/nextcloud/apps/news/lib/Migration/MigrateConfig.php:49
Stack trace:
#0 [internal function]: OCA\News\Migration\MigrateConfig->__construct()
nextcloud/server#1 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(101): ReflectionClass->newInstanceArgs()
nextcloud/server#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(109): OC\AppFramework\Utility\SimpleContainer->buildClass()
nextcloud/server#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(126): OC\AppFramework\Utility\SimpleContainer->resolve()
nextcloud/server#4 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(455): OC\AppFramework\Utility\SimpleContainer->query()
nextcloud/server#5 /var/www/nextcloud/lib/private/ServerContainer.php(140): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
nextcloud/server#6 /var/www/nextcloud/lib/private/Repair.php(119): OC\ServerContainer->query()
nextcloud/server#7 /var/www/nextcloud/lib/private/legacy/OC_App.php(1035): OC\Repair->addStep()
nextcloud/server#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(979): OC_App::executeRepairSteps()
nextcloud/server#9 /var/www/nextcloud/lib/private/Installer.php(206): OC_App::updateApp()
nextcloud/server#10 /var/www/nextcloud/lib/private/Updater.php(452): OC\Installer->updateAppstoreApp()
nextcloud/server#11 /var/www/nextcloud/lib/private/Updater.php(260): OC\Updater->upgradeAppStoreApps()
nextcloud/server#12 /var/www/nextcloud/lib/private/Updater.php(130): OC\Updater->doUpgrade()
nextcloud/server#13 /var/www/nextcloud/core/Command/Upgrade.php(255): OC\Updater->upgrade()
nextcloud/server#14 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
nextcloud/server#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run()
nextcloud/server#16 /var/www/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand()
nextcloud/server#17 /var/www/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun()
nextcloud/server#18 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
nextcloud/server#19 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
nextcloud/server#20 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
root@HOSTNAME:/var/www/nextcloud#

Web server error log

Web server error log

This is the whole file, i cleared it before uppgrading.

[Wed Oct 14 17:53:35.497311 2020] [mpm_prefork:notice] [pid 74790] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Wed Oct 14 17:53:35.497492 2020] [core:notice] [pid 74790] AH00094: Command line: '/usr/sbin/apache2'
[Wed Oct 14 18:02:40.070631 2020] [access_compat:error] [pid 74857] [client 192.168.8.165:58264] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Wed Oct 14 18:02:55.475188 2020] [access_compat:error] [pid 74855] [client 192.168.8.165:58278] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Wed Oct 14 19:39:38.620532 2020] [access_compat:error] [pid 74853] [client 192.168.8.165:59110] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata

Nextcloud log (data/nextcloud.log)

Nextcloud log

Last 10 entries, i have skimmed trough the logfile and its huge but i cant see anything relevant in it.

{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"contacts","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"files_sharing","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"onlyoffice","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"files_markdown","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"files_mindmap","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"files_texteditor","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"metadata","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"polls","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"qownnotesapi","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
{"reqId":"WUbOOH3ABuMiE61hp5bv","level":0,"time":"2020-10-14T18:05:28+00:00","remoteAddr":"192.168.1.10","user":"MY_USERNAME","app":"twofactor_totp","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0","version":"20.0.0.9"}
root@livamu:/var/www/nextcloud/data#

Browser log

Browser log I dont think there are any relevant browser logs to include. The whole failure occurs outside of the browser, and i sadly dont have any console logs left after the uppgrade procedure from the web browser. I might be able to trigger this whole thing again if it is badly needed.
@kesselb kesselb transferred this issue from nextcloud/server Oct 15, 2020
@anoymouserver
Copy link
Contributor

related to #820 (same but other class constant)

@ArmyOfMonkies
Copy link
Author

FYI i have a snapshot of the 19.0.4 install from just before the uppgrade to 20.0.0 so i can do the whole ting again, with a bit of manual work.

@dmp1ce
Copy link

dmp1ce commented Oct 18, 2020

What do I do to complete the upgrade after a crash like this?

I just ran occ upgrade again and it skipped the news plugin update. I hope that was the right thing to do.

@ArmyOfMonkies
Copy link
Author

What do I do to complete the upgrade after a crash like this?

I just ran occ upgrade again and it skipped the news plugin update. I hope that was the right thing to do.

I have no clue on what state the database tables for the news app will be in, or any other tables for that matter. I would recommend to restore from backup or snapshot and await a fix for this before uppgrading to 20.0.

I have not enough understanding of what goes wrong to be able to investigate this myself, but as i have snapshots if anyone tells me what to do i can redo the whole thing, trigger the bug and dump additional information.

@julienfastre
Copy link

I could start the container by removing the directory containing the news app.

Then the container started and I could resume upgrade process by using php occ upgrade.

I did not tryed to re-install the news app.

@mcorteel-harel
Copy link

mcorteel-harel commented Oct 27, 2020

The migration worked well with this simple patch:

apps/news/lib/Migration/MigrateConfig.php:49
-         $this->defaults = $application::DEFAULT_SETTINGS;
+         $this->defaults = Application::DEFAULT_SETTINGS;

I'm not sure why the constant would be accessed on the $application instance instead of the Application class anyway...

EDIT: The migration worked, but the news App doesn't work anymore...

@SMillerDev
Copy link
Contributor

That's odd, that class constant didn't work before.

@rubo77
Copy link

rubo77 commented Nov 4, 2020

I had the same issue in a docker-image when upgrading nextcloud from 19.0.4.2 to 20.0.1.1

I fixed it by calling this

docker exec --user www-data nextcloud_app_1 php occ upgrade
docker exec --user www-data nextcloud_app_1 php occ maintenance:mode --off   

@SMillerDev
Copy link
Contributor

Should be fixed in the latest release

@bardo
Copy link

bardo commented Nov 24, 2020

This just happened to me while ugrading from 19.0.5 to 20.0.2 on SmartOS/Nginx/PostgreSQL/PHP-FPM.

The occ upgrade command crashed and did not proceed looking for updates for the rest of the apps. A manual run of occ upgrade succeeded.

root@nextcloud # sudo -u fpm php updater/updater.phar
[...]
2020-11-24T12:14:46+00:00 Checking for update of app news in appstore                                                  
2020-11-24T12:14:46+00:00 Update app news from appstore   
An unhandled exception has been thrown:                                                                                
Error: Undefined class constant 'DEFAULT_SETTINGS' in /opt/local/share/nextcloud/apps/news/lib/Migration/MigrateConfig.php:49
Stack trace:                                               
#0 [internal function]: OCA\News\Migration\MigrateConfig->__construct()                                                
#1 /opt/local/share/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(101): ReflectionClass->newInstanceArgs()
#2 /opt/local/share/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(109): OC\AppFramework\Utility\SimpleContainer->buildClass()
#3 /opt/local/share/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(126): OC\AppFramework\Utility\SimpleContainer->resolve()
#4 /opt/local/share/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(455): OC\AppFramework\Utility\SimpleContainer->query()
#5 /opt/local/share/nextcloud/lib/private/ServerContainer.php(140): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
#6 /opt/local/share/nextcloud/lib/private/Repair.php(119): OC\ServerContainer->query()
#7 /opt/local/share/nextcloud/lib/private/legacy/OC_App.php(1035): OC\Repair->addStep()
#8 /opt/local/share/nextcloud/lib/private/legacy/OC_App.php(979): OC_App::executeRepairSteps()                                                                                                                                                 
#9 /opt/local/share/nextcloud/lib/private/Installer.php(206): OC_App::updateApp()
#10 /opt/local/share/nextcloud/lib/private/Updater.php(452): OC\Installer->updateAppstoreApp()                                                                                                                                                 
#11 /opt/local/share/nextcloud/lib/private/Updater.php(260): OC\Updater->upgradeAppStoreApps()
#12 /opt/local/share/nextcloud/lib/private/Updater.php(130): OC\Updater->doUpgrade()
#13 /opt/local/share/nextcloud/core/Command/Upgrade.php(255): OC\Updater->upgrade()
#14 /opt/local/share/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
#15 /opt/local/share/nextcloud/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run()
#16 /opt/local/share/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand()
#17 /opt/local/share/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun()
#18 /opt/local/share/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()  
#19 /opt/local/share/nextcloud/console.php(100): OC\Console\Application->run()
#20 /opt/local/share/nextcloud/occ(11): require_once('/opt/local/shar...')
#21 {main}                                                                                                                                                                                                                                     
Keep maintenance mode active? [y/N] y                   
Maintenance mode kept active
root@nextcloud # 

Manual run:

root@nextcloud # sudo -u fpm php updater/updater.phar
[...]
Checking for update of app lookup_server_connector in appstore
Checked for update of app "lookup_server_connector" in appstore 
Checking for update of app news in appstore
Checked for update of app "news" in appstore    
Checking for update of app nextcloud_announcements in appstore
Checked for update of app "nextcloud_announcements" in appstore
[...]
root@nextcloud # 

A run of occ maintenance:repair did not show anything suspicious.

@Grotax Grotax reopened this Nov 25, 2020
@Grotax
Copy link
Member

Grotax commented Nov 25, 2020

@SMillerDev I just tested this with 15.0.6

docker run \
-p 8080:80 \
-v nextcloud:/var/www/html \
nextcloud:19

Open browser create new admin user, uncheck the auto install option (just takes too much time)
In the Web-interface install news 14.2.2
Add random feed from the explore page, to make it more real, don't bother about the ajax warning we don't need feed updates.

docker ps
docker stop $containerID
docker run \
-p 8080:80 \
-v nextcloud:/var/www/html \
nextcloud:20

Watch upgrade process, fails with news.
Docker container will stop

docker run \
-p 8080:80 \
-v nextcloud:/var/www/html \
nextcloud:20

to force it to start again.

docker exec -u 33 -it $containerID /bin/bash
www-data@56ba523b2055:~/html$ ./occ migrations:status news
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
    >> App:                                                news
    >> Version Table Name:                                 oc_migrations
    >> Migrations Namespace:                               OCA\News\Migration
    >> Migrations Directory:                               /var/www/html/custom_apps/news/lib/Migration
    >> Previous Version:                                   140200Date20200824201413
    >> Current Version:                                    150004Date20201009183830
    >> Next Version:                                       Already at latest migration step
    >> Latest Version:                                     150004Date20201009183830
    >> Executed Migrations:                                2
    >> Executed Unavailable Migrations:                    2
    >> Available Migrations:                               2
    >> New Migrations:                                     2
    >> Pending Migrations:                                 None
www-data@1c620d651059:~/html$ ./occ upgrade               
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
Setting log level to debug
Updating database schema
Updated database
Updating <news> ...
Updated <news> to 15.0.6

@SMillerDev
Copy link
Contributor

www-data@56ba523b2055:~/html$ ./occ migrations:status news

It wouldn't show up here though, this is only for database migrations unfortunately. I think we need to have a new 15.1 RC and test with that.

@SMillerDev SMillerDev changed the title Uppgrade from Nextcoud 19.0.4 to 20.0.0 fails during execution of occ upgrade Upgrade from Nextcoud 19.0.4 to 20.0.0 fails during execution of occ upgrade Nov 25, 2020
@Grotax
Copy link
Member

Grotax commented Nov 25, 2020

Yea I don't know how to do that docker runs the upgrade automatically
Hmm maybe if I install 19 first add a feed and then replace the app files manually.
Switch to 20, that could work

@Grotax
Copy link
Member

Grotax commented Nov 26, 2020

I tried, it didn't work I can't test it like this, nextcloud doesn't care about the new local version it pulls 15.0.6 from the appstore

@ArmyOfMonkies
Copy link
Author

I have kind of worked around this bug. If i disable and then remove News from the 19.0.4 installation. Then uppgrade to 20. And lastly install news again and enable it, i dont get any errors and it seems to work.

It seems i might have to reload the news app now and then as it gets stuck on a white screen, but if that issue has anything to do with this one i dont know.

@Grotax
Copy link
Member

Grotax commented Dec 9, 2020

@SMillerDev I retired this again
Nextcloud 19, news 14.2.2
to
Nextcloud 20, news 15.1.0
in the standard docker image, which uses a sqlitedb internally, no issues upgrade works automatically

@SMillerDev SMillerDev added the API Impact API/Backend code label Dec 11, 2020
@bcutter

This comment has been minimized.

@Grotax
Copy link
Member

Grotax commented Dec 15, 2020

As there where no further complains I will consider this solved.

@Grotax Grotax closed this as completed Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Impact API/Backend code bug
Projects
None yet
Development

No branches or pull requests