question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate Key error on index

See original GitHub issue

Sorry… i have another one… looks like it has generated a duplicate key, which seems… rare!

It seemed to continually try to re insert the image, without re-calculating the key. I’m not sure if it continued to index or not, as there is not a lot of stout logging.

pigallery       |   name: 'QueryFailedError',
pigallery       |   query:
pigallery       |    'INSERT INTO `media_entity`(`id`, `name`, `type`, `directoryId`, `metadataCaption`, `metadataCreationdate`, `metadataFilesize`, `metadataKeywords`, `metadataOrientation`, `metadataBitrate`, `metadataDuration`, `metadataSizeWidth`, `metadataSizeHeight`, `metadataCameraDataIso`, `metadataCameraDataModel`, `metadataCameraDataMake`, `metadataCameraDataFstop`, `metadataCameraDataExposure`, `metadataCameraDataFocallength`, `metadataCameraDataLens`, `metadataPositionDataCountry`, `metadataPositionDataState`, `metadataPositionDataCity`, `metadataPositionDataGPSDataLatitude`, `metadataPositionDataGPSDataLongitude`, `metadataPositionDataGPSDataAltitude`) VALUES (DEFAULT, ?, ?, ?, DEFAULT, ?, ?, ?, ?, DEFAULT, DEFAULT, ?, ?, ?, ?, ?, ?, ?, ?, DEFAULT, DEFAULT, DEFAULT, DEFAULT, ?, ?, ?)',
pigallery       |   parameters:
pigallery       |    [ 'IMG_0995.jpg',
pigallery       |      'PhotoEntity',
pigallery       |      103,
pigallery       |      1323184378000,
pigallery       |      2198584,
pigallery       |      '',
pigallery       |      1,
pigallery       |      2592,
pigallery       |      1936,
pigallery       |      80,
pigallery       |      'iPhone 4',
pigallery       |      'Apple',
pigallery       |      2.8,
pigallery       |      0.058823529411764705,
pigallery       |      3.85,
pigallery       |      -32.04533333333333,
pigallery       |      115.81633333333333,
pigallery       |      31.19884726224784 ] }
pigallery       | { QueryFailedError: ER_DUP_ENTRY: Duplicate entry 'IMG_0995.jpg-103' for key 'IDX_332f316a46fcb158ac71210109'
pigallery       |     at new QueryFailedError (/pigallery2-release/node_modules/typeorm/error/QueryFailedError.js:11:28)
pigallery       |     at Query.<anonymous> (/pigallery2-release/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:167:45)
pigallery       |     at Query.<anonymous> (/pigallery2-release/node_modules/mysql/lib/Connection.js:502:10)
pigallery       |     at Query._callback (/pigallery2-release/node_modules/mysql/lib/Connection.js:468:16)
pigallery       |     at Query.Sequence.end (/pigallery2-release/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
pigallery       |     at Query.ErrorPacket (/pigallery2-release/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
pigallery       |     at Protocol._parsePacket (/pigallery2-release/node_modules/mysql/lib/protocol/Protocol.js:278:23)
pigallery       |     at Parser.write (/pigallery2-release/node_modules/mysql/lib/protocol/Parser.js:76:12)
pigallery       |     at Protocol.write (/pigallery2-release/node_modules/mysql/lib/protocol/Protocol.js:38:16)
pigallery       |     at Socket.<anonymous> (/pigallery2-release/node_modules/mysql/lib/Connection.js:91:28)
pigallery       |   message:
pigallery       |    'ER_DUP_ENTRY: Duplicate entry \'IMG_0995.jpg-103\' for key \'IDX_332f316a46fcb158ac71210109\'',
pigallery       |   code: 'ER_DUP_ENTRY',
pigallery       |   errno: 1062,
pigallery       |   sqlMessage:
pigallery       |    'Duplicate entry \'IMG_0995.jpg-103\' for key \'IDX_332f316a46fcb158ac71210109\'',
pigallery       |   sqlState: '23000',
pigallery       |   index: 0,
pigallery       |   sql:
pigallery       |    'INSERT INTO `media_entity`(`id`, `name`, `type`, `directoryId`, `metadataCaption`, `metadataCreationdate`, `metadataFilesize`, `metadataKeywords`, `metadataOrientation`, `metadataBitrate`, `metadataDuration`, `metadataSizeWidth`, `metadataSizeHeight`, `metadataCameraDataIso`, `metadataCameraDataModel`, `metadataCameraDataMake`, `metadataCameraDataFstop`, `metadataCameraDataExposure`, `metadataCameraDataFocallength`, `metadataCameraDataLens`, `metadataPositionDataCountry`, `metadataPositionDataState`, `metadataPositionDataCity`, `metadataPositionDataGPSDataLatitude`, `metadataPositionDataGPSDataLongitude`, `metadataPositionDataGPSDataAltitude`) VALUES (DEFAULT, \'IMG_0995.jpg\', \'PhotoEntity\', 103, DEFAULT, 1323184378000, 2198584, \'\', 1, DEFAULT, DEFAULT, 2592, 1936, 80, \'iPhone 4\', \'Apple\', 2.8, 0.058823529411764705, 3.85, DEFAULT, DEFAULT, DEFAULT, DEFAULT, -32.04533333333333, 115.81633333333333, 31.19884726224784)',

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
palitucommented, Feb 9, 2019

all indexed!

screenshot_20190208_181712

0reactions
bpatrikcommented, Feb 9, 2019

Perfect!

Read more comments on GitHub >

github_iconTop Results From Across the Web

E11000 duplicate key error collection - MongoDB
I have an index in collection “persons” which shall avoid inserting duplicate documents with the same person name.
Read more >
E11000 duplicate key error index in mongodb mongoose
Well basically this error is saying, that you had a unique index on a particular field for example: "email_address ...
Read more >
MongoError: E11000 duplicate key error collection
So, this is a case when the Mongo schema becomes out date with the Mongoose schema that you defined in code. To fix...
Read more >
Db2 11 - Messages - DSNU340I - IBM
Use the REPAIR utility with LOCATE RID and DUMP statements to view the records with duplicate keys. The inconsistent index can cause SQLSELECT...
Read more >
"Cannot insert duplicate key" error occurs when you update a ...
KB2962767 - FIX: "Cannot insert duplicate key" error occurs when you update a table by using a bitmap index that contains a partition...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found