Skip to content

[Bug]: Upgrade 30.0.10 to 31.04 (dav) requires 6GB of RAM on single-user instance #52505

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

Open
5 of 8 tasks
Kunsi opened this issue Apr 28, 2025 · 10 comments
Open
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 31-feedback bug feature: caldav Related to CalDAV internals feature: database Database related DB performance 🚀

Comments

@Kunsi
Copy link

Kunsi commented Apr 28, 2025

⚠️ This issue respects the following points: ⚠️

Bug description

When trying to upgrade 30.0.10 to 31.0.4, the occ upgrade command exits without error after trying to update the dav app. Increasing memory_limit to ludicrous amounts of memory seems to help.

Steps to reproduce

  1. Have 30.0.10 running
  2. Update nextcloud using the web updater
  3. run php occ upgrade on the shell
  4. php process gets killed, message in log says memory limit exceeded

Expected behavior

occ upgrade runs successfully and does not allocate multiple gigabytes of memory

Nextcloud Server version

31

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

PostgreSQL

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

Upgraded to a MAJOR version (ex. 31 to 32)

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

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "warnochwas.de"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.10.1",
        "overwrite.cli.url": "https:\/\/warnochwas.de",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "sendmail",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "dbindex": 7
        },
        "default_phone_region": "DE",
        "maintenance": true,
        "theme": "",
        "loglevel": 0,
        "maintenance_window_start": 0,
        "app_install_overwrite": [
            "maps",
            "diary"
        ],
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

- federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 3.0.0
  - files_external: 1.22.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - logreader: 3.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - polls: 7.4.2
  - privacy: 2.0.0
  - profile: true
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - socialsharing_email: 3.3.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - text: 4.1.0
  - theming: 2.6.0
  - twofactor_backupcodes: 1.19.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - twofactor_webauthn: 2.1.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.21.0
  - deck: 1.14.4 (installed 1.14.4)
  - diary: 0.0.11 (installed 0.0.11)
  - encryption: 2.19.0
  - files_retention: 1.19.1 (installed 1.19.1)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - maps: 1.5.0 (installed 1.5.0)
  - onlyoffice: 9.8.0 (installed 9.8.0)
  - suspicious_login: 9.0.1
  - user_ldap: 1.22.0

Nextcloud Signing status

Nextcloud Logs

[carlene][root@/var/www/nextcloud] > sudo -u www-data php occ upgrade -vvv
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see https://www.php.net/manual/en/book.pcntl.php
Additionally the function 'pcntl_signal' and 'pcntl_signal_dispatch' need to be enabled in your php.ini.
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
2025-04-28T13:52:44+00:00 Setting log level to debug
2025-04-28T13:52:44+00:00 Turned on maintenance mode
2025-04-28T13:52:44+00:00 Repair step: Repair MySQL collation
2025-04-28T13:52:44+00:00 Repair info: Not a mysql database -> nothing to do
2025-04-28T13:52:44+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2025-04-28T13:52:44+00:00 Repair step: Drop account terms table when migrating from ownCloud
2025-04-28T13:52:44+00:00 Updating database schema
2025-04-28T13:52:44+00:00 Updated database
2025-04-28T13:52:44+00:00 Updating <dav> ...
2025-04-28T13:52:44+00:00 Repair step: Fix component of birthday calendars
2025-04-28T13:52:44+00:00 Repair info: 2 birthday calendars updated.
2025-04-28T13:52:44+00:00 Repair step: Regenerating birthday calendars to use new icons and fix old birthday events without year
2025-04-28T13:52:44+00:00 Repair info: Repair step already executed
2025-04-28T13:52:44+00:00 Repair step: Fix broken values of calendar objects
2025-04-28T13:52:44+00:00 Fix broken values of calendar objects
2025-04-28T13:52:44+00:00
                          2025-04-28T13:52:44+00:00  Done
    0/0 [->--------------------------]   0%2025-04-28T13:52:44+00:00
