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

[Bug]: Database error when running migration 1027Date20230504122946 for app dav: Field 'id' doesn't have a default value #39007

Closed
4 of 8 tasks
MG-5 opened this issue Jun 26, 2023 · 4 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug feature: carddav Related to CardDAV internals feature: dav feature: install and update needs info stale Ticket or PR with no recent activity

Comments

@MG-5
Copy link

MG-5 commented Jun 26, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

This bug report is similar to #38902 however it's a different outcome.
Updating my Nextcloud to 27 throws the following error and logs:

Database error when running migration 1027Date... for app dav An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value

I got the migration working again with following things:
I used occ config:list to list all entries and occ config:app:delete dav <entry> to delete all entries from dav. After this I had to reinstall the Calendar app.

But entering the command: dav:sync-system-addressbook suggested by @ChristophWurst still goes the error message:

docker exec -it nextcloud occ dav:sync-system-addressbook 
Syncing users ...
    0 [>---------------------------]
In ExceptionConverter.php line 116:
                                                                                                                               
  An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value  
                                                                                                                               
In Exception.php line 30:
                                                                                
  SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value  
                                                                                
In Statement.php line 101:
                                                                                
  SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value  
                                                                                
dav:sync-system-addressbook

Steps to reproduce

  1. Update Nextcloud from 26 to 27
  2. Execute docker exec -it nextcloud updater.phar
  3. Execute docker exec -it nextcloud occ upgrade

Expected behavior

The migration works and I can access Nextcloud again

Installation method

Community Docker image

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 22 to 23)

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": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "10.0.0.25",
            "nextcloud.***REMOVED SENSITIVE VALUE***.de"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "overwritehost": "nextcloud.***REMOVED SENSITIVE VALUE***.de",
        "overwrite.cli.url": "https:\/\/nextcloud.***REMOVED SENSITIVE VALUE***.de",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "version": "27.0.0.8",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "theme": "",
        "loglevel": 0,
        "maintenance": false,
        "mysql.utf8mb4": true,
        "data-fingerprint": "f35ffe4fd2c8136adb1566ae2cf0a85f",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "default_phone_region": "DE",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpsecure": "ssl",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - calendar: 4.4.2
  - circles: 27.0.0
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - dashboard: 7.7.0
  - dav: 1.27.0
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_pdfviewer: 2.8.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - nextcloud_announcements: 1.16.0
  - notifications: 2.15.0
  - oauth2: 1.15.0
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - support: 1.10.0
  - survey_client: 1.15.0
  - systemtags: 1.17.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - twofactor_totp: 9.0.0
  - updatenotification: 1.17.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflowengine: 2.9.0
Disabled:
  - admin_audit: 1.17.0
  - bruteforcesettings: 2.7.0 (installed 1.3.0)
  - contactsinteraction: 1.8.0 (installed 1.1.0)
  - encryption: 2.15.0
  - files_external: 1.19.0
  - suspicious_login: 5.0.0
  - unsplash: 2.2.1 (installed 2.2.1)
  - user_ldap: 1.17.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{
   "reqId":"dvK4KAT0GSaAbg2VDrE3",
   "level":3,
   "time":"2023-06-20T23:34:02+00:00",
   "remoteAddr":"",
   "user":"--",
   "app":"no app in context",
   "method":"",
   "url":"--",
   "message":"Database error when running migration 1027Date20230504122946 for app dav\nAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value",
   "userAgent":"--",
   "version":"26.0.2.1",
   "exception":{
      "Exception":"Exception",
      "Message":"Database error when running migration 1027Date20230504122946 for app dav\nAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value",
      "Code":0,
      "Trace":[
         {
            "file":"/config/www/nextcloud/lib/private/legacy/OC_App.php",
            "line":844,
            "function":"migrate",
            "class":"OC\\DB\\MigrationService",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/lib/private/Updater.php",
            "line":359,
            "function":"updateApp",
            "class":"OC_App",
            "type":"::",
            "args":[
               "*** sensitive parameters replaced ***"
            ]
         },
         {
            "file":"/config/www/nextcloud/lib/private/Updater.php",
            "line":271,
            "function":"doAppUpgrade",
            "class":"OC\\Updater",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/lib/private/Updater.php",
            "line":139,
            "function":"doUpgrade",
            "class":"OC\\Updater",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/core/Command/Upgrade.php",
            "line":225,
            "function":"upgrade",
            "class":"OC\\Updater",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/3rdparty/symfony/console/Command/Command.php",
            "line":298,
            "function":"execute",
            "class":"OC\\Core\\Command\\Upgrade",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
            "line":1040,
            "function":"run",
            "class":"Symfony\\Component\\Console\\Command\\Command",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
            "line":301,
            "function":"doRunCommand",
            "class":"Symfony\\Component\\Console\\Application",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
            "line":171,
            "function":"doRun",
            "class":"Symfony\\Component\\Console\\Application",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/lib/private/Console/Application.php",
            "line":211,
            "function":"run",
            "class":"Symfony\\Component\\Console\\Application",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/console.php",
            "line":100,
            "function":"run",
            "class":"OC\\Console\\Application",
            "type":"->"
         },
         {
            "file":"/config/www/nextcloud/occ",
            "line":11,
            "args":[
               "/config/www/nextcloud/console.php"
            ],
            "function":"require_once"
         }
      ],
      "File":"/config/www/nextcloud/lib/private/DB/MigrationService.php",
      "Line":421,
      "Previous":{
         "Exception":"Doctrine\\DBAL\\Exception\\NotNullConstraintViolationException",
         "Message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value",
         "Code":1364,
         "Trace":[
            {
               "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
               "line":1814,
               "function":"convert",
               "class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
               "line":1749,
               "function":"handleDriverException",
               "class":"Doctrine\\DBAL\\Connection",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
               "line":1163,
               "function":"convertExceptionDuringQuery",
               "class":"Doctrine\\DBAL\\Connection",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/lib/private/DB/Connection.php",
               "line":295,
               "function":"executeStatement",
               "class":"Doctrine\\DBAL\\Connection",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
               "line":354,
               "function":"executeStatement",
               "class":"OC\\DB\\Connection",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
               "line":280,
               "function":"execute",
               "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php",
               "line":433,
               "function":"execute",
               "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php",
               "line":63,
               "function":"OCA\\DAV\\CardDAV\\{closure}",
               "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
               "type":"->",
               "args":[
                  "*** sensitive parameters replaced ***"
               ]
            },
            {
               "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php",
               "line":422,
               "function":"atomic",
               "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
               "line":125,
               "function":"createAddressBook",
               "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
               "type":"->",
               "args":[
                  "*** sensitive parameters replaced ***"
               ]
            },
            {
               "file":"/config/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php",
               "line":63,
               "function":"OCA\\DAV\\CardDAV\\{closure}",
               "class":"OCA\\DAV\\CardDAV\\SyncService",
               "type":"->",
               "args":[
                  "*** sensitive parameters replaced ***"
               ]
            },
            {
               "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
               "line":120,
               "function":"atomic",
               "class":"OCA\\DAV\\CardDAV\\SyncService",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
               "line":267,
               "function":"ensureSystemAddressBookExists",
               "class":"OCA\\DAV\\CardDAV\\SyncService",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
               "line":276,
               "function":"getLocalSystemAddressBook",
               "class":"OCA\\DAV\\CardDAV\\SyncService",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/apps/dav/lib/Migration/Version1027Date20230504122946.php",
               "line":52,
               "function":"syncInstance",
               "class":"OCA\\DAV\\CardDAV\\SyncService",
               "type":"->",
               "args":[
                  "*** sensitive parameters replaced ***"
               ]
            },
            {
               "file":"/config/www/nextcloud/lib/private/DB/MigrationService.php",
               "line":537,
               "function":"postSchemaChange",
               "class":"OCA\\DAV\\Migration\\Version1027Date20230504122946",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/lib/private/DB/MigrationService.php",
               "line":417,
               "function":"executeStep",
               "class":"OC\\DB\\MigrationService",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/lib/private/legacy/OC_App.php",
               "line":844,
               "function":"migrate",
               "class":"OC\\DB\\MigrationService",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/lib/private/Updater.php",
               "line":359,
               "function":"updateApp",
               "class":"OC_App",
               "type":"::",
               "args":[
                  "*** sensitive parameters replaced ***"
               ]
            },
            {
               "file":"/config/www/nextcloud/lib/private/Updater.php",
               "line":271,
               "function":"doAppUpgrade",
               "class":"OC\\Updater",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/lib/private/Updater.php",
               "line":139,
               "function":"doUpgrade",
               "class":"OC\\Updater",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/core/Command/Upgrade.php",
               "line":225,
               "function":"upgrade",
               "class":"OC\\Updater",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/3rdparty/symfony/console/Command/Command.php",
               "line":298,
               "function":"execute",
               "class":"OC\\Core\\Command\\Upgrade",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
               "line":1040,
               "function":"run",
               "class":"Symfony\\Component\\Console\\Command\\Command",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
               "line":301,
               "function":"doRunCommand",
               "class":"Symfony\\Component\\Console\\Application",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
               "line":171,
               "function":"doRun",
               "class":"Symfony\\Component\\Console\\Application",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/lib/private/Console/Application.php",
               "line":211,
               "function":"run",
               "class":"Symfony\\Component\\Console\\Application",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/console.php",
               "line":100,
               "function":"run",
               "class":"OC\\Console\\Application",
               "type":"->"
            },
            {
               "file":"/config/www/nextcloud/occ",
               "line":11,
               "args":[
                  "/config/www/nextcloud/console.php"
               ],
               "function":"require_once"
            }
         ],
         "File":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php",
         "Line":116,
         "Previous":{
            "Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception",
            "Message":"SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value",
            "Code":1364,
            "Trace":[
               {
                  "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                  "line":103,
                  "function":"new",
                  "class":"Doctrine\\DBAL\\Driver\\PDO\\Exception",
                  "type":"::"
               },
               {
                  "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                  "line":1155,
                  "function":"execute",
                  "class":"Doctrine\\DBAL\\Driver\\PDO\\Statement",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/lib/private/DB/Connection.php",
                  "line":295,
                  "function":"executeStatement",
                  "class":"Doctrine\\DBAL\\Connection",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                  "line":354,
                  "function":"executeStatement",
                  "class":"OC\\DB\\Connection",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                  "line":280,
                  "function":"execute",
                  "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php",
                  "line":433,
                  "function":"execute",
                  "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php",
                  "line":63,
                  "function":"OCA\\DAV\\CardDAV\\{closure}",
                  "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
                  "type":"->",
                  "args":[
                     "*** sensitive parameters replaced ***"
                  ]
               },
               {
                  "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php",
                  "line":422,
                  "function":"atomic",
                  "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
                  "line":125,
                  "function":"createAddressBook",
                  "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
                  "type":"->",
                  "args":[
                     "*** sensitive parameters replaced ***"
                  ]
               },
               {
                  "file":"/config/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php",
                  "line":63,
                  "function":"OCA\\DAV\\CardDAV\\{closure}",
                  "class":"OCA\\DAV\\CardDAV\\SyncService",
                  "type":"->",
                  "args":[
                     "*** sensitive parameters replaced ***"
                  ]
               },
               {
                  "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
                  "line":120,
                  "function":"atomic",
                  "class":"OCA\\DAV\\CardDAV\\SyncService",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
                  "line":267,
                  "function":"ensureSystemAddressBookExists",
                  "class":"OCA\\DAV\\CardDAV\\SyncService",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
                  "line":276,
                  "function":"getLocalSystemAddressBook",
                  "class":"OCA\\DAV\\CardDAV\\SyncService",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/apps/dav/lib/Migration/Version1027Date20230504122946.php",
                  "line":52,
                  "function":"syncInstance",
                  "class":"OCA\\DAV\\CardDAV\\SyncService",
                  "type":"->",
                  "args":[
                     "*** sensitive parameters replaced ***"
                  ]
               },
               {
                  "file":"/config/www/nextcloud/lib/private/DB/MigrationService.php",
                  "line":537,
                  "function":"postSchemaChange",
                  "class":"OCA\\DAV\\Migration\\Version1027Date20230504122946",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/lib/private/DB/MigrationService.php",
                  "line":417,
                  "function":"executeStep",
                  "class":"OC\\DB\\MigrationService",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/lib/private/legacy/OC_App.php",
                  "line":844,
                  "function":"migrate",
                  "class":"OC\\DB\\MigrationService",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/lib/private/Updater.php",
                  "line":359,
                  "function":"updateApp",
                  "class":"OC_App",
                  "type":"::",
                  "args":[
                     "*** sensitive parameters replaced ***"
                  ]
               },
               {
                  "file":"/config/www/nextcloud/lib/private/Updater.php",
                  "line":271,
                  "function":"doAppUpgrade",
                  "class":"OC\\Updater",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/lib/private/Updater.php",
                  "line":139,
                  "function":"doUpgrade",
                  "class":"OC\\Updater",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/core/Command/Upgrade.php",
                  "line":225,
                  "function":"upgrade",
                  "class":"OC\\Updater",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/3rdparty/symfony/console/Command/Command.php",
                  "line":298,
                  "function":"execute",
                  "class":"OC\\Core\\Command\\Upgrade",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
                  "line":1040,
                  "function":"run",
                  "class":"Symfony\\Component\\Console\\Command\\Command",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
                  "line":301,
                  "function":"doRunCommand",
                  "class":"Symfony\\Component\\Console\\Application",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
                  "line":171,
                  "function":"doRun",
                  "class":"Symfony\\Component\\Console\\Application",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/lib/private/Console/Application.php",
                  "line":211,
                  "function":"run",
                  "class":"Symfony\\Component\\Console\\Application",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/console.php",
                  "line":100,
                  "function":"run",
                  "class":"OC\\Console\\Application",
                  "type":"->"
               },
               {
                  "file":"/config/www/nextcloud/occ",
                  "line":11,
                  "args":[
                     "/config/www/nextcloud/console.php"
                  ],
                  "function":"require_once"
               }
            ],
            "File":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
            "Line":30,
            "Previous":{
               "Exception":"PDOException",
               "Message":"SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value",
               "Code":"HY000",
               "Trace":[
                  {
                     "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                     "line":101,
                     "function":"execute",
                     "class":"PDOStatement",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                     "line":1155,
                     "function":"execute",
                     "class":"Doctrine\\DBAL\\Driver\\PDO\\Statement",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/DB/Connection.php",
                     "line":295,
                     "function":"executeStatement",
                     "class":"Doctrine\\DBAL\\Connection",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                     "line":354,
                     "function":"executeStatement",
                     "class":"OC\\DB\\Connection",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                     "line":280,
                     "function":"execute",
                     "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php",
                     "line":433,
                     "function":"execute",
                     "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php",
                     "line":63,
                     "function":"OCA\\DAV\\CardDAV\\{closure}",
                     "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
                     "type":"->",
                     "args":[
                        "*** sensitive parameters replaced ***"
                     ]
                  },
                  {
                     "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php",
                     "line":422,
                     "function":"atomic",
                     "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
                     "line":125,
                     "function":"createAddressBook",
                     "class":"OCA\\DAV\\CardDAV\\CardDavBackend",
                     "type":"->",
                     "args":[
                        "*** sensitive parameters replaced ***"
                     ]
                  },
                  {
                     "file":"/config/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php",
                     "line":63,
                     "function":"OCA\\DAV\\CardDAV\\{closure}",
                     "class":"OCA\\DAV\\CardDAV\\SyncService",
                     "type":"->",
                     "args":[
                        "*** sensitive parameters replaced ***"
                     ]
                  },
                  {
                     "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
                     "line":120,
                     "function":"atomic",
                     "class":"OCA\\DAV\\CardDAV\\SyncService",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
                     "line":267,
                     "function":"ensureSystemAddressBookExists",
                     "class":"OCA\\DAV\\CardDAV\\SyncService",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php",
                     "line":276,
                     "function":"getLocalSystemAddressBook",
                     "class":"OCA\\DAV\\CardDAV\\SyncService",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/apps/dav/lib/Migration/Version1027Date20230504122946.php",
                     "line":52,
                     "function":"syncInstance",
                     "class":"OCA\\DAV\\CardDAV\\SyncService",
                     "type":"->",
                     "args":[
                        "*** sensitive parameters replaced ***"
                     ]
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/DB/MigrationService.php",
                     "line":537,
                     "function":"postSchemaChange",
                     "class":"OCA\\DAV\\Migration\\Version1027Date20230504122946",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/DB/MigrationService.php",
                     "line":417,
                     "function":"executeStep",
                     "class":"OC\\DB\\MigrationService",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/legacy/OC_App.php",
                     "line":844,
                     "function":"migrate",
                     "class":"OC\\DB\\MigrationService",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/Updater.php",
                     "line":359,
                     "function":"updateApp",
                     "class":"OC_App",
                     "type":"::",
                     "args":[
                        "*** sensitive parameters replaced ***"
                     ]
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/Updater.php",
                     "line":271,
                     "function":"doAppUpgrade",
                     "class":"OC\\Updater",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/Updater.php",
                     "line":139,
                     "function":"doUpgrade",
                     "class":"OC\\Updater",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/core/Command/Upgrade.php",
                     "line":225,
                     "function":"upgrade",
                     "class":"OC\\Updater",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/3rdparty/symfony/console/Command/Command.php",
                     "line":298,
                     "function":"execute",
                     "class":"OC\\Core\\Command\\Upgrade",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
                     "line":1040,
                     "function":"run",
                     "class":"Symfony\\Component\\Console\\Command\\Command",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
                     "line":301,
                     "function":"doRunCommand",
                     "class":"Symfony\\Component\\Console\\Application",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/3rdparty/symfony/console/Application.php",
                     "line":171,
                     "function":"doRun",
                     "class":"Symfony\\Component\\Console\\Application",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/lib/private/Console/Application.php",
                     "line":211,
                     "function":"run",
                     "class":"Symfony\\Component\\Console\\Application",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/console.php",
                     "line":100,
                     "function":"run",
                     "class":"OC\\Console\\Application",
                     "type":"->"
                  },
                  {
                     "file":"/config/www/nextcloud/occ",
                     "line":11,
                     "args":[
                        "/config/www/nextcloud/console.php"
                     ],
                     "function":"require_once"
                  }
               ],
               "File":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
               "Line":101
            }
         }
      },
      "message":"Database error when running migration 1027Date20230504122946 for app dav\nAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value",
      "exception":{
         
      },
      "CustomMessage":"Database error when running migration 1027Date20230504122946 for app dav\nAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value"
   }
}

Additional info

No response

@MG-5 MG-5 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jun 26, 2023
@MG-5
Copy link
Author

MG-5 commented Jun 26, 2023

Searching in MariaDB for columns with "id" i got this:

MariaDB [(none)]> select * from information_schema.columns where column_name="id";
+---------------+--------------------+---------------------------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+--------------------+---------------------+------------+----------------+---------------------------------+----------------+--------------+-----------------------+
| TABLE_CATALOG | TABLE_SCHEMA       | TABLE_NAME                            | COLUMN_NAME | ORDINAL_POSITION | COLUMN_DEFAULT | IS_NULLABLE | DATA_TYPE | CHARACTER_MAXIMUM_LENGTH | CHARACTER_OCTET_LENGTH | NUMERIC_PRECISION | NUMERIC_SCALE | DATETIME_PRECISION | CHARACTER_SET_NAME | COLLATION_NAME     | COLUMN_TYPE         | COLUMN_KEY | EXTRA          | PRIVILEGES                      | COLUMN_COMMENT | IS_GENERATED | GENERATION_EXPRESSION |
+---------------+--------------------+---------------------------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+--------------------+---------------------+------------+----------------+---------------------------------+----------------+--------------+-----------------------+
| def           | information_schema | COLLATIONS                            | ID          |                3 | NULL           | YES         | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(11)          |            |                | select                          |                | NEVER        | NULL                  |
| def           | information_schema | COLLATION_CHARACTER_SET_APPLICABILITY | ID          |                4 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(11)          |            |                | select                          |                | NEVER        | NULL                  |
| def           | information_schema | PROCESSLIST                           | ID          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(4)           |            |                | select                          |                | NEVER        | NULL                  |
| def           | information_schema | INNODB_SYS_FOREIGN_COLS               | ID          |                1 | NULL           | NO          | varchar   |                      193 |                    579 |              NULL |          NULL |               NULL | utf8mb3            | utf8mb3_general_ci | varchar(193)        |            |                | select                          |                | NEVER        | NULL                  |
| def           | information_schema | INNODB_SYS_FOREIGN                    | ID          |                1 | NULL           | NO          | varchar   |                      193 |                    579 |              NULL |          NULL |               NULL | utf8mb3            | utf8mb3_general_ci | varchar(193)        |            |                | select                          |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_accounts_data                      | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_addressbookchanges                 | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_addressbooks                       | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned |            |                | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_authorized_groups                  | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_authtoken                          | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_bruteforce_attempts                | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendar_appt_bookings             | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendar_appt_configs              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendar_invitations               | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendar_reminders                 | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendar_resources                 | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendar_resources_md              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendar_rooms                     | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendar_rooms_md                  | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendarchanges                    | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendarobjects                    | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendarobjects_props              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendars                          | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_calendarsubscriptions              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_cards                              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_cards_properties                   | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_circles_circle                     | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_circles_member                     | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_circles_mount                      | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_circles_mountpoint                 | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_circles_remote                     | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_circles_share_lock                 | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_circles_token                      | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_collres_collections                | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_comments                           | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_dav_cal_proxy                      | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_dav_shares                         | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_direct_edit                        | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_directlink                         | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_file_locks                         | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_file_metadata                      | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        |                | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_files_trash                        | id          |                2 | ''             | NO          | varchar   |                      250 |                   1000 |              NULL |          NULL |               NULL | utf8mb4            | utf8mb4_bin        | varchar(250)        | MUL        |                | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_files_versions                     | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_flow_checks                        | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_flow_operations                    | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_flow_operations_scope              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_jobs                               | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_known_users                        | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_login_flow_v2                      | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_mimetypes                          | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_mounts                             | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_notifications_pushhash             | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_notifications_settings             | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_oauth2_access_tokens               | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_oauth2_clients                     | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_open_local_editor                  | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_photos_albums_collabs              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_privacy_admins                     | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_profile_config                     | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_properties                         | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_ratelimit_entries                  | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_reactions                          | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_recent_contact                     | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_schedulingobjects                  | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_share                              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_share_external                     | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_storages                           | id          |                2 | NULL           | YES         | varchar   |                       64 |                    256 |              NULL |          NULL |               NULL | utf8mb4            | utf8mb4_bin        | varchar(64)         | UNI        |                | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_storages_credentials               | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_systemtag                          | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_text_documents                     | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        |                | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_text_sessions                      | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_text_steps                         | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_trusted_servers                    | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_twofactor_backupcodes              | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                19 |             0 |               NULL | NULL               | NULL               | bigint(20)          | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_twofactor_totp_secrets             | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_twofactor_u2f_registrations        | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_user_status                        | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_user_transfer_owner                | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_vcategory                          | id          |                1 | NULL           | NO          | bigint    |                     NULL |                   NULL |                20 |             0 |               NULL | NULL               | NULL               | bigint(20) unsigned | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_webauthn                           | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(11)             | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
| def           | nextcloud          | oc_whats_new                          | id          |                1 | NULL           | NO          | int       |                     NULL |                   NULL |                10 |             0 |               NULL | NULL               | NULL               | int(10) unsigned    | PRI        | auto_increment | select,insert,update,references |                | NEVER        | NULL                  |
+---------------+--------------------+---------------------------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+--------------------+---------------------+------------+----------------+---------------------------------+----------------+--------------+-----------------------+

@szaimen
Copy link
Contributor

szaimen commented Jun 26, 2023

cc @ChristophWurst

@ChristophWurst ChristophWurst changed the title [Bug]: Database error when running migration 1027Date... for app dav An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value [Bug]: Database error when running migration 1027Date20230504122946 for app dav: Field 'id' doesn't have a default value Jun 26, 2023
@joshtrichards
Copy link
Member

This really looks like your id column is incorrectly setup for some reason. Like noted here
#38902 (comment)

I guess you need to alter your table. No idea how you ended up like that, but I don't actually think it was the mentioned migration - it just brought it out.

When we provision that table in a new installation we definitely set auto increment and primary key that id column:

if (!$schema->hasTable('addressbooks')) {
$table = $schema->createTable('addressbooks');
$table->addColumn('id', 'bigint', [
'autoincrement' => true,
'notnull' => true,
'length' => 11,
'unsigned' => true,

@nextcloud-command
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@nextcloud-command nextcloud-command added the stale Ticket or PR with no recent activity label Jan 21, 2024
@nextcloud-command nextcloud-command closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
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 27-feedback bug feature: carddav Related to CardDAV internals feature: dav feature: install and update needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests

5 participants