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

Issues while trying to provision a device - ERROR: Database Error: mongocEntitiesUpsert #1643

Open
manfredipist opened this issue Jul 16, 2024 · 1 comment
Assignees
Labels

Comments

@manfredipist
Copy link

manfredipist commented Jul 16, 2024

Hi, i'm trying to provision a new device on orion-ld using the iotagent-opcua but i'm encountering this error during the process

msg=  Mongo Driver:              mongoc driver- ONLY (MongoDB C++ Legacy Driver is DISABLED)
time=Tuesday 16 Jul 15:35:29 2024.686Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionld.cpp[1376]:main | msg=  MongoC Driver Version:     1.24.2
time=Tuesday 16 Jul 15:35:34 2024.493Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 001: POST /ngsi-ld/v1/csourceRegistrations/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.211Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 002: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.211Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 003: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.211Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 004: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.212Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 005: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.213Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 006: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.214Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 007: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.217Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 008: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.217Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 009: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.218Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 010: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.218Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 011: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.219Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 012: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.219Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 013: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.220Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 014: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.220Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 015: POST /ngsi-ld/v1/entityOperations/upsert/ --------------------------
time=Tuesday 16 Jul 15:35:36 2024.229Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.229Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.229Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.229Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.229Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.229Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.229Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.230Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.230Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.230Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.230Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.230Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.231Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.232Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.299Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.299Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.301Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.301Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.302Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.302Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.307Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.307Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.308Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.308Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:36 2024.310Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocEntitiesUpsert.cpp[115]: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" }, "errmsg" : "E11000 duplicate key error collection: orion-opcua_car.entities index: _id_ dup key: { _id: { id: \"urn:ngsi-ld:Device:age01_Car\", type: \"https://uri.etsi.org/ngsi-ld/default-context/Device\", servicePath: \"/\" } }", "keyPattern" : { "_id" : { "$numberInt" : "1" } }, "keyValue" : { "_id" : { "id" : "urn:ngsi-ld:Device:age01_Car", "type" : "https://uri.etsi.org/ngsi-ld/default-context/Device", "servicePath" : "/" } } } ] }
time=Tuesday 16 Jul 15:35:36 2024.310Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionldPostBatchUpsert.cpp[321]:orionldPostBatchUpsert | msg=***** ERROR: Database Error: mongocEntitiesUpsert failed (status: 500)
time=Tuesday 16 Jul 15:35:43 2024.690Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=rest.cpp[1361]:connectionTreat | msg=------------------------- Servicing NGSIv2 request 016: GET /version --------------------------
time=Tuesday 16 Jul 15:35:43 2024.690Z | lvl=WARN | corr=106c6c90-4389-11ef-ba6b-0242c0a80005 | trans=1721144128-208-00000000001 | from=192.168.0.7 | srv=pending | subsrv=<default> | comp=Orion | op=rest.cpp[1536]:connectionTreat | msg=orionldState.in.contentType: None
time=Tuesday 16 Jul 15:35:43 2024.722Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 017: POST /ngsi-ld/v1/subscriptions/ --------------------------
time=Tuesday 16 Jul 15:36:45 2024.099Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 018: GET /ngsi-ld/v1/subscriptions --------------------------
time=Tuesday 16 Jul 15:37:10 2024.388Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 019: GET /ngsi-ld/v1/entities --------------------------
time=Tuesday 16 Jul 15:37:15 2024.480Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1121]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 020: GET /ngsi-ld/v1/entities --------------------------

Here's the docker-compose that i'm using

services:
  iot-agent:
    image: iotagent4fiware/iotagent-opcua:latest
    hostname: iotagent-opcua
    depends_on:
      - mongodb
      - orion
    networks:
      - hostnet
    ports:
      - "4041:4041"
      - "9229:9229"
    environment:
      # Environment variables as before
      - "CONFIGURATION_TYPE=auto"
      - "CONFIG_RETRIEVAL=false"
      - "DEFAULT_KEY=iot"
      - "DEFAULT_TRANSPORT=OPCUA"
      - "IOTA_LOGLEVEL=DEBUG"
      - "IOTA_TIMESTAMP=true"
      - "IOTA_CB_HOST=orion"
      - "IOTA_CB_PORT=1026"
      - "IOTA_CB_NGSIVERSION=ld"
      - "IOTA_CB_NGSILDCONTEXT=https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
      - "IOTA_CB_SERVICE=opcua_car"
      - "IOTA_CB_SUBSERVICE=/demo"
      - "IOTA_NORTH_PORT=4041"
      - "IOTA_REGISTRY_TYPE=mongodb"
      - "IOTA_MONGO_HOST=mongodb"
      - "IOTA_MONGO_PORT=27017"
      - "IOTA_MONGO_DB=iotagent_opcua"
      - "IOTA_SERVICE=opcua_car"
      - "IOTA_SUBSERVICE=/demo"
      - "IOTA_PROVIDER_URL=http://iotagent-opcua:4041"
      - "IOTA_DEVICEREGDURATION=P20Y"
      - "IOTA_DEFAULTTYPE=Device"
      - "IOTA_DEFAULTRESOURCE=/iot/opcua"
      - "IOTA_EXPLICITATTRS=true"
      - "IOTA_EXTENDED_FORBIDDEN_CHARACTERS=[]"
      - "IOTA_AUTOPROVISION=true"
      - "IOTA_OPCUA_ENDPOINT=opc.tcp://iotcarsrv:5001/UA/CarServer"
      - "IOTA_OPCUA_SECURITY_MODE=None"
      - "IOTA_OPCUA_SECURITY_POLICY=None"
      - "IOTA_OPCUA_UNIQUE_SUBSCRIPTION=false"
      - "IOTA_OPCUA_SUBSCRIPTION_NOTIFICATIONS_PER_PUBLISH=1000"
      - "IOTA_OPCUA_SUBSCRIPTION_PUBLISHING_ENABLED=true"
      - "IOTA_OPCUA_SUBSCRIPTION_REQ_LIFETIME_COUNT=100"
      - "IOTA_OPCUA_SUBSCRIPTION_REQ_MAX_KEEP_ALIVE_COUNT=10"
      - "IOTA_OPCUA_SUBSCRIPTION_REQ_PUBLISHING_INTERVAL=1000"
      - "IOTA_OPCUA_SUBSCRIPTION_PRIORITY=128"
      - "IOTA_OPCUA_MT_POLLING=false"
      - "IOTA_OPCUA_MT_AGENT_ID=age01_"
      - "IOTA_OPCUA_MT_ENTITY_ID=age01_Car"
      - "IOTA_OPCUA_MT_ENTITY_TYPE=Device"
      - "IOTA_OPCUA_MT_NAMESPACE_IGNORE=0,7"
      - "IOTA_OPCUA_MT_STORE_OUTPUT=true"
    volumes:
      - ./conf/iotagent-opcua:/opt/iotagent-opcua/conf

  mongodb:
    image: mongo:latest
    hostname: mongodb
    networks:
      - hostnet
    ports:
      - "27017:27017"
    command: --bind_ip_all 
    volumes:
      - mongodb:/data

  orion:
    image: fiware/orion-ld:1.6.0
    hostname: orion
    depends_on:
      - mongodb
    networks:
      - hostnet
    ports:
      - "1026:1026"
    command: -dbhost mongodb -logLevel DEBUG -mongocOnly # -forwarding -experimental

  iotcarsrv:
    image: iotagent4fiware/opcuacarsrv:latest
    hostname: iotcarsrv
    networks:
      - hostnet
    ports:
      - "5001:5001"

volumes:
  mongodb: ~

networks:
  hostnet:

Do you know why is it happening? Thanks for the help!

@kzangeli
Copy link
Collaborator

ok, this is a known problem, due to buffering before sending the data to the broker.
I solved it for the default options (not using -mongocOnly nor -experimental).
I still haven't fixed it for the implementation for the new mongoc driver.

The problem is that more than one instance of the very same entity is part of the batch.
The fix, as I said is known but quite complex.

I won't be able to implement the fix before my upcoming vacations (until August 9), so, if you're in a hurry, try to avoid to send entity batches with more than one instance of the same entity.

@kzangeli kzangeli self-assigned this Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants