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

[23.0.0 RC1] Upgrade fails if theming app is disabled #29676

Closed
MichaIng opened this issue Nov 12, 2021 · 5 comments · Fixed by #29683 or #29728
Closed

[23.0.0 RC1] Upgrade fails if theming app is disabled #29676

MichaIng opened this issue Nov 12, 2021 · 5 comments · Fixed by #29683 or #29728
Assignees
Labels
1. to develop Accepted and waiting to be taken care of bug regression

Comments

@MichaIng
Copy link
Member

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 with NC 22.2.1.2
  2. Disable theming app
  3. Attempt to update to NC 23.0.0 RC1 via beta channel

Expected behaviour

Update succeeds.

Actual behaviour

Update fails with:

2021-11-12T01:59:26+01:00 Checking for update of app ransomware_protection in appstore
2021-11-12T01:59:26+01:00 Checked for update of app "ransomware_protection" in App Store
2021-11-12T01:59:26+01:00 OCP\AppFramework\QueryException: Could not resolve defaults! Class defaults does not exist
2021-11-12T01:59:26+01:00 Update failed

Luckily trying the repair step finally gave the hint that the disabled theming app is the reason, so I was able to finish the upgrade by enabling the theming app:

# ncc maintenance:repair
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

In SimpleContainer.php line 100:

  Could not resolve defaults! Class defaults does not exist


In SimpleContainer.php line 120:

  Could not resolve OCA\Theming\ThemingDefaults! Class OCA\Theming\ThemingDefaults does not exist

Server configuration

Operating system: Debian Bookworm

Web server: Apache/2.4.51

Database: 10.5.12-MariaDB

PHP version: 7.4.21

Nextcloud version: 22.2.1.2 => 23.0.0 RC1

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

Where did you install Nextcloud from: https://download.nextcloud.com/server/releases/

Signing status:

Signing status
all good

List of activated apps:

App list
Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - apporder: 0.13.0
  - calendar: 2.3.4
  - cloud_federation_api: 1.6.0
  - contacts: 4.0.6
  - dashboard: 7.3.0
  - dav: 1.21.0
  - federatedfilesharing: 1.13.0
  - files: 1.18.0
  - files_rightclick: 1.2.0
  - files_sharing: 1.15.0
  - files_trashbin: 1.13.0
  - files_versions: 1.16.0
  - impersonate: 1.9.0
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - notes: 4.1.1
  - notifications: 2.11.1
  - notify_push: 0.2.4
  - oauth2: 1.11.0
  - photos: 1.5.0
  - previewgenerator: 3.2.0
  - provisioning_api: 1.13.0
  - ransomware_protection: 1.11.0
  - settings: 1.5.0
  - spreed: 13.0.0-rc.1
  - survey_client: 1.11.0
  - tasks: 0.14.2
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - updatenotification: 1.13.0
  - viewer: 1.7.0
  - workflowengine: 2.5.0
Disabled:
  - admin_audit
  - circles
  - comments
  - contactsinteraction
  - encryption
  - federation
  - files_external
  - files_pdfviewer
  - files_videoplayer
  - firstrunwizard
  - nextcloud_announcements
  - password_policy
  - privacy
  - recommendations
  - serverinfo
  - sharebymail
  - support
  - systemtags
  - text
  - user_ldap
  - user_status
  - weather_status

Nextcloud configuration:

Config report
{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "micha.gnoedi.org"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "23.0.0.7",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 1,
        "logtimezone": "Europe\/Berlin",
        "default_phone_region": "DE",
        "filesystem_check_changes": 0,
        "hashingThreads": 4,
        "hashingMemoryCost": 16384,
        "hashingTimeCost": 3,
        "trashbin_retention_obligation": "disabled",
        "versions_retention_obligation": "disabled",
        "skeletondirectory": "",
        "maintenance": false,
        "overwrite.cli.url": "https:\/\/my.domain.org\/nextcloud",
        "htaccess.RewriteBase": "\/nextcloud",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "knowledgebaseenabled": false,
        "mysql.utf8mb4": true,
        "updater.release.channel": "beta",
        "tempdirectory": "\/mnt\/sda\/ncdata\/tmp",
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "app_install_overwrite": [
            "apporder",
            "calendar",
            "impersonate",
            "ransomware_protection",
            "contacts",
            "spreed",
            "notify_push",
            "previewgenerator",
            "tasks"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

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

Are you using encryption: yes/no

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

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Logs

Web server error log

Web server error log
none

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"jwts8GRid68oBR2Z2G6O","level":3,"time":"2021-11-12T02:01:48+01:00","remoteAddr":"192.168.1.10","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/core/ajax/update.php?requesttoken=PUtnxVQnU3WDEYIoppK2U%2Bi65A6Fp3J2S%2FlIoJ8LqWQ%3D%3ADgk%2B%2FBFrCwzqfeNBwPuCFJrqoX3J6hcPEpsmkOt8wiM%3D","message":"Could not resolve defaults! Class defaults does not exist","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4676.0 Safari/537.36 OPR/83.0.4232.0 (Edition developer)","version":"22.2.1.2","exception":{"Exception":"OCP\\AppFramework\\QueryException","Message":"Could not resolve defaults! Class defaults does not exist","Code":0,"Trace":[{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":161,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Repair.php","line":189,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":292,"function":"getRepairSteps","class":"OC\\Repair","type":"::"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":133,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/ajax/update.php","line":200,"function":"upgrade","class":"OC\\Updater","type":"->"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":100,"Previous":{"Exception":"OCP\\AppFramework\\QueryException","Message":"Could not resolve OCA\\Theming\\ThemingDefaults! Class OCA\\Theming\\ThemingDefaults does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":161,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\ServerContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":161,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Repair.php","line":189,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":292,"function":"getRepairSteps","class":"OC\\Repair","type":"::"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":133,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/ajax/update.php","line":200,"function":"upgrade","class":"OC\\Updater","type":"->"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":120},"CustomMessage":"Could not resolve defaults! Class defaults does not exist"},"id":"618dc03dd4d10"}
{"reqId":"jwts8GRid68oBR2Z2G6O","level":3,"time":"2021-11-12T02:01:48+01:00","remoteAddr":"192.168.1.10","user":"--","app":"updater","method":"GET","url":"/nextcloud/core/ajax/update.php?requesttoken=PUtnxVQnU3WDEYIoppK2U%2Bi65A6Fp3J2S%2FlIoJ8LqWQ%3D%3ADgk%2B%2FBFrCwzqfeNBwPuCFJrqoX3J6hcPEpsmkOt8wiM%3D","message":"\\OC\\Updater::failure: OCP\\AppFramework\\QueryException: Could not resolve defaults! Class defaults does not exist","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4676.0 Safari/537.36 OPR/83.0.4232.0 (Edition developer)","version":"22.2.1.2","id":"618dc03dd46d9"}
@MichaIng MichaIng added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Nov 12, 2021
@CarlSchwan
Copy link
Member

This seems to be caused by 3093548 that introduces a dependency to ThemingDefaults inside lib/private/Template/SCSSCacher.php.

We moved from OC_Defaults to ThemingDefaults because of a very weird bug in the autoloading. I didn't think about the consequence of this move :/

cc @Pytal

@CarlSchwan CarlSchwan added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Nov 12, 2021
@CarlSchwan CarlSchwan self-assigned this Nov 12, 2021
@CarlSchwan
Copy link
Member

Should be fixed with #29683. Please review!

@TwizzyDizzy
Copy link

I can confirm that the occ upgrade command finished successfully after applying the diff for lib/private/Template/SCSSCacher.php.

Cheers
Thomas

@n3ovo
Copy link

n3ovo commented Nov 13, 2021

hello ... Hope i am in the right place.... First time user .... don't yell to loud

I should of known to wait a day or so ... just updated to 23.0.0 RC1 and then RC2 and I seem to have a little problem. First i lost the hole system with RC1. and with out knowing RC2 can up for downloading, so now the server is running again fixed ( Thank God ) but now error!! I can not get back in to my {settings} when i do the server says below. System look good and had no errors until the update .. another thing, just seen a lot of the APP's are installed but not showing up. Any thoughts should i remove all apps and re install them. It looks like i am missing the Could not find resource theming/js/theming.js where can i get that file from"

Thanks John G.

**_Internal Server Error
The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.
Technical details

Remote Address: 192.168.1.171
Request ID: crfthATvppROD8fB5D4n_**

nextcloud error log

,"time":"2021-11-13T10:15:58+00:00","remoteAddr":"192.168.1.171","user":"john","app":"jsresourceloader","method":"GET","url":"/apps/dashboard/","message":"Could not find resource theming/js/theming.js to load","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0","version":"23.0.0.8"}

(Don't think you will need this But)
system /
Supermicro X9QR7-TF+/X9QRi-F+ , Version 123456789
American Megatrends Inc, Version 3.0a
BIOS dated: Thu 03 Apr 2014 12:00:00 AM EDT
RAM 256 G
Running Un-Raid v6.10 ( Nextcloud 23,0,0RC2 is running on VM (Ubuntu 20.4.3 LTS ))

@MichaIng
Copy link
Member Author

Welcome to the community 🙂.

So you have the theming app disabled as well and ran into the same error shown in original post? How did you upgrade to NC 23 RC2? It has the issue not solved yet. And now, do you run NC 23 RC2 with theming app disabled or enabled?

Generally before upgrading, especially when to a beta/pre-release, have a backup of the database ready, the updater will create one of the Nextcloud web dir (check updater-<some>/backups in your Nextcloud data directory), so you can always revert to the old version quickly, and in case restore the database. And if this is a production system, then I'd not recommend to run on beta channel at all 😉.

@MichaIng MichaIng linked a pull request Nov 16, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug regression
Projects
None yet
5 participants