nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.26k stars 4.05k forks source link

[Bug]: SQLite error when upgrading from 28.0.4 to 29.0.1 #45746

Closed paulz-gh closed 4 months ago

paulz-gh commented 4 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

occ upgrade fails wiith : An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1 no such column: \"-1\" - should this be a string literal in single-quotes?

Using pkg version on FreeBSD

Steps to reproduce

SQLite used as database

  1. Installl nextcloud-php82-28.0.4
  2. run pkg upgrade to update to 29.0.1
  3. run occ upgrade

On another system I see the same error when updating from 28.0.3 to 28.0.6 and in nextcloud.log it reports the following query for the error: SELECT t.name AS table_name,\n p.*\n FROM sqlite_master t\n JOIN pragma_foreign_key_list (t.name) p\n ON p.\"seq\" != \"-1\" WHERE t.type = 'table' AND t.name NOT IN ('geometry_columns', 'spatial_ref_sys', 'sqlite_sequence') ORDER BY t.name, p.id DESC, p.seq",[],[],null]},{"fi le":"/www/sites/vanderzwan/nextcloud/3rdparty/doctrine/dbal/src/Schema/SqliteSchemaManager.php","line":763,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":[" SELECT t .name AS table_name,\n p.*\n FROM sqlite_master t\n JOIN pragma_foreign_key_list(t.name) p\n ON p.\"seq\" != \"-1\" WHERE t.type = 'table' AND t .name NOT IN ('geometry_columns', 'spatial_ref_sys', 'sqlite_sequence') ORDER BY t.name, p.id DESC, p.seq

Expected behavior

occ upgrade completed without database exceptions

Installation method

None

Nextcloud Server version

29

Operating system

Other

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

SQlite

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

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

{
    "system": {
        "apps_paths": [
            {
                "path": "\/usr\/local\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": true
            },
            {
                "path": "\/usr\/local\/www\/nextcloud\/apps-pkg",
                "url": "\/apps-pkg",
                "writable": false
            }
        ],
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "mlz.vanderzwan.org"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "sqlite",
        "version": "28.0.4.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "bulkupload.enabled": true,
        "loglevel": 0,
        "logtimezone": "CET",
        "maintenance": false,
        "default_phone_region": "nl",
        "theme": ""
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - cloud_federation_api: 1.11.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - files: 2.0.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - photos: 2.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - quota_warning: 1.19.0
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - support: 1.11.1
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - workflowengine: 2.10.0
Disabled:
  - circles: 28.0.0 (installed 25.0.0)
  - comments: 1.18.0 (installed 1.15.0)
  - contactsinteraction: 1.9.0 (installed 1.6.0)
  - dashboard: 7.8.0 (installed 7.5.0)
  - encryption: 2.16.0
  - federation: 1.18.0 (installed 1.15.0)
  - files_external: 1.20.0 (installed 1.17.0)
  - files_pdfviewer: 2.9.0 (installed 2.6.0)
  - password_policy: 1.18.0 (installed 1.15.0)
  - recommendations: 2.0.0 (installed 1.4.0)
  - related_resources: 1.3.0 (installed 1.0.3)
  - sharebymail: 1.18.0 (installed 1.15.0)
  - survey_client: 1.16.0 (installed 1.13.0)
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0 (installed 1.15.0)
  - twofactor_totp: 10.0.0-beta.2
  - user_ldap: 1.19.0
  - weather_status: 1.8.0 (installed 1.5.0)

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

paulz-gh commented 4 months ago

Duplicate of 44445