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

Massive /entityOperations/upsert results in E11000 duplicate key error on second run #1269

Closed
jason-fox opened this issue Nov 16, 2022 · 0 comments

Comments

@jason-fox
Copy link
Member

curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/entityOperations/upsert' 

... etc.

Works fine. But running this a second time

curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/entityOperations/upsert' 

... etc.

And I get:

{
    "type": "https://uri.etsi.org/ngsi-ld/errors/InternalError",
    "title": "Database Error",
    "detail": "mongocEntitiesUpsert failed"
}

Error log is:

op=mongocEntitiesUpsert.cpp[116]:mongocEntitiesUpsert | msg=mongoc_bulk_operation_execute: { "nInserted" : { "$numberInt" : "0" }, "nMatched" : { "$numberInt" : "0" }, "nModified" : { "$numberInt" : "0" }, "nRemoved" : { "$numberInt" : "0" }, "nUpserted" : { "$numberInt" : "0" }, "writeErrors" : [ { "index" : { "$numberInt" : "0" }, "code" : { "$numberInt" : "11000" }, "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:RAMI40:I4SubmodelProperty:urn:murrelektronik.com:asset:1.0:0:700421-400021-6340500-01:Nameplate:ManufacturerName", "type" : "https://uri.etsi.org/ngsi-ld/default-context/I4SubmodelProperty", "servicePath" : "/" } }, "errmsg" : "E11000 duplicate key error collection: orion.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:RAMI40:I4SubmodelProperty:urn:murrelektronik.com:asset:1.0:0:700421-400021-6340500-01:Nameplate:ManufacturerName\", type: \"https://uri.etsi.org/ngsi-ld/default-context/I4SubmodelProperty\", servicePath: \"/\" } }" } ] }
time=Friday 11 Nov 16:10:27 2022.447Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldError.cpp[65]:orionldError | msg=***** ERROR Database Error: mongocEntitiesUpsert failed (status code: 500)
time=Friday 11 Nov 16:10:30 2022.387Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[116]:mongocEntitiesUpsert | msg=mongoc_bulk_operation_execute: { "nInserted" : { "$numberInt" : "0" }, "nMatched" : { "$numberInt" : "0" }, "nModified" : { "$numberInt" : "0" }, "nRemoved" : { "$numberInt" : "0" }, "nUpserted" : { "$numberInt" : "0" }, "writeErrors" : [ { "index" : { "$numberInt" : "0" }, "code" : { "$numberInt" : "11000" }, "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:RAMI40:I4SubmodelProperty:urn:murrelektronik.com:asset:1.0:0:700421-400021-6340500-01:Nameplate:ManufacturerName", "type" : "https://uri.etsi.org/ngsi-ld/default-context/I4SubmodelProperty", "servicePath" : "/" } }, "errmsg" : "E11000 duplicate key error collection: orion.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:RAMI40:I4SubmodelProperty:urn:murrelektronik.com:asset:1.0:0:700421-400021-6340500-01:Nameplate:ManufacturerName\", type: \"https://uri.etsi.org/ngsi-ld/default-context/I4SubmodelProperty\", servicePath: \"/\" } }" } ] }
time=Friday 11 Nov 16:10:30 2022.387Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldError.cpp[65]:orionldError | msg=***** ERROR Database Error: mongocEntitiesUpsert failed (status code: 500)

The full statement can be found in the text attached:

massive.txt

@kzangeli kzangeli mentioned this issue Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant