Upgrade issues with the Tables app

The Basics

  • Nextcloud Server version (e.g., 29.x.x):

    • Upgrade from 33.0.3.2 to 34.0.5

    Operating system and version (e.g., Ubuntu 24.04):

    • openSUSE Tumbleweed as of 2026-10-20
  • Web server and version (e.g, Apache 2.4.25):

    • Apache 2.4.67
  • Reverse proxy and version _(e.g. nginx 1.27.2)

    • n/a
  • PHP version (e.g, 8.3):

    • 8.5.12
  • Is this the first time you’ve seen this error? (Yes / No):

    • Yes
  • When did this problem seem to first start?

    • When 'occ upgrade' was run during the upgrade of the RPM package
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)

    • openSUSE RPM
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)

    • No

Summary of the issue you are facing:

When occ upgradewas run during the rpm package upgrade it seemed to be stuck like forever in Updating <tables> ..., but after some tens of minutes it printed the following error message and continued to the end without any further errors.

An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked

Then after starting the web server, I got the following error, and a button to run the upgrade process again. But then it failed with the same messge, and also when I tried to occ upgrade again.

In subsequent runs this message switched between complaining about tables_views_uuid_uniq and tables_col_uuid_uniq, and when I manually deleted both indexes at once the behavior changed back to running busy for some tens of minutes and growing the SQLite WAL file until it had almost the size of the actual database, before it ran into that database is locked issue again and exited.

Running strace on the occ process showed that it called the getrandom()syscall very often and did some writing to the WAL file in between.

While that upgrade process was running there were also some database locked errors by nextcloud’s internal cron faclity, so my guess would be that there is a race condition about the database lock between the two and the Tables upgrade simply runs until cron wins the race.

So, I think we have two issues here, one is the tables upgrade getting stuck in an endless loop and the other is the SQLite database layer of Nextcloud not dealing well with concurrent access. I’ve also seen other instances of database locked, e.g. when importing iCal files into the calendar app that seems to parallelize this per calendar item and some of them always fail, because some other ones hold the lock.

Steps to replicate it (hint: details matter!):

  1. See above, I have no idea what actually brought the tables app into that state.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

https://gofile.io/d/E0UMIIuG

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "sqlite3",
        "version": "33.0.3.2",
        "installed": true,
        "maintenance": true,
        "loglevel": 2,
        "mail_smtpmode": "sendmail",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "theme": "",
        "app.mail.imap.timeout": 60,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        }
    }
}

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 7.0.0
  - app_api: 34.0.0
  - appstore: true
  - audioplayer: 4.0.0
  - bruteforcesettings: 7.0.0
  - calendar: 6.6.3
  - circles: 34.0.0
  - cloud_federation_api: 1.18.0
  - collectives: 4.7.1
  - comments: 1.24.0
  - contacts: 8.9.2
  - contactsinteraction: 1.15.0
  - cookbook: 0.11.12
  - dashboard: 7.14.0
  - dav: 1.40.0
  - federatedfilesharing: 1.24.0
  - federation: 1.24.0
  - files: 2.6.0
  - files_downloadlimit: 5.2.0
  - files_pdfviewer: 7.0.0
  - files_reminders: 1.7.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - files_versions: 1.27.0
  - firstrunwizard: 7.0.0-dev.0
  - forms: 5.4.0
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - mail: 5.12.5
  - nextcloud_announcements: 6.0.0
  - notes: 6.1.0
  - notifications: 7.0.0-dev.1
  - oauth2: 1.22.0
  - password_policy: 6.0.0-dev.0
  - photos: 7.0.0
  - polls: 9.3.0
  - privacy: 6.0.0-dev.1
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - recommendations: 7.0.0
  - related_resources: 5.0.0-dev.0
  - serverinfo: 6.0.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - support: 6.0.0
  - survey_client: 6.0.0-dev.0
  - suspicious_login: 12.0.0-dev.0
  - systemtags: 1.24.0
  - tables: 2.1.0
  - tasks: 0.18.1
  - text: 7.0.1
  - theming: 2.9.0
  - twofactor_backupcodes: 1.22.0
  - twofactor_totp: 15.0.0
  - updatenotification: 1.23.0
  - user_status: 1.13.0
  - viewer: 6.0.0
  - weather_status: 1.13.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - admin_audit: 1.24.0
  - deck: 1.17.7 (installed 1.17.7)
  - dicomviewer: 2.3.3 (installed 2.3.3)
  - duplicatefinder: 1.9.0 (installed 1.9.0)
  - encryption: 2.22.0
  - files_external: 1.26.0
  - files_lock: 34.0.1
  - files_texteditor: 2.15.1 (installed 2.15.1)
  - office: 1.0.0
  - twofactor_nextcloud_notification: 8.0.0
  - user_ldap: 1.25.0

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

This looks specific to the Tables app best as I can tell.

Would be worth reporting there to determine if it’s specific to SQLite or what:

Likely introduced via feat: add UUIDs to columns by blizzz · Pull Request #2598 · nextcloud/tables · GitHub