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]: "Integrity constraint violation: 19 UNIQUE constraint failed: oc_user_status.user_id" after fresh setup #41288

Closed
5 of 8 tasks
GiantCrocodile opened this issue Nov 5, 2023 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug feature: status

Comments

@GiantCrocodile
Copy link

GiantCrocodile commented Nov 5, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

Hello,

after a fresh Nextcloud v27.1.3 setup on my NAS, I get this error in the protocol:

OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: oc_user_status.user_id

Steps to reproduce

  1. Perform a fresh Nextcloud app installation from https://www.asustor.com/de/app_central/app_detail?id=941&type= and choose sqlite db
  2. check protocol

Expected behavior

no error

Installation method

Community Docker image

Nextcloud Server version

27

Operating system

Debian/Ubuntu

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?

Fresh Nextcloud Server install

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

{
    "htaccess.RewriteBase": "\/",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "<removed>"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "sqlite3",
    "version": "27.1.3.2",
    "overwrite.cli.url": "http:\/\/<removed>",
    "installed": true
}

List of activated Apps

Enabled:
 - activity: 2.19.0
 - calendar: 4.5.2
 - circles: 27.0.1
 - cloud_federation_api: 1.10.0
 - comments: 1.17.0
 - contacts: 5.4.2
 - contactsinteraction: 1.8.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_reminders: 1.0.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
 - mail: 3.4.4
 - nextcloud_announcements: 1.16.0
 - notes: 4.8.1
 - notifications: 2.15.0
 - oauth2: 1.15.1
 - 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
 - richdocuments: 8.2.2
 - richdocumentscode: 23.5.503
 - serverinfo: 1.17.0
 - settings: 1.9.0
 - sharebymail: 1.17.0
 - spreed: 17.1.2
 - 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
 - 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
 - bruteforcesettings
 - encryption
 - files_external
 - suspicious_login
 - twofactor_totp
 - user_ldap


### Nextcloud Signing status

```shell
No errors have been found.

Nextcloud Logs

{
  "reqId": "vpRpyWQkttetUQX1Cn2F",
  "level": 3,
  "time": "2023-11-03T19:57:43+00:00",
  "remoteAddr": "<removed>",
  "user": "<removed>",
  "app": "no app in context",
  "method": "PUT",
  "url": "/ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json",
  "message": "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: oc_user_status.user_id",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0",
  "version": "27.1.3.2",
  "exception": {
    "Exception": "OC\\DB\\Exceptions\\DbalException",
    "Message": "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: oc_user_status.user_id",
    "Code": 19,
    "Trace": [
      {
        "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line": 328,
        "function": "wrap",
        "class": "OC\\DB\\Exceptions\\DbalException",
        "type": "::",
        "args": [
          [
            "Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/public/AppFramework/Db/QBMapper.php",
        "line": 137,
        "function": "executeStatement",
        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/user_status/lib/Listener/UserLiveStatusListener.php",
        "line": 104,
        "function": "insert",
        "class": "OCP\\AppFramework\\Db\\QBMapper",
        "type": "->",
        "args": [
          [
            "OCA\\UserStatus\\Db\\UserStatus",
            null,
            "<removed>",
            "online",
            1699041463,
            false,
            null,
            null,
            null,
            null,
            null
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 86,
        "function": "handle",
        "class": "OCA\\UserStatus\\Listener\\UserLiveStatusListener",
        "type": "->",
        "args": [
          [
            "OCP\\User\\Events\\UserLiveStatusEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 251,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->",
        "args": [
          [
            "OCP\\User\\Events\\UserLiveStatusEvent"
          ],
          "OCP\\User\\Events\\UserLiveStatusEvent",
          [
            "Symfony\\Component\\EventDispatcher\\EventDispatcher"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 73,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            [
              "Closure"
            ]
          ],
          "OCP\\User\\Events\\UserLiveStatusEvent",
          [
            "OCP\\User\\Events\\UserLiveStatusEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 94,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            "OCP\\User\\Events\\UserLiveStatusEvent"
          ],
          "OCP\\User\\Events\\UserLiveStatusEvent"
        ]
      },
      {
        "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 106,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          "OCP\\User\\Events\\UserLiveStatusEvent",
          [
            "OCP\\User\\Events\\UserLiveStatusEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/apps/user_status/lib/Controller/HeartbeatController.php",
        "line": 91,
        "function": "dispatchTyped",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            "OCP\\User\\Events\\UserLiveStatusEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "heartbeat",
        "class": "OCA\\UserStatus\\Controller\\HeartbeatController",
        "type": "->",
        "args": [
          "online"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\UserStatus\\Controller\\HeartbeatController"
          ],
          "heartbeat"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 183,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\UserStatus\\Controller\\HeartbeatController"
          ],
          "heartbeat"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\UserStatus\\Controller\\HeartbeatController",
          "heartbeat",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "ocs.user_status.Heartbeat.heartbeat"
          ]
        ]
      },
      {
        "file": "/var/www/html/ocs/v1.php",
        "line": 64,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/ocsapp/apps/user_status/api/v1/heartbeat"
        ]
      },
      {
        "file": "/var/www/html/ocs/v2.php",
        "line": 23,
        "args": [
          "/var/www/html/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/lib/private/DB/Exceptions/DbalException.php",
    "Line": 71,
    "Previous": {
      "Exception": "Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException",
      "Message": "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: oc_user_status.user_id",
      "Code": 19,
      "Trace": [
        {
          "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
          "line": 1814,
          "function": "convert",
          "class": "Doctrine\\DBAL\\Driver\\API\\SQLite\\ExceptionConverter",
          "type": "->",
          "args": [
            [
              "Doctrine\\DBAL\\Driver\\PDO\\Exception"
            ],
            [
              "Doctrine\\DBAL\\Query"
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
          "line": 1749,
          "function": "handleDriverException",
          "class": "Doctrine\\DBAL\\Connection",
          "type": "->",
          "args": [
            [
              "Doctrine\\DBAL\\Driver\\PDO\\Exception"
            ],
            [
              "Doctrine\\DBAL\\Query"
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
          "line": 1163,
          "function": "convertExceptionDuringQuery",
          "class": "Doctrine\\DBAL\\Connection",
          "type": "->",
          "args": [
            [
              "Doctrine\\DBAL\\Driver\\PDO\\Exception"
            ],
            "INSERT INTO \"oc_user_status\" (\"user_id\", \"status\", \"status_timestamp\", \"is_user_defined\") VALUES(?, ?, ?, ?)",
            [
              "<removed>",
              "online",
              1699041463,
              false
            ],
            [
              2,
              2,
              1,
              5
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/DB/Connection.php",
          "line": 295,
          "function": "executeStatement",
          "class": "Doctrine\\DBAL\\Connection",
          "type": "->",
          "args": [
            "INSERT INTO \"oc_user_status\" (\"user_id\", \"status\", \"status_timestamp\", \"is_user_defined\") VALUES(?, ?, ?, ?)",
            [
              "<removed>",
              "online",
              1699041463,
              false
            ],
            [
              2,
              2,
              1,
              5
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
          "line": 354,
          "function": "executeStatement",
          "class": "OC\\DB\\Connection",
          "type": "->",
          "args": [
            "INSERT INTO \"oc_user_status\" (\"user_id\", \"status\", \"status_timestamp\", \"is_user_defined\") VALUES(:dcValue1, :dcValue2, :dcValue3, :dcValue4)",
            [
              "<removed>",
              "online",
              1699041463,
              false
            ],
            [
              2,
              2,
              1,
              5
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
          "line": 280,
          "function": "execute",
          "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
          "type": "->",
          "args": []
        },
        {
          "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
          "line": 326,
          "function": "execute",
          "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
          "type": "->",
          "args": []
        },
        {
          "file": "/var/www/html/lib/public/AppFramework/Db/QBMapper.php",
          "line": 137,
          "function": "executeStatement",
          "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
          "type": "->",
          "args": []
        },
        {
          "file": "/var/www/html/apps/user_status/lib/Listener/UserLiveStatusListener.php",
          "line": 104,
          "function": "insert",
          "class": "OCP\\AppFramework\\Db\\QBMapper",
          "type": "->",
          "args": [
            [
              "OCA\\UserStatus\\Db\\UserStatus",
              null,
              "<removed>",
              "online",
              1699041463,
              false,
              null,
              null,
              null,
              null,
              null
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
          "line": 86,
          "function": "handle",
          "class": "OCA\\UserStatus\\Listener\\UserLiveStatusListener",
          "type": "->",
          "args": [
            [
              "OCP\\User\\Events\\UserLiveStatusEvent"
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 251,
          "function": "__invoke",
          "class": "OC\\EventDispatcher\\ServiceEventListener",
          "type": "->",
          "args": [
            [
              "OCP\\User\\Events\\UserLiveStatusEvent"
            ],
            "OCP\\User\\Events\\UserLiveStatusEvent",
            [
              "Symfony\\Component\\EventDispatcher\\EventDispatcher"
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 73,
          "function": "callListeners",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              [
                "Closure"
              ]
            ],
            "OCP\\User\\Events\\UserLiveStatusEvent",
            [
              "OCP\\User\\Events\\UserLiveStatusEvent"
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
          "line": 94,
          "function": "dispatch",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              "OCP\\User\\Events\\UserLiveStatusEvent"
            ],
            "OCP\\User\\Events\\UserLiveStatusEvent"
          ]
        },
        {
          "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
          "line": 106,
          "function": "dispatch",
          "class": "OC\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            "OCP\\User\\Events\\UserLiveStatusEvent",
            [
              "OCP\\User\\Events\\UserLiveStatusEvent"
            ]
          ]
        },
        {
          "file": "/var/www/html/apps/user_status/lib/Controller/HeartbeatController.php",
          "line": 91,
          "function": "dispatchTyped",
          "class": "OC\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              "OCP\\User\\Events\\UserLiveStatusEvent"
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 230,
          "function": "heartbeat",
          "class": "OCA\\UserStatus\\Controller\\HeartbeatController",
          "type": "->",
          "args": [
            "online"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 137,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            [
              "OCA\\UserStatus\\Controller\\HeartbeatController"
            ],
            "heartbeat"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/App.php",
          "line": 183,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            [
              "OCA\\UserStatus\\Controller\\HeartbeatController"
            ],
            "heartbeat"
          ]
        },
        {
          "file": "/var/www/html/lib/private/Route/Router.php",
          "line": 315,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::",
          "args": [
            "OCA\\UserStatus\\Controller\\HeartbeatController",
            "heartbeat",
            [
              "OC\\AppFramework\\DependencyInjection\\DIContainer"
            ],
            [
              "ocs.user_status.Heartbeat.heartbeat"
            ]
          ]
        },
        {
          "file": "/var/www/html/ocs/v1.php",
          "line": 64,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->",
          "args": [
            "/ocsapp/apps/user_status/api/v1/heartbeat"
          ]
        },
        {
          "file": "/var/www/html/ocs/v2.php",
          "line": 23,
          "args": [
            "/var/www/html/ocs/v1.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php",
      "Line": 44,
      "Previous": {
        "Exception": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
        "Message": "SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: oc_user_status.user_id",
        "Code": 19,
        "Trace": [
          {
            "file": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
            "line": 103,
            "function": "new",
            "class": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
            "type": "::",
            "args": [
              [
                "PDOException",
                [
                  "23000",
                  19,
                  "UNIQUE constraint failed: oc_user_status.user_id"
                ]
              ]
            ]
          },
          {
            "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
            "line": 1153,
            "function": "execute",
            "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/html/lib/private/DB/Connection.php",
            "line": 295,
            "function": "executeStatement",
            "class": "Doctrine\\DBAL\\Connection",
            "type": "->",
            "args": [
              "INSERT INTO \"oc_user_status\" (\"user_id\", \"status\", \"status_timestamp\", \"is_user_defined\") VALUES(?, ?, ?, ?)",
              [
                "<removed>",
                "online",
                1699041463,
                false
              ],
              [
                2,
                2,
                1,
                5
              ]
            ]
          },
          {
            "file": "/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
            "line": 354,
            "function": "executeStatement",
            "class": "OC\\DB\\Connection",
            "type": "->",
            "args": [
              "INSERT INTO \"oc_user_status\" (\"user_id\", \"status\", \"status_timestamp\", \"is_user_defined\") VALUES(:dcValue1, :dcValue2, :dcValue3, :dcValue4)",
              [
                "<removed>",
                "online",
                1699041463,
                false
              ],
              [
                2,
                2,
                1,
                5
              ]
            ]
          },
          {
            "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
            "line": 280,
            "function": "execute",
            "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
            "line": 326,
            "function": "execute",
            "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/html/lib/public/AppFramework/Db/QBMapper.php",
            "line": 137,
            "function": "executeStatement",
            "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/html/apps/user_status/lib/Listener/UserLiveStatusListener.php",
            "line": 104,
            "function": "insert",
            "class": "OCP\\AppFramework\\Db\\QBMapper",
            "type": "->",
            "args": [
              [
                "OCA\\UserStatus\\Db\\UserStatus",
                null,
                "<removed>",
                "online",
                1699041463,
                false,
                null,
                null,
                null,
                null,
                null
              ]
            ]
          },
          {
            "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
            "line": 86,
            "function": "handle",
            "class": "OCA\\UserStatus\\Listener\\UserLiveStatusListener",
            "type": "->",
            "args": [
              [
                "OCP\\User\\Events\\UserLiveStatusEvent"
              ]
            ]
          },
          {
            "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
            "line": 251,
            "function": "__invoke",
            "class": "OC\\EventDispatcher\\ServiceEventListener",
            "type": "->",
            "args": [
              [
                "OCP\\User\\Events\\UserLiveStatusEvent"
              ],
              "OCP\\User\\Events\\UserLiveStatusEvent",
              [
                "Symfony\\Component\\EventDispatcher\\EventDispatcher"
              ]
            ]
          },
          {
            "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
            "line": 73,
            "function": "callListeners",
            "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
            "type": "->",
            "args": [
              [
                [
                  "Closure"
                ]
              ],
              "OCP\\User\\Events\\UserLiveStatusEvent",
              [
                "OCP\\User\\Events\\UserLiveStatusEvent"
              ]
            ]
          },
          {
            "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
            "line": 94,
            "function": "dispatch",
            "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
            "type": "->",
            "args": [
              [
                "OCP\\User\\Events\\UserLiveStatusEvent"
              ],
              "OCP\\User\\Events\\UserLiveStatusEvent"
            ]
          },
          {
            "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
            "line": 106,
            "function": "dispatch",
            "class": "OC\\EventDispatcher\\EventDispatcher",
            "type": "->",
            "args": [
              "OCP\\User\\Events\\UserLiveStatusEvent",
              [
                "OCP\\User\\Events\\UserLiveStatusEvent"
              ]
            ]
          },
          {
            "file": "/var/www/html/apps/user_status/lib/Controller/HeartbeatController.php",
            "line": 91,
            "function": "dispatchTyped",
            "class": "OC\\EventDispatcher\\EventDispatcher",
            "type": "->",
            "args": [
              [
                "OCP\\User\\Events\\UserLiveStatusEvent"
              ]
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
            "line": 230,
            "function": "heartbeat",
            "class": "OCA\\UserStatus\\Controller\\HeartbeatController",
            "type": "->",
            "args": [
              "online"
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
            "line": 137,
            "function": "executeController",
            "class": "OC\\AppFramework\\Http\\Dispatcher",
            "type": "->",
            "args": [
              [
                "OCA\\UserStatus\\Controller\\HeartbeatController"
              ],
              "heartbeat"
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/App.php",
            "line": 183,
            "function": "dispatch",
            "class": "OC\\AppFramework\\Http\\Dispatcher",
            "type": "->",
            "args": [
              [
                "OCA\\UserStatus\\Controller\\HeartbeatController"
              ],
              "heartbeat"
            ]
          },
          {
            "file": "/var/www/html/lib/private/Route/Router.php",
            "line": 315,
            "function": "main",
            "class": "OC\\AppFramework\\App",
            "type": "::",
            "args": [
              "OCA\\UserStatus\\Controller\\HeartbeatController",
              "heartbeat",
              [
                "OC\\AppFramework\\DependencyInjection\\DIContainer"
              ],
              [
                "ocs.user_status.Heartbeat.heartbeat"
              ]
            ]
          },
          {
            "file": "/var/www/html/ocs/v1.php",
            "line": 64,
            "function": "match",
            "class": "OC\\Route\\Router",
            "type": "->",
            "args": [
              "/ocsapp/apps/user_status/api/v1/heartbeat"
            ]
          },
          {
            "file": "/var/www/html/ocs/v2.php",
            "line": 23,
            "args": [
              "/var/www/html/ocs/v1.php"
            ],
            "function": "require_once"
          }
        ],
        "File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
        "Line": 30,
        "Previous": {
          "Exception": "PDOException",
          "Message": "SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: oc_user_status.user_id",
          "Code": "23000",
          "Trace": [
            {
              "file": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
              "line": 101,
              "function": "execute",
              "class": "PDOStatement",
              "type": "->",
              "args": [
                null
              ]
            },
            {
              "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
              "line": 1153,
              "function": "execute",
              "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
              "type": "->",
              "args": []
            },
            {
              "file": "/var/www/html/lib/private/DB/Connection.php",
              "line": 295,
              "function": "executeStatement",
              "class": "Doctrine\\DBAL\\Connection",
              "type": "->",
              "args": [
                "INSERT INTO \"oc_user_status\" (\"user_id\", \"status\", \"status_timestamp\", \"is_user_defined\") VALUES(?, ?, ?, ?)",
                [
                  "<removed>",
                  "online",
                  1699041463,
                  false
                ],
                [
                  2,
                  2,
                  1,
                  5
                ]
              ]
            },
            {
              "file": "/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
              "line": 354,
              "function": "executeStatement",
              "class": "OC\\DB\\Connection",
              "type": "->",
              "args": [
                "INSERT INTO \"oc_user_status\" (\"user_id\", \"status\", \"status_timestamp\", \"is_user_defined\") VALUES(:dcValue1, :dcValue2, :dcValue3, :dcValue4)",
                [
                  "<removed>",
                  "online",
                  1699041463,
                  false
                ],
                [
                  2,
                  2,
                  1,
                  5
                ]
              ]
            },
            {
              "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
              "line": 280,
              "function": "execute",
              "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
              "type": "->",
              "args": []
            },
            {
              "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
              "line": 326,
              "function": "execute",
              "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
              "type": "->",
              "args": []
            },
            {
              "file": "/var/www/html/lib/public/AppFramework/Db/QBMapper.php",
              "line": 137,
              "function": "executeStatement",
              "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
              "type": "->",
              "args": []
            },
            {
              "file": "/var/www/html/apps/user_status/lib/Listener/UserLiveStatusListener.php",
              "line": 104,
              "function": "insert",
              "class": "OCP\\AppFramework\\Db\\QBMapper",
              "type": "->",
              "args": [
                [
                  "OCA\\UserStatus\\Db\\UserStatus",
                  null,
                  "<removed>",
                  "online",
                  1699041463,
                  false,
                  null,
                  null,
                  null,
                  null,
                  null
                ]
              ]
            },
            {
              "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
              "line": 86,
              "function": "handle",
              "class": "OCA\\UserStatus\\Listener\\UserLiveStatusListener",
              "type": "->",
              "args": [
                [
                  "OCP\\User\\Events\\UserLiveStatusEvent"
                ]
              ]
            },
            {
              "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
              "line": 251,
              "function": "__invoke",
              "class": "OC\\EventDispatcher\\ServiceEventListener",
              "type": "->",
              "args": [
                [
                  "OCP\\User\\Events\\UserLiveStatusEvent"
                ],
                "OCP\\User\\Events\\UserLiveStatusEvent",
                [
                  "Symfony\\Component\\EventDispatcher\\EventDispatcher"
                ]
              ]
            },
            {
              "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
              "line": 73,
              "function": "callListeners",
              "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
              "type": "->",
              "args": [
                [
                  [
                    "Closure"
                  ]
                ],
                "OCP\\User\\Events\\UserLiveStatusEvent",
                [
                  "OCP\\User\\Events\\UserLiveStatusEvent"
                ]
              ]
            },
            {
              "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
              "line": 94,
              "function": "dispatch",
              "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
              "type": "->",
              "args": [
                [
                  "OCP\\User\\Events\\UserLiveStatusEvent"
                ],
                "OCP\\User\\Events\\UserLiveStatusEvent"
              ]
            },
            {
              "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
              "line": 106,
              "function": "dispatch",
              "class": "OC\\EventDispatcher\\EventDispatcher",
              "type": "->",
              "args": [
                "OCP\\User\\Events\\UserLiveStatusEvent",
                [
                  "OCP\\User\\Events\\UserLiveStatusEvent"
                ]
              ]
            },
            {
              "file": "/var/www/html/apps/user_status/lib/Controller/HeartbeatController.php",
              "line": 91,
              "function": "dispatchTyped",
              "class": "OC\\EventDispatcher\\EventDispatcher",
              "type": "->",
              "args": [
                [
                  "OCP\\User\\Events\\UserLiveStatusEvent"
                ]
              ]
            },
            {
              "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
              "line": 230,
              "function": "heartbeat",
              "class": "OCA\\UserStatus\\Controller\\HeartbeatController",
              "type": "->",
              "args": [
                "online"
              ]
            },
            {
              "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
              "line": 137,
              "function": "executeController",
              "class": "OC\\AppFramework\\Http\\Dispatcher",
              "type": "->",
              "args": [
                [
                  "OCA\\UserStatus\\Controller\\HeartbeatController"
                ],
                "heartbeat"
              ]
            },
            {
              "file": "/var/www/html/lib/private/AppFramework/App.php",
              "line": 183,
              "function": "dispatch",
              "class": "OC\\AppFramework\\Http\\Dispatcher",
              "type": "->",
              "args": [
                [
                  "OCA\\UserStatus\\Controller\\HeartbeatController"
                ],
                "heartbeat"
              ]
            },
            {
              "file": "/var/www/html/lib/private/Route/Router.php",
              "line": 315,
              "function": "main",
              "class": "OC\\AppFramework\\App",
              "type": "::",
              "args": [
                "OCA\\UserStatus\\Controller\\HeartbeatController",
                "heartbeat",
                [
                  "OC\\AppFramework\\DependencyInjection\\DIContainer"
                ],
                [
                  "ocs.user_status.Heartbeat.heartbeat"
                ]
              ]
            },
            {
              "file": "/var/www/html/ocs/v1.php",
              "line": 64,
              "function": "match",
              "class": "OC\\Route\\Router",
              "type": "->",
              "args": [
                "/ocsapp/apps/user_status/api/v1/heartbeat"
              ]
            },
            {
              "file": "/var/www/html/ocs/v2.php",
              "line": 23,
              "args": [
                "/var/www/html/ocs/v1.php"
              ],
              "function": "require_once"
            }
          ],
          "File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
          "Line": 101
        }
      }
    },
    "CustomMessage": "--"
  },
  "id": "6547c5f843c5b"
}

Additional info

sqlite db, running on an ASUSTOR NAS (Linux 5.13.x x86_64), filesystem btrfs

@joshtrichards
Copy link
Member

Fixed in #42805

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: status
Projects
None yet
Development

No branches or pull requests

3 participants