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

[Bug]: Warning while upgrading from 24 to 25: Table 'oc_photos_albums' doesn't exist #35287

Closed
6 of 9 tasks
solracsf opened this issue Nov 20, 2022 · 5 comments · Fixed by nextcloud/photos#1491
Closed
6 of 9 tasks
Assignees
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug

Comments

@solracsf
Copy link
Member

solracsf commented Nov 20, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

When upgrading from 24 to 25, the following warning appears. I don't know if this is expected or not.

Steps to reproduce

  1. Upgrade from 24 to 25 on CLI

Expected behavior

No errors or warnings.

Installation method

Community Manual installation with Archive

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

N/A

Nextcloud Signing status

No response

Nextcloud Logs

...
Updating <theming> ...
Repair step: Migrate old user accessibility config
Migrate old user accessibility config

 Starting ...
    0/0 [----->----------------------]   0%
Repair step: Initialize migration of background images from dashboard to theming app
Repair step: Cleanup old theming cache
Cleanup old theming cache

 Starting ...
 0/2 [>---------------------------]   0%Repair warning: Failed to delete folder: "31", error: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_photos_albums' doesn't exist
Repair warning: Failed to delete folder: "images", error: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_photos_albums' doesn't exist

 Starting ...
 2/2 [============================] 100%
Updated <theming> to 2.0.1
...

Additional info

No response

@solracsf solracsf added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback labels Nov 20, 2022
@tryallthethings
Copy link

tryallthethings commented Nov 21, 2022

Saw a similar issue while upgrading from 24.0.7 to 25.0.1:

> php occ upgrade
The current PHP memory limit is below the recommended value of 512MB.
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: accessibility
Disabled incompatible app: calendar
Disabled incompatible app: extract
Disabled incompatible app: files_antivirus
Disabled incompatible app: files_markdown
Disabled incompatible app: files_videoplayer
Disabled incompatible app: forms
Disabled incompatible app: impersonate
Disabled incompatible app: onlyoffice
Disabled incompatible app: spreed
Updating <lookup_server_connector> ...
Updated <lookup_server_connector> to 1.13.0
Updating <oauth2> ...
Updated <oauth2> to 1.13.0
Updating <password_policy> ...
Updated <password_policy> to 1.15.0
Updating <files> ...
Updated <files> to 1.20.1
Updating <activity> ...
Updated <activity> to 2.17.0
Updating <circles> ...
Updated <circles> to 25.0.0
Updating <cloud_federation_api> ...
Updated <cloud_federation_api> to 1.8.0
Updating <dav> ...
Fix broken values of calendar objects

 Starting ...
    0/0 [>---------------------------]   0%
 Done
    0/0 [->--------------------------]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up


 Starting ...
    0/0 [--->------------------------]   0%
 Done
    0/0 [----->----------------------]   0%
Updated <dav> to 1.24.0
Updating <files_sharing> ...
Updated <files_sharing> to 1.17.0
Updating <files_versions> ...
Updated <files_versions> to 1.18.0
Updating <sharebymail> ...
Updated <sharebymail> to 1.15.0
Updating <workflowengine> ...
Updated <workflowengine> to 2.7.0
Updating <nextcloud_announcements> ...
Updated <nextcloud_announcements> to 1.14.0
Updating <notifications> ...
Updated <notifications> to 2.13.1
Updating <theming> ...
Migrate old user accessibility config


 Starting ...
    0/0 [------->--------------------]   0%
 Done
    7/7 [============================] 100%
Cleanup old theming cache


 Starting ...
 0/2 [>---------------------------]   0%Repair warning: Failed to delete folder: "2", error: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'admin_cloud.oc_photos_albums' doesn't exist
Repair warning: Failed to delete folder: "images", error: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'admin_cloud.oc_photos_albums' doesn't exist

 Starting ...
 2/2 [============================] 100%
 Done
 2/2 [============================] 100%
Updated <theming> to 2.0.1
Updating <contactsinteraction> ...
Updated <contactsinteraction> to 1.6.0
Updating <dashboard> ...
Updated <dashboard> to 7.5.0
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 1.15.0
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 2.6.0
Updating <files_rightclick> ...
Updated <files_rightclick> to 1.4.0
Updating <logreader> ...
Updated <logreader> to 2.10.0
Updating <photos> ...
Updated <photos> to 2.0.0
Updating <privacy> ...
Updated <privacy> to 1.9.0
Updating <provisioning_api> ...
Updated <provisioning_api> to 1.15.0
Updating <recommendations> ...
Updated <recommendations> to 1.4.0
Updating <serverinfo> ...
Updated <serverinfo> to 1.15.0
Updating <settings> ...
Updated <settings> to 1.7.0
Updating <text> ...
Updated <text> to 3.6.0
Updating <twofactor_backupcodes> ...
Updated <twofactor_backupcodes> to 1.14.0
Updating <twofactor_totp> ...
Updated <twofactor_totp> to 7.0.0
Updating <updatenotification> ...
Updated <updatenotification> to 1.15.0
Updating <user_status> ...
Updated <user_status> to 1.5.0
Updating <viewer> ...
Updated <viewer> to 1.9.0
Updating <weather_status> ...
Updated <weather_status> to 1.5.0
Update app contacts from App Store
Update app mail from App Store
Restore default tags that are missing


 Starting ...
 0/1 [>---------------------------]   0%
 Starting ...
 1/1 [============================] 100%
 Done
 1/1 [============================] 100%
Purify and migrate collected mail addresses


 Starting ...
    0/0 [---------------------->-----]   0%
 Done
    0/0 [------------------------>---]   0%
Insert background jobs for all accounts


 Starting ...
 0/1 [>---------------------------]   0%
 Starting ...
 1/1 [============================] 100%
 Done
 1/1 [============================] 100%
Update app calendar from App Store
Update app forms from App Store
Update app onlyoffice from App Store
Update app spreed from App Store
Starting code integrity check...
Finished code integrity check
Update successful
Maintenance mode is kept active
Resetting log level

> php occ upgrade db:add-missing-indices
The current PHP memory limit is below the recommended value of 512MB.
Check indices of the share table.
Check indices of the filecache table.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Check indices of the oc_jobs table.
Check indices of the oc_direct_edit table.
Check indices of the oc_preferences table.
Adding preferences_app_key index to the oc_preferences table, this can take some time...
oc_properties table updated successfully.
Check indices of the oc_mounts table.

Ubuntu 20.04.5 LTS
PHP 8.1.12
Another instance of this was reported here: https://help.nextcloud.com/t/nextcloud-25-0-1-is-there-bruteforce-app-is-not-compatible/149693/3

@PVince81
Copy link
Member

so the photos app did get updated to 2.0, not sure why it would not create that table

@artonge can you double check the migrations for this upgrade path ?

@artonge
Copy link
Contributor

artonge commented Nov 23, 2022

Looks like a hook in the photos app is triggered by the deletion of a folder by the theming app migration.

https://github.com/nextcloud/photos/blob/b12df760359575971dbd2493f7ddcd67fe1b84eb/lib/Listener/CacheEntryRemovedListener.php#L17-L27

@PVince81 is it possible to check if an app migration is done, or should a simply wrap the code in a try/catch ?

@PVince81
Copy link
Member

PVince81 commented Nov 23, 2022

@artonge it might be possible to check \OCP\Util\needUpgrade() as a workaround, or try/catch

still, I'm a bit worried that other apps might fail due to hooks being triggered

do you have the code location from the stack trace which is triggering that ? maybe we can prevent hook triggering there ?

another thing: I believe that the theme migration only operates in "appdata_*", maybe your hook handler could detect that, or even the emitter should not fire CacheEntryRemovedListener when operating on appdata ?

thoughts ? @CarlSchwan @icewind1991

@tryallthethings
Copy link

Do those, who were affected by this issue need to do anything now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants