Skip to content

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '165359' for key 'PRIMARY' #438

@illnesse

Description

@illnesse

Recognize started working again randomly after hours of #433 , i haven't even touched anything.
Log is full of these now:

{
   "reqId":"fNHzLxcgRigWWdl22F7S",
   "level":3,
   "time":"2022-10-29T10:40:26+00:00",
   "remoteAddr":"",
   "user":"--",
   "app":"recognize",
   "method":"",
   "url":"--",
   "message":"Could not store face detection in database",
   "userAgent":"--",
   "version":"25.0.1.0",
   "exception":{
      "Exception":"OC\\DB\\Exceptions\\DbalException",
      "Message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '165359' for key 'PRIMARY'",
      "Code":1062,
      "Trace":[
         {
            "file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
            "line":329,
            "function":"wrap",
            "class":"OC\\DB\\Exceptions\\DbalException",
            "type":"::"
         },
         {
            "file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
            "line":139,
            "function":"executeStatement",
            "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/recognize/lib/Classifiers/Images/ClusteringFaceClassifier.php",
            "line":100,
            "function":"insert",
            "class":"OCP\\AppFramework\\Db\\QBMapper",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyFacesJob.php",
            "line":35,
            "function":"classify",
            "class":"OCA\\Recognize\\Classifiers\\Images\\ClusteringFaceClassifier",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifierJob.php",
            "line":64,
            "function":"classify",
            "class":"OCA\\Recognize\\BackgroundJobs\\ClassifyFacesJob",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyFacesJob.php",
            "line":31,
            "function":"runClassifier",
            "class":"OCA\\Recognize\\BackgroundJobs\\ClassifierJob",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
            "line":78,
            "function":"run",
            "class":"OCA\\Recognize\\BackgroundJobs\\ClassifyFacesJob",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
            "line":103,
            "function":"start",
            "class":"OCP\\BackgroundJob\\Job",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
            "line":93,
            "function":"start",
            "class":"OCP\\BackgroundJob\\TimedJob",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/cron.php",
            "line":152,
            "function":"execute",
            "class":"OCP\\BackgroundJob\\TimedJob",
            "type":"->"
         }
      ],
      "File":"/var/www/nextcloud/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: 1062 Duplicate entry '165359' for key 'PRIMARY'",
         "Code":1062,
         "Trace":[
            {
               "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
               "line":1780,
               "function":"convert",
               "class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
               "line":1719,
               "function":"handleDriverException",
               "class":"Doctrine\\DBAL\\Connection",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
               "line":1173,
               "function":"convertExceptionDuringQuery",
               "class":"Doctrine\\DBAL\\Connection",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/DB/Connection.php",
               "line":294,
               "function":"executeStatement",
               "class":"Doctrine\\DBAL\\Connection",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
               "line":354,
               "function":"executeStatement",
               "class":"OC\\DB\\Connection",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
               "line":281,
               "function":"execute",
               "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
               "line":327,
               "function":"execute",
               "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
               "line":139,
               "function":"executeStatement",
               "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/apps/recognize/lib/Classifiers/Images/ClusteringFaceClassifier.php",
               "line":100,
               "function":"insert",
               "class":"OCP\\AppFramework\\Db\\QBMapper",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyFacesJob.php",
               "line":35,
               "function":"classify",
               "class":"OCA\\Recognize\\Classifiers\\Images\\ClusteringFaceClassifier",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifierJob.php",
               "line":64,
               "function":"classify",
               "class":"OCA\\Recognize\\BackgroundJobs\\ClassifyFacesJob",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyFacesJob.php",
               "line":31,
               "function":"runClassifier",
               "class":"OCA\\Recognize\\BackgroundJobs\\ClassifierJob",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
               "line":78,
               "function":"run",
               "class":"OCA\\Recognize\\BackgroundJobs\\ClassifyFacesJob",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
               "line":103,
               "function":"start",
               "class":"OCP\\BackgroundJob\\Job",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
               "line":93,
               "function":"start",
               "class":"OCP\\BackgroundJob\\TimedJob",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/cron.php",
               "line":152,
               "function":"execute",
               "class":"OCP\\BackgroundJob\\TimedJob",
               "type":"->"
            }
         ],
         "File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php",
         "Line":60,
         "Previous":{
            "Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception",
            "Message":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '165359' for key 'PRIMARY'",
            "Code":1062,
            "Trace":[
               {
                  "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                  "line":94,
                  "function":"new",
                  "class":"Doctrine\\DBAL\\Driver\\PDO\\Exception",
                  "type":"::"
               },
               {
                  "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                  "line":1163,
                  "function":"execute",
                  "class":"Doctrine\\DBAL\\Driver\\PDO\\Statement",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/lib/private/DB/Connection.php",
                  "line":294,
                  "function":"executeStatement",
                  "class":"Doctrine\\DBAL\\Connection",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                  "line":354,
                  "function":"executeStatement",
                  "class":"OC\\DB\\Connection",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                  "line":281,
                  "function":"execute",
                  "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                  "line":327,
                  "function":"execute",
                  "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
                  "line":139,
                  "function":"executeStatement",
                  "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/apps/recognize/lib/Classifiers/Images/ClusteringFaceClassifier.php",
                  "line":100,
                  "function":"insert",
                  "class":"OCP\\AppFramework\\Db\\QBMapper",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyFacesJob.php",
                  "line":35,
                  "function":"classify",
                  "class":"OCA\\Recognize\\Classifiers\\Images\\ClusteringFaceClassifier",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifierJob.php",
                  "line":64,
                  "function":"classify",
                  "class":"OCA\\Recognize\\BackgroundJobs\\ClassifyFacesJob",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyFacesJob.php",
                  "line":31,
                  "function":"runClassifier",
                  "class":"OCA\\Recognize\\BackgroundJobs\\ClassifierJob",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
                  "line":78,
                  "function":"run",
                  "class":"OCA\\Recognize\\BackgroundJobs\\ClassifyFacesJob",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                  "line":103,
                  "function":"start",
                  "class":"OCP\\BackgroundJob\\Job",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                  "line":93,
                  "function":"start",
                  "class":"OCP\\BackgroundJob\\TimedJob",
                  "type":"->"
               },
               {
                  "file":"/var/www/nextcloud/cron.php",
                  "line":152,
                  "function":"execute",
                  "class":"OCP\\BackgroundJob\\TimedJob",
                  "type":"->"
               }
            ],
            "File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
            "Line":26,
            "Previous":{
               "Exception":"PDOException",
               "Message":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '165359' for key 'PRIMARY'",
               "Code":"23000",
               "Trace":[
                  {
                     "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                     "line":92,
                     "function":"execute",
                     "class":"PDOStatement",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                     "line":1163,
                     "function":"execute",
                     "class":"Doctrine\\DBAL\\Driver\\PDO\\Statement",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/lib/private/DB/Connection.php",
                     "line":294,
                     "function":"executeStatement",
                     "class":"Doctrine\\DBAL\\Connection",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                     "line":354,
                     "function":"executeStatement",
                     "class":"OC\\DB\\Connection",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                     "line":281,
                     "function":"execute",
                     "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                     "line":327,
                     "function":"execute",
                     "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
                     "line":139,
                     "function":"executeStatement",
                     "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/apps/recognize/lib/Classifiers/Images/ClusteringFaceClassifier.php",
                     "line":100,
                     "function":"insert",
                     "class":"OCP\\AppFramework\\Db\\QBMapper",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyFacesJob.php",
                     "line":35,
                     "function":"classify",
                     "class":"OCA\\Recognize\\Classifiers\\Images\\ClusteringFaceClassifier",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifierJob.php",
                     "line":64,
                     "function":"classify",
                     "class":"OCA\\Recognize\\BackgroundJobs\\ClassifyFacesJob",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyFacesJob.php",
                     "line":31,
                     "function":"runClassifier",
                     "class":"OCA\\Recognize\\BackgroundJobs\\ClassifierJob",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
                     "line":78,
                     "function":"run",
                     "class":"OCA\\Recognize\\BackgroundJobs\\ClassifyFacesJob",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                     "line":103,
                     "function":"start",
                     "class":"OCP\\BackgroundJob\\Job",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                     "line":93,
                     "function":"start",
                     "class":"OCP\\BackgroundJob\\TimedJob",
                     "type":"->"
                  },
                  {
                     "file":"/var/www/nextcloud/cron.php",
                     "line":152,
                     "function":"execute",
                     "class":"OCP\\BackgroundJob\\TimedJob",
                     "type":"->"
                  }
               ],
               "File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
               "Line":92
            }
         }
      },
      "message":"Could not store face detection in database",
      "exception":{
         
      },
      "CustomMessage":"Could not store face detection in database"
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions