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

[theming] TypeError: Cannot access offset of type string on string in MigrateBackgroundImages.php #35921

Closed
Stefomat opened this issue Dec 30, 2022 · 6 comments · Fixed by #36069
Assignees
Labels
1. to develop Accepted and waiting to be taken care of 25-feedback bug feature: theming

Comments

@Stefomat
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. Have installed AIO v3.2.0 / NC 24.0.8.2
  2. Nightly update to AIO 4.0.1 / NC 25.0.2.3
  3. Check the logs

Expected behavior

No error messages in the logs (wishful thinking, I know).

Actual behavior

A few error messages appear in the logs, but fortunately no problems are noticeable when using Nextcloud.

Nextcloud Logs

[30-Dec-2022 03:05:17] NOTICE: fpm is running, pid 3620
[30-Dec-2022 03:05:17] NOTICE: ready to handle connections
TypeError: Cannot access offset of type string on string in /var/www/html/apps/theming/lib/Jobs/MigrateBackgroundImages.php:74

ace:
#0 /var/www/html/lib/public/BackgroundJob/Job.php(78): OCA\Theming\Jobs\MigrateBackgroundImages->run('prepare')
nextcloud/all-in-one#1 /var/www/html/lib/public/BackgroundJob/QueuedJob.php(58): OCP\BackgroundJob\Job->start(Object(OC\BackgroundJob\JobList))
nextcloud/all-in-one#2 /var/www/html/lib/public/BackgroundJob/QueuedJob.php(48): OCP\BackgroundJob\QueuedJob->start(Object(OC\BackgroundJob\JobList))
nextcloud/all-in-one#3 /var/www/html/cron.php(152): OCP\BackgroundJob\QueuedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))

}

Database Logs

2022-12-30 03:04:29.232 CET [88] ERROR:  relation "oc_photos_albums" does not exist at character 87
2022-12-30 03:04:29.232 CET [88] STATEMENT:  SELECT "a"."album_id", "name", "user", "location", "created", "last_added_photo" FROM "oc_photos_albums" "a" LEFT JOIN "oc_photos_albums_files" "p" ON "a"."album_id" = "p"."album_id" WHERE "file_id" = $1
2022-12-30 11:42:15.891 CET [11812] ERROR:  duplicate key value violates unique constraint "oc_filecache_extended_pkey"
2022-12-30 11:42:15.891 CET [11812] DETAIL:  Key (fileid)=(19513) already exists.
2022-12-30 11:42:15.891 CET [11812] STATEMENT:  INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2)
2022-12-30 12:14:58.178 CET [12626] ERROR:  duplicate key value violates unique constraint "oc_filecache_extended_pkey"
2022-12-30 12:14:58.178 CET [12626] DETAIL:  Key (fileid)=(19763) already exists.
2022-12-30 12:14:58.178 CET [12626] STATEMENT:  INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2)

Host OS

Debian GNU/Linux 11.6 (bullseye)

Nextcloud AIO version

Nextcloud AIO v4.0.1

Current channel

latest

Other valuable info

For the sake of completeness, here are the two complete logs where the error messages appeared.

Nextcloud Logs
nc: getaddrinfo: Name does not resolve
Waiting for database to start...
              now              
-------------------------------
 2022-12-30 03:03:33.419702+01
(1 row)

Installing imagemagick via apk...
Installing PHP build dependencies...
Installing Imagick via PECL...
Configuring Redis as session handler...
Setting php max children...
Checking connection to appstore
Appstore is reachable
Maintenance mode already disabled
Getting and backing up the status of apps for later, this might take a while...
Disabling apps before the update in order to make the update procedure more safe. This can take a while...
twofactor_totp 6.4.1 disabled
contacts 4.2.3 disabled
notify_push 0.5.0 disabled
bookmarks 11.0.4 disabled
tasks 0.14.5 disabled
notes 4.5.1 disabled
impersonate 1.11.0 disabled
apporder 0.15.0 disabled
calendar 3.5.4 disabled
user_migration 1.1.0 disabled
System config value app_install_overwrite deleted
Initializing nextcloud 25.0.2.3 ...
Initializing finished
Upgrading nextcloud from 24.0.8.2 to 25.0.2.3...
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
Turned on maintenance mode
Updating database schema
Updated database
Disabled incompatible app: accessibility
Disabled incompatible app: files_videoplayer
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%
Clean up old calendar subscriptions from deleted users that were not cleaned-up

 Starting ...
    0/0 [->--------------------------]   0%
Updated <dav> to 1.24.0
Updating <files_sharing> ...
Updated <files_sharing> to 1.17.0
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.15.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 <firstrunwizard> ...
Updated <firstrunwizard> to 2.14.0
Updating <nextcloud_announcements> ...
Updated <nextcloud_announcements> to 1.14.0
Updating <notifications> ...
Updated <notifications> to 2.13.1
Updating <systemtags> ...
Updated <systemtags> to 1.15.0
Updating <theming> ...
Migrate old user accessibility config

 Starting ...
    0/0 [--->------------------------]   0%
Cleanup old theming cache

 Starting ...
 0/1 [>---------------------------]   0%
 Starting ...
 1/1 [============================] 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 <nextcloud-aio> ...
Updated <nextcloud-aio> to 0.3.0
Updating <photos> ...
Updated <photos> to 2.0.1
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 <support> ...
Updated <support> to 1.8.0
Updating <text> ...
Updated <text> to 3.6.0
Updating <twofactor_backupcodes> ...
Updated <twofactor_backupcodes> to 1.14.0
Updating <viewer> ...
Updated <viewer> to 1.9.0
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level
Nextcloud 25.0.2
Posting notifications to users that are admins...
Posting 'Nextcloud update to 25.0.2.3 successful!' to: admin
Posting 'Nextcloud update to 25.0.2.3 successful!' to: stefan
Done!
contacts new version available: 5.0.2
contacts updated
bookmarks new version available: 12.0.0
bookmarks updated
notes new version available: 4.6.0
notes updated
calendar new version available: 4.2.0
calendar updated
user_migration new version available: 2.0.1
user_migration updated
Restoring the status of apps. This can take a while...
Enabling notes...
Enabling calendar...
Enabling notify_push...
Enabling impersonate...
The impersonate app could not get enabled. Probably because it is not compatible with the new Nextcloud version.
Posting notifications to users that are admins...
Posting 'Could not enable the impersonate app after the Nextcloud update!' to: admin
Posting 'Could not enable the impersonate app after the Nextcloud update!' to: stefan
Done!
Enabling tasks...
Enabling user_migration...
Enabling contacts...
Enabling apporder...
The apporder app could not get enabled. Probably because it is not compatible with the new Nextcloud version.
Posting notifications to users that are admins...
Posting 'Could not enable the apporder app after the Nextcloud update!' to: admin
Posting 'Could not enable the apporder app after the Nextcloud update!' to: stefan
Done!
Enabling twofactor_totp...
Enabling bookmarks...
Doing some optimizations...
 - Repair MySQL collation
     - Not a mysql database -> nothing to do
 - Repair mime types
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Repair invalid shares
 - Move .step file of updater to backup location
 - Add move avatar background job
     - Repair step already executed
 - Add preview cleanup background jobs
 - Migrate oauth2_clients table to nextcloud schema
     - Update the oauth2_access_tokens table schema.
     - Update the oauth2_clients table schema.
 - Fix potential broken mount points
     - No mounts updated
 - Repair language codes
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - JS cache cleared
 - Clear every generated avatar on major updates
 - Add preview background cleanup job
 - Queue a one-time job to cleanup old backups of the updater
 - Cleanup invalid photocache files for carddav
 - Add background job to cleanup login flow v2 tokens
 - Remove potentially over exposing share links
     - No need to remove link shares.
 - Clear access cache of projects
 - Reset generated avatar flag
 - Keep legacy encryption enabled
 - Check encryption key format
 - Remove old dashboard app config data
 - Add job to cleanup the bruteforce entries
 - Queue a one-time job to check for user uploaded certificates
 - Repair DAV shares
 - Add background job to set the lookup server share state for users
 - Add token cleanup job
 - Clean up abandoned apps
 - Add possibly missing system config
 - Deduplicate shared bookmark folders
     - Removed 0 duplicate shares
 - Remove superfluous shared bookmark folders
     - Removed 0 superfluous shares
 - Remove orphaned bookmark shares
     - Removed 0 orphaned shares
     - Removed 0 orphaned public links
 - Remove orphaned bookmark tree items
     - Removed 0 orphaned bookmarks entries
     - Removed 0 orphaned folders entries
     - Reinserted 0 orphaned children entries
     - Removed 0 orphaned bookmark folders
     - Reinserted 0 orphaned bookmarks
 - Update bookmark group shares
     - Removed 0 users and added 0 users to 0 groups
     - Removed 0 shares
 - Upgrading Circles App
 - Fix component of birthday calendars
     - 3 birthday calendars updated.
 - Regenerating birthday calendars to use new icons and fix old birthday events without year
     - Repair step already executed
 - Fix broken values of calendar objects
    0 [>---------------------------]
 - Registering building of calendar search index as background job
     - Repair step already executed
 - Register building of social profile search index as background job
 - Registering background jobs to update cache for webcal calendars
     - Added 0 background jobs to update webcal calendars
 - Registering building of calendar reminder index as background job
     - Repair step already executed
 - Clean up orphan event and contact data
     - 0 events without a calendar have been cleaned up
     - 0 properties without an events have been cleaned up
     - 0 changes without a calendar have been cleaned up
     - 0 cached events without a calendar subscription have been cleaned up
     - 0 changes without a calendar subscription have been cleaned up
     - 0 contacts without an addressbook have been cleaned up
     - 0 properties without a contact have been cleaned up
     - 0 changes without an addressbook have been cleaned up
 - Remove activity entries of private events
     - Removed 0 activity entries
 - Clean up old calendar subscriptions from deleted users that were not cleaned-up
    0 [->--------------------------]
     - 0 calendar subscriptions without an user have been cleaned up
 - Remove invalid object properties
     - 0 invalid object properties removed.
 - Fix the share type of guest shares when migrating from ownCloud
 - Copy the share password into the dedicated column
 - Set existing shares as accepted
 - Clean up meta table
 - Set binary permissions
 - Update OAuth token expiration times
 - Switches from default updater server to the customer one if a valid subscription is available
     - Repair step already executed
 - Initialize migration of background images from dashboard to theming app
 - Cleanup old theming cache
    0 [--->------------------------]
 - Add background job to check for backup codes
 - Populating added database structures for workflows
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.
Check columns of the comments table.
Done.
Check primary keys.
Done.
All tables already up to date!
mimetypelist.js is updated
Added mimetype "image/x-icon" to database
Updated 1 filecache rows for mimetype "image/x-icon"
Added 1 new mimetypes
Updated 1 filecache rows
System config value tempdirectory set to string /mnt/ncdata/tmp/
Applying one-click-instance settings...
System config value one-click-instance set to boolean true
System config value one-click-instance.user-limit set to integer 100
System config value one-click-instance.link set to string https://nextcloud.com/all-in-one/
support already enabled
Adjusting log files...
System config value logfile set to string /var/www/html/data/nextcloud.log
Config value logfile for app admin_audit set to /var/www/html/data/audit.log
Applying network settings...
System config value trusted_domains => 1 set to string domain.de
System config value overwrite.cli.url set to string https://domain.de/
System config value htaccess.RewriteBase set to string /
.htaccess has been updated
System config value files_external_allow_create_new_local set to boolean false
System config value trusted_proxies => 0 set to string 127.0.0.1
System config value trusted_proxies => 1 set to string ::1
Config value base_endpoint for app notify_push set to https://domain.de/push
System config value enabledPreviewProviders => 0 deleted
System config value preview_imaginary_url deleted
[30-Dec-2022 03:05:17] NOTICE: fpm is running, pid 3620
[30-Dec-2022 03:05:17] NOTICE: ready to handle connections
TypeError: Cannot access offset of type string on string in /var/www/html/apps/theming/lib/Jobs/MigrateBackgroundImages.php:74

ace:
#0 /var/www/html/lib/public/BackgroundJob/Job.php(78): OCA\Theming\Jobs\MigrateBackgroundImages->run('prepare')
nextcloud/all-in-one#1 /var/www/html/lib/public/BackgroundJob/QueuedJob.php(58): OCP\BackgroundJob\Job->start(Object(OC\BackgroundJob\JobList))
nextcloud/all-in-one#2 /var/www/html/lib/public/BackgroundJob/QueuedJob.php(48): OCP\BackgroundJob\QueuedJob->start(Object(OC\BackgroundJob\JobList))
nextcloud/all-in-one#3 /var/www/html/cron.php(152): OCP\BackgroundJob\QueuedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))

}
Database Logs
Setting max connections...

PostgreSQL Database directory appears to contain a database; Skipping initialization

2022-12-30 03:02:11.581 CET [12] LOG:  starting PostgreSQL 14.6 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit
2022-12-30 03:02:11.581 CET [12] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-12-30 03:02:11.581 CET [12] LOG:  listening on IPv6 address "::", port 5432
2022-12-30 03:02:11.590 CET [12] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-12-30 03:02:11.599 CET [19] LOG:  database system was shut down at 2022-12-30 03:01:40 CET
2022-12-30 03:02:11.607 CET [12] LOG:  database system is ready to accept connections
2022-12-30 03:04:29.232 CET [88] ERROR:  relation "oc_photos_albums" does not exist at character 87
2022-12-30 03:04:29.232 CET [88] STATEMENT:  SELECT "a"."album_id", "name", "user", "location", "created", "last_added_photo" FROM "oc_photos_albums" "a" LEFT JOIN "oc_photos_albums_files" "p" ON "a"."album_id" = "p"."album_id" WHERE "file_id" = $1
2022-12-30 11:42:15.891 CET [11812] ERROR:  duplicate key value violates unique constraint "oc_filecache_extended_pkey"
2022-12-30 11:42:15.891 CET [11812] DETAIL:  Key (fileid)=(19513) already exists.
2022-12-30 11:42:15.891 CET [11812] STATEMENT:  INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2)
2022-12-30 12:14:58.178 CET [12626] ERROR:  duplicate key value violates unique constraint "oc_filecache_extended_pkey"
2022-12-30 12:14:58.178 CET [12626] DETAIL:  Key (fileid)=(19763) already exists.
2022-12-30 12:14:58.178 CET [12626] STATEMENT:  INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2)

I don't know if this information can be helpful in identifying any problem, but didn't want to just ignore it. If I can provide more information, I am happy to do so.

@Stefomat Stefomat added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Dec 30, 2022
@szaimen
Copy link
Contributor

szaimen commented Dec 30, 2022

Hi, thanks for your report.

Most of the stuff would need to be fixed in the server repo. Moving there.

@szaimen szaimen transferred this issue from nextcloud/all-in-one Dec 30, 2022
@szaimen szaimen transferred this issue from nextcloud/photos Dec 30, 2022
@MCMic
Copy link

MCMic commented Jan 4, 2023

Got the same thing here.

https://github.com/nextcloud/server/blob/master/apps/theming/lib/Jobs/MigrateBackgroundImages.php#L72-L75 expects argument to be an associative array but it seems to be a string for some reason.

@szaimen
Copy link
Contributor

szaimen commented Jan 4, 2023

This is then probably why the migration of former theming assets does not work...

@come-nc come-nc changed the title Strange error messages after upgrade to NC 25 [theming] TypeError: Cannot access offset of type string on string in MigrateBackgroundImages.php Jan 5, 2023
@come-nc come-nc added 1. to develop Accepted and waiting to be taken care of feature: theming and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jan 5, 2023
@thomaslc66
Copy link

same error here but when running cron.

@come-nc come-nc self-assigned this Jan 5, 2023
@come-nc
Copy link
Contributor

come-nc commented Jan 5, 2023

OCA\Theming\Jobs\MigrateBackgroundImages

Each time you run cron or only once?
Can you run occ background-job:list -c 'OCA\Theming\Jobs\MigrateBackgroundImages' see if it lists anything?

@j-herden
Copy link

j-herden commented Jan 9, 2023

I got this just once after the upgrade.

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 25-feedback bug feature: theming
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants