Problem with update // Exception: Database error when running migration 31000Date20240814184402 for app core The column “lazy” on table “oc_preferences” already exists

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.6
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.02
  • Web server and version (e.g, Apache 2.4.25):
    • Apache2
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • n.n.
  • PHP version (e.g, 8.3):
    • 8.1
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • System was broken (no net access, php broken). After solving issues first start of my NC instance showed necessary update
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • replace me
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

After updating “occ upgrade” I get the following error, when accessing my NC-web and trying to upgrade there…

==============================

Exception: Database error when running migration 31000Date20240814184402 for app core The column “lazy” on table “oc_preferences” already exists.

Detaillierte Protokollmeldungen
Update vorbereiten

Log-Level auf “debug” gesetzt

Wartungsmodus eingeschaltet

Reparaturschritt: Repair MySQL collation

Reparaturinformation: All tables already have the correct collation → nothing to do

Reparaturschritt: Copy data from accounts table when migrating from ownCloud

Reparaturschritt: Drop account terms table when migrating from ownCloud

Das Datenbankschema wird aktualisiert

Exception: Database error when running migration 31000Date20240814184402 for app core The column “lazy” on table “oc_preferences” already exists.

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

  1. start NC’s internal ip address → needs update
  2. start update → shows error

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.

log is not updated (last entry 04.2024)

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": [
            "nextcloud",
            "kuevnet.duckdns.org",
            "cloud.sven-koeck.de",
            "cloud.familie-koeck.net",
            "172.16.*.*"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.12.2",
        "overwrite.cli.url": "http:\/\/172.16.2.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "filesystem_check_changes": 1,
        "has_rebuilt_cache": true,
        "default_language": "de",
        "default_phone_region": "DE",
        "remember_login_cookie_lifetime": 1814400,
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "logtype": "file",
        "logfile": "\/var\/log\/nextcloud log",
        "activity_expire_days": 93,
        "app_install_overwrite": {
            "0": "documentserver_community",
            "memcache.distributed": "\\OC\\Memcache\\Memcached",
            "memcache.locking": "\\OC\\Memcache\\Memcached",
            "memcached_servers": [
                [
                    "cloud.sven-koeck.de",
                    11211
                ],
                [
                    "cloud.familie-koeck.net",
                    11211
                ],
                [
                    "172.16.2.2",
                    11211
                ]
            ],
            "1": "mindmap_app",
            "2": "sharerenamer",
            "3": "officeonline",
            "4": "onlyoffice",
            "5": "files_rightclick",
            "6": "welcome",
            "7": "files_mindmap"
        },
        "maintenance_window_start": 1,
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64"
    }
}```

#### Apps

The output of `occ app:list`:

Enabled:
  - activity: 3.0.0
  - app_api: 4.0.6
  - bruteforcesettings: 3.0.0
  - cloud_federation_api: 1.13.0
  - contacts: 7.1.3
  - dashboard: 7.10.0
  - dav: 1.31.1
  - documentserver_community: 0.2.0
  - federatedfilesharing: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.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
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - mail: 5.1.4
  - memories: 7.5.2
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - onlyoffice: 9.9.0
  - password_policy: 2.0.0
  - photos: 3.0.2
  - privacy: 2.0.0
  - profile: true
  - provisioning_api: 1.20.0
  - recognize: 8.2.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.1.7
  - text: 4.1.0
  - theming: 2.6.0
  - twofactor_backupcodes: 1.19.0
  - twofactor_totp: 12.0.0-dev
  - updatenotification: 1.20.0
  - viewer: 3.0.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.21.0
  - calendar: 5.2.3 (installed 5.2.3)
  - carnet: 0.25.6 (installed 0.25.6)
  - circles: 31.0.0 (installed 25.0.0)
  - comments: 1.21.0 (installed 1.15.0)
  - contactsinteraction: 1.12.0 (installed 1.6.0)
  - encryption: 2.19.0
  - federation: 1.21.0 (installed 1.15.0)
  - files_external: 1.23.0 (installed 1.17.0)
  - files_mindmap: 0.0.33 (installed 0.0.33)
  - files_rightclick: 0.15.1 (installed 0.15.1)
  - firstrunwizard: 4.0.0 (installed 2.14.0)
  - nextcloud_announcements: 3.0.0 (installed 1.14.0)
  - officeonline: 3.0.2 (installed 3.0.2)
  - recommendations: 4.0.0 (installed 1.4.0)
  - related_resources: 2.0.0 (installed 1.0.3)
  - sharerenamer: 3.5.0 (installed 3.5.0)
  - support: 3.0.0 (installed 1.8.0)
  - survey_client: 3.0.0 (installed 1.13.0)
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1 (installed 1.15.0)
  - twofactor_nextcloud_notification: 5.0.0
  - user_ldap: 1.22.0
  - user_status: 1.11.0 (installed 1.5.0)
  - weather_status: 1.11.0 (installed 1.5.0)
  - welcome: 1.2.1 (installed 1.2.1)