2025-04-28T13:52:44+00:00 Repair step: Registering building of calendar search index as background job
2025-04-28T13:52:44+00:00 Repair info: Repair step already executed
2025-04-28T13:52:44+00:00 Repair step: Register building of social profile search index as background job
2025-04-28T13:52:44+00:00 Repair info: Repair step already executed
2025-04-28T13:52:44+00:00 Repair step: Registering background jobs to update cache for webcal calendars
2025-04-28T13:52:44+00:00 Repair info: Added 0 background jobs to update webcal calendars
2025-04-28T13:52:44+00:00 Repair step: Registering building of calendar reminder index as background job
2025-04-28T13:52:44+00:00 Repair info: Repair step already executed
2025-04-28T13:52:44+00:00 Repair step: Clean up orphan event and contact data
2025-04-28T13:52:44+00:00 Repair info: 0 events without a calendar have been cleaned up

Additional info

I have temporarily increased phps memory_limit to 8192M (8GB) - that seems to work, however my default of 512MB or even 2048MB were not enough for a successful upgrade.

Offending, long-running SQL query seems to be (caution, line is cut off):
DELETE FROM "oc_calendarobjects_props" WHERE "id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $60, $61, $62, $63, $64, $65, $66, $67, $68, $69, $70, $71, $72, $73, $74, $75, $76, $77, $78, $79, $80, $81, $82, $83, $84, $85, $86, $87, $88, $89, $90, $91, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103, $104, $105, $106, $107, $108, $109, $110, $111, $112, $113, $114, $115, $116, $117, $118, $119, $120, $121, $122, $123, $124, $125, $126, $127, $128, $129, $130, $131, $132, $133, $134, $135, $136, $137, $138, $139, $140, $141, $142, $143, $144, $145, $146, $147, $148, $149, $150, $151, $152, $153, $154, $155, $156, $157, $158, $159, $160, $161, $162, $163, $164, $165, $166, $167, $168, $169, $170, $171, $172, $173, $174, $175, $176, $177, $178, $179, $18
and/or a parallel running VACUUM (i'm not sure whether the updater initiates that, my server should not automatically do that)

During the upgrade the php occ upgrade process consumed about 6GB of RAM, while https://github.com/syncloud/nextcloud/blob/master/config/php.ini#L393 recommends 1GB.

/var/www/nextcloud is about 114GB in size, nextcloud database about 13GB prior to starting the upgrade.

@Kunsi Kunsi added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 28, 2025
@Kunsi
Copy link
Author

Kunsi commented Apr 28, 2025

Note: As of writing this bug report, the task is still ongoing. I will update the original report as soon as i get more information.

@Kunsi
Copy link
Author

Kunsi commented Apr 28, 2025

Update: Yeah, after giving it 8 Gigabytes of Memory, the update went through successfully. It took 36 Minutes until the next log message appeared (note the timestamps):

2025-04-28T14:06:21+00:00 Repair info: 0 events without a calendar have been cleaned up
2025-04-28T14:42:35+00:00 Repair info: 59064740 properties without an events have been cleaned up

Everything else took <2 minutes to execute.

@Kunsi
Copy link
Author

Kunsi commented Apr 28, 2025

Full updater log:

[carlene][root@/var/www/nextcloud] > sudo -u www-data php occ upgrade -vvvv
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see https://www.php.net/manual/en/book.pcntl.php
Additionally the function 'pcntl_signal' and 'pcntl_signal_dispatch' need to be enabled in your php.ini.
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
2025-04-28T14:06:21+00:00 Setting log level to debug
2025-04-28T14:06:21+00:00 Repair step: Repair MySQL collation
2025-04-28T14:06:21+00:00 Repair info: Not a mysql database -> nothing to do
2025-04-28T14:06:21+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2025-04-28T14:06:21+00:00 Repair step: Drop account terms table when migrating from ownCloud
2025-04-28T14:06:21+00:00 Updating database schema
2025-04-28T14:06:21+00:00 Updated database
2025-04-28T14:06:21+00:00 Updating <dav> ...
2025-04-28T14:06:21+00:00 Repair step: Fix component of birthday calendars
2025-04-28T14:06:21+00:00 Repair info: 2 birthday calendars updated.
2025-04-28T14:06:21+00:00 Repair step: Regenerating birthday calendars to use new icons and fix old birthday events without year
2025-04-28T14:06:21+00:00 Repair info: Repair step already executed
2025-04-28T14:06:21+00:00 Repair step: Fix broken values of calendar objects
2025-04-28T14:06:21+00:00 Fix broken values of calendar objects
2025-04-28T14:06:21+00:00
                          2025-04-28T14:06:21+00:00  Done
    0/0 [->--------------------------]   0%2025-04-28T14:06:21+00:00
2025-04-28T14:06:21+00:00 Repair step: Registering building of calendar search index as background job
2025-04-28T14:06:21+00:00 Repair info: Repair step already executed
2025-04-28T14:06:21+00:00 Repair step: Register building of social profile search index as background job
2025-04-28T14:06:21+00:00 Repair info: Repair step already executed
2025-04-28T14:06:21+00:00 Repair step: Registering background jobs to update cache for webcal calendars
2025-04-28T14:06:21+00:00 Repair info: Added 0 background jobs to update webcal calendars
2025-04-28T14:06:21+00:00 Repair step: Registering building of calendar reminder index as background job
2025-04-28T14:06:21+00:00 Repair info: Repair step already executed
2025-04-28T14:06:21+00:00 Repair step: Clean up orphan event and contact data
2025-04-28T14:06:21+00:00 Repair info: 0 events without a calendar have been cleaned up
2025-04-28T14:42:35+00:00 Repair info: 59064740 properties without an events have been cleaned up
2025-04-28T14:42:47+00:00 Repair info: 0 changes without a calendar have been cleaned up
2025-04-28T14:42:47+00:00 Repair info: 0 cached events without a calendar subscription have been cleaned up
2025-04-28T14:43:00+00:00 Repair info: 0 changes without a calendar subscription have been cleaned up
2025-04-28T14:43:00+00:00 Repair info: 0 contacts without an addressbook have been cleaned up
2025-04-28T14:43:00+00:00 Repair info: 0 properties without a contact have been cleaned up
2025-04-28T14:43:00+00:00 Repair info: 0 changes without an addressbook have been cleaned up
2025-04-28T14:43:00+00:00 Repair step: Remove activity entries of private events
2025-04-28T14:43:00+00:00 Repair info: Removed 0 activity entries
2025-04-28T14:43:00+00:00 Repair step: Clean up old calendar subscriptions from deleted users that were not cleaned-up
2025-04-28T14:43:00+00:00 Clean up old calendar subscriptions from deleted users that were not cleaned-up
                          2025-04-28T14:43:00+00:00  Done
 7/7 [============================] 100%2025-04-28T14:43:00+00:00
2025-04-28T14:43:00+00:00 Repair info: 0 calendar subscriptions without an user have been cleaned up
2025-04-28T14:43:00+00:00 Repair step: Remove invalid object properties
2025-04-28T14:43:00+00:00 Repair info: 0 invalid object properties removed.
2025-04-28T14:43:01+00:00 Updated <dav> to 1.33.0
2025-04-28T14:43:01+00:00 Updating <files_external> ...
2025-04-28T14:43:01+00:00 Updated <files_external> to 1.23.0
2025-04-28T14:43:01+00:00 Updating <files_sharing> ...
2025-04-28T14:43:01+00:00 Repair step: Fix the share type of guest shares when migrating from ownCloud
2025-04-28T14:43:01+00:00 Repair step: Copy the share password into the dedicated column
2025-04-28T14:43:01+00:00 Repair step: Set existing shares as accepted
2025-04-28T14:43:01+00:00 Updated <files_sharing> to 1.23.1
2025-04-28T14:43:01+00:00 Updating <files_trashbin> ...
2025-04-28T14:43:01+00:00 Updated <files_trashbin> to 1.21.0
2025-04-28T14:43:01+00:00 Updating <files_versions> ...
2025-04-28T14:43:01+00:00 Updated <files_versions> to 1.24.0
2025-04-28T14:43:01+00:00 Updating <sharebymail> ...
2025-04-28T14:43:01+00:00 Updated <sharebymail> to 1.21.0
2025-04-28T14:43:01+00:00 Updating <webhook_listeners> ...
2025-04-28T14:43:01+00:00 Updated <webhook_listeners> to 1.2.0
2025-04-28T14:43:01+00:00 Updating <workflowengine> ...
2025-04-28T14:43:01+00:00 Repair step: Populating added database structures for workflows
2025-04-28T14:43:01+00:00 Updated <workflowengine> to 2.13.0
2025-04-28T14:43:01+00:00 Updating <comments> ...
2025-04-28T14:43:01+00:00 Updated <comments> to 1.21.0
2025-04-28T14:43:01+00:00 Updating <firstrunwizard> ...
2025-04-28T14:43:01+00:00 Updated <firstrunwizard> to 4.0.0
2025-04-28T14:43:01+00:00 Updating <logreader> ...
2025-04-28T14:43:01+00:00 Updated <logreader> to 4.0.0
2025-04-28T14:43:01+00:00 Updating <nextcloud_announcements> ...
2025-04-28T14:43:01+00:00 Updated <nextcloud_announcements> to 3.0.0
2025-04-28T14:43:01+00:00 Updating <notifications> ...
2025-04-28T14:43:01+00:00 Updated <notifications> to 4.0.0
2025-04-28T14:43:01+00:00 Updating <systemtags> ...
2025-04-28T14:43:01+00:00 Updated <systemtags> to 1.21.1
2025-04-28T14:43:01+00:00 Updating <theming> ...
2025-04-28T14:43:01+00:00 Repair step: Initialize migration of background images from dashboard to theming app
2025-04-28T14:43:01+00:00 Updated <theming> to 2.6.1
2025-04-28T14:43:01+00:00 Updating <app_api> ...
2025-04-28T14:43:02+00:00 Repair step: AppAPI Daemons configuration GPU params update
2025-04-28T14:43:02+00:00 Repair info: Daemons configuration GPU params updated: 0
2025-04-28T14:43:02+00:00 Updated <app_api> to 5.0.2
2025-04-28T14:43:02+00:00 Updating <bruteforcesettings> ...
2025-04-28T14:43:02+00:00 Updated <bruteforcesettings> to 4.0.0
2025-04-28T14:43:02+00:00 Updating <contactsinteraction> ...
2025-04-28T14:43:02+00:00 Updated <contactsinteraction> to 1.12.0
2025-04-28T14:43:02+00:00 Updating <dashboard> ...
2025-04-28T14:43:02+00:00 Updated <dashboard> to 7.11.0
2025-04-28T14:43:02+00:00 Updating <federatedfilesharing> ...
2025-04-28T14:43:02+00:00 Updated <federatedfilesharing> to 1.21.0
2025-04-28T14:43:02+00:00 Updating <files_downloadlimit> ...
2025-04-28T14:43:02+00:00 Updated <files_downloadlimit> to 4.0.0
2025-04-28T14:43:02+00:00 Updating <files_pdfviewer> ...
2025-04-28T14:43:02+00:00 Updated <files_pdfviewer> to 4.0.0
2025-04-28T14:43:02+00:00 Updating <files_reminders> ...
2025-04-28T14:43:02+00:00 Updated <files_reminders> to 1.4.0
2025-04-28T14:43:02+00:00 Updating <privacy> ...
2025-04-28T14:43:02+00:00 Updated <privacy> to 3.0.0
2025-04-28T14:43:02+00:00 Updating <provisioning_api> ...
2025-04-28T14:43:02+00:00 Updated <provisioning_api> to 1.21.0
2025-04-28T14:43:02+00:00 Updating <recommendations> ...
2025-04-28T14:43:02+00:00 Updated <recommendations> to 4.0.0
2025-04-28T14:43:02+00:00 Updating <related_resources> ...
2025-04-28T14:43:02+00:00 Updated <related_resources> to 2.0.0
2025-04-28T14:43:02+00:00 Updating <serverinfo> ...
2025-04-28T14:43:02+00:00 Updated <serverinfo> to 3.0.0
2025-04-28T14:43:02+00:00 Updating <settings> ...
2025-04-28T14:43:02+00:00 Updated <settings> to 1.14.0
2025-04-28T14:43:02+00:00 Updating <support> ...
2025-04-28T14:43:02+00:00 Repair step: Switches from default updater server to the customer one if a valid subscription is available
2025-04-28T14:43:02+00:00 Repair info: Repair step already executed
2025-04-28T14:43:02+00:00 Repair step: Migrate some config values to lazy loading
2025-04-28T14:43:02+00:00 Updated <support> to 3.0.0
2025-04-28T14:43:02+00:00 Updating <survey_client> ...
2025-04-28T14:43:02+00:00 Repair step: Send an admin notification if monthly report is disabled
2025-04-28T14:43:02+00:00 Updated <survey_client> to 3.0.0
2025-04-28T14:43:02+00:00 Updating <text> ...
2025-04-28T14:43:02+00:00 Repair step: Force-reset all Text document sessions
2025-04-28T14:43:02+00:00 Updated <text> to 5.0.0
2025-04-28T14:43:02+00:00 Updating <twofactor_backupcodes> ...
2025-04-28T14:43:02+00:00 Repair step: Add background job to check for backup codes
2025-04-28T14:43:02+00:00 Updated <twofactor_backupcodes> to 1.20.0
2025-04-28T14:43:02+00:00 Updating <twofactor_nextcloud_notification> ...
2025-04-28T14:43:02+00:00 Updated <twofactor_nextcloud_notification> to 5.0.0
2025-04-28T14:43:02+00:00 Updating <twofactor_totp> ...
2025-04-28T14:43:02+00:00 Updated <twofactor_totp> to 13.0.0-dev.0
2025-04-28T14:43:02+00:00 Updating <updatenotification> ...
2025-04-28T14:43:02+00:00 Updated <updatenotification> to 1.21.0
2025-04-28T14:43:02+00:00 Updating <user_status> ...
2025-04-28T14:43:02+00:00 Updated <user_status> to 1.11.0
2025-04-28T14:43:02+00:00 Updating <viewer> ...
2025-04-28T14:43:02+00:00 Updated <viewer> to 4.0.0
2025-04-28T14:43:02+00:00 Updating <weather_status> ...
2025-04-28T14:43:02+00:00 Updated <weather_status> to 1.11.0
2025-04-28T14:43:03+00:00 Update app drawio from App Store
2025-04-28T14:43:04+00:00 Repair step: Repair MySQL collation
2025-04-28T14:43:04+00:00 Repair info: Not a mysql database -> nothing to do
2025-04-28T14:43:04+00:00 Repair step: Clean tags and favorites
2025-04-28T14:43:04+00:00 Repair info: 0 tags of deleted users have been removed.
2025-04-28T14:43:04+00:00 Repair info: 0 tags for delete files have been removed.
2025-04-28T14:43:04+00:00 Repair info: 0 tag entries for deleted tags have been removed.
2025-04-28T14:43:04+00:00 Repair info: 0 tags with no entries have been removed.
2025-04-28T14:43:04+00:00 Repair step: Repair invalid shares
2025-04-28T14:43:04+00:00 Repair step: Move .step file of updater to backup location
2025-04-28T14:43:04+00:00 Repair info: .step file exists
2025-04-28T14:43:04+00:00 Repair info: .step-previous-update removed
2025-04-28T14:43:04+00:00 Repair info: .step file moved to .step-previous-update
2025-04-28T14:43:04+00:00 Repair step: Add move avatar background job
2025-04-28T14:43:04+00:00 Repair info: Repair step already executed
2025-04-28T14:43:04+00:00 Repair step: Add preview cleanup background jobs
2025-04-28T14:43:04+00:00 Repair step: Migrate oauth2_clients table to nextcloud schema
2025-04-28T14:43:04+00:00 Repair info: Update the oauth2_access_tokens table schema.
2025-04-28T14:43:04+00:00 Repair info: Update the oauth2_clients table schema.
2025-04-28T14:43:04+00:00 Repair info: Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with *
2025-04-28T14:43:04+00:00 Repair step: Repair language codes
2025-04-28T14:43:04+00:00 Repair step: Add log rotate job
2025-04-28T14:43:04+00:00 Repair step: Clear frontend caches
2025-04-28T14:43:04+00:00 Repair info: Image cache cleared
2025-04-28T14:43:04+00:00 Repair info: JS cache cleared
2025-04-28T14:43:04+00:00 Repair step: Clear every generated avatar
2025-04-28T14:43:04+00:00 Repair step: Add preview background cleanup job
2025-04-28T14:43:04+00:00 Repair step: Queue a one-time job to cleanup old backups of the updater
2025-04-28T14:43:04+00:00 Repair step: Cleanup invalid photocache files for carddav
2025-04-28T14:43:04+00:00 Repair step: Add background job to cleanup login flow v2 tokens
2025-04-28T14:43:04+00:00 Repair step: Remove potentially over exposing share links
2025-04-28T14:43:04+00:00 Repair info: No need to remove link shares.
2025-04-28T14:43:04+00:00 Repair step: Clear access cache of projects
2025-04-28T14:43:04+00:00 Repair step: Reset generated avatar flag
2025-04-28T14:43:04+00:00 Repair step: Keep legacy encryption enabled
2025-04-28T14:43:04+00:00 Repair step: Check encryption key format
2025-04-28T14:43:04+00:00 Repair step: Remove old dashboard app config data
2025-04-28T14:43:04+00:00 Repair step: Add job to cleanup the bruteforce entries
2025-04-28T14:43:04+00:00 Repair step: Queue a one-time job to check for user uploaded certificates
2025-04-28T14:43:04+00:00 Repair step: Repair DAV shares
2025-04-28T14:43:04+00:00 Repair step: Add background job to set the lookup server share state for users
2025-04-28T14:43:04+00:00 Repair step: Add token cleanup job
2025-04-28T14:43:04+00:00 Repair step: Clean up abandoned apps
2025-04-28T14:43:04+00:00 Repair step: Add possibly missing system config
2025-04-28T14:43:04+00:00 Repair step: Add AI tasks cleanup jobs
2025-04-28T14:43:04+00:00 Repair step: Queue a job to generate metadata
2025-04-28T14:43:04+00:00 Repair step: migrate lazy config values
2025-04-28T14:43:04+00:00 Repair step: Cache logo dimension to fix size in emails on Outlook
2025-04-28T14:43:04+00:00 Repair info: Logo dimensions are already known
2025-04-28T14:43:04+00:00 Repair step: Remove legacy ".ocdata" file
2025-04-28T14:43:04+00:00 Repair step: Add cleanup-deleted-users background job
2025-04-28T14:43:04+00:00 Repair step: Validate account properties and store phone numbers in a known format for search
2025-04-28T14:43:04+00:00 Repair info: Queued background to validate account properties.
2025-04-28T14:43:04+00:00 Starting code integrity check...
2025-04-28T14:43:33+00:00 Finished code integrity check
2025-04-28T14:43:33+00:00 Update successful
2025-04-28T14:43:33+00:00 Maintenance mode is kept active
2025-04-28T14:43:33+00:00 Resetting log level
[carlene][root@/var/www/nextcloud] >

@susnux
Copy link
Contributor

susnux commented Apr 29, 2025

cc @ChristophWurst this seems to be CalDAV related.

@kesselb
Copy link
Contributor

kesselb commented Apr 29, 2025

Background job Repair step causing the queries: https://github.com/nextcloud/server/blob/9df998e710d19aa78a61f8f1cad054baf2b7263a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php

The background job repair step is there for a while. Is it possible that recently, many events or calendars were deleted?

@Kunsi
Copy link
Author

Kunsi commented Apr 29, 2025

In December i removed a large ICS subscription, but since then i did multiple upgrades of my nextcloud instance which did all only ever take a couple of minutes.

@susnux
Copy link
Contributor

susnux commented Apr 29, 2025

Maybe this background job can be chunked to reduce memory footprint?
We do this in other places as well.

@kesselb
Copy link
Contributor

kesselb commented Apr 29, 2025

Maybe this background job can be chunked to reduce memory footprint? We do this in other places as well.

Sorry, I wrote background job but meant repair step 🙈

The repair step is about removing orphaned data. What are your thoughts on marking it as expensive to skip it on upgrades?

Deletion is done in chunks of 200 ids. I think we could bump that to 1000 like we do in other places to have less expensive queries. Wrapping everything in a transaction could also help.

cc @SebastianKrupinski @st3iny

@st3iny
Copy link
Member

st3iny commented Apr 29, 2025

Yeah, we can increase the chunk size.

@susnux
Copy link
Contributor

susnux commented Apr 29, 2025

The repair step is about removing orphaned data. What are your thoughts on marking it as expensive to skip it on upgrades?

I meant like with other repair steps like this:

  • The repair step only triggers a background job
  • That background job processes a chunk
  • If there are more data it triggers itself with the next chunk

See also InitBackgroundImagesMigration of the theming app

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 31-feedback bug feature: caldav Related to CalDAV internals feature: database Database related DB performance 🚀
Projects
Status: 📄 To do
Development

No branches or pull requests

6 participants