Skip to content

[NGSILD] fix ENTITY_GENERIC_ERROR when context broker respond with status code… (201 code) - #1617

Merged
fgalan merged 2 commits into
telefonicaid:masterfrom
aquarta:master
Jun 3, 2024
Merged

[NGSILD] fix ENTITY_GENERIC_ERROR when context broker respond with status code… (201 code)#1617
fgalan merged 2 commits into
telefonicaid:masterfrom
aquarta:master

Conversation

@aquarta

@aquarta aquarta commented May 31, 2024

Copy link
Copy Markdown
Contributor

… in update operation

with orion ld 1.5.1 during the transmission of the first measure operation the context broker respond with 201 status code.
The log reports

time=2024-05-30T16:55:53.988Z | lvl=DEBUG | corr=01307aed-e06c-4a1f-84b5-2719df05fde3 | trans=01307aed-e06c-4a1f-84b5-2719df05fde3 | op=IoTAgentNGSI.Request | from=n/a | srv=openiot | subsrv=/ | msg=Options: {
    "url": "http://orion:1026/ngsi-ld/v1/entityOperations/upsert/?options=update",
    "method": "POST",
    "headers": {
        "fiware-service": "openiot",
        "fiware-servicepath": "/",
        "Content-Type": "application/ld+json",
        "NGSILD-Tenant": "openiot",
        "NGSILD-Path": "/"
    },
    "json": [
        {
            "@context": "http://context/datamodels.context.jsonld",
            "id": "urn:ngsi-ld:HeightSensor:hsensor31061690_a",
            "type": "HeightSensor",
            "height": {
                "type": "Property",
                "value": 7,
                "observedAt": "2024-05-30T16:55:53.984Z"
            }
        }
    ]
} | comp=IoTAgent
time=2024-05-30T16:55:54.000Z | lvl=DEBUG | corr=01307aed-e06c-4a1f-84b5-2719df05fde3 | trans=01307aed-e06c-4a1f-84b5-2719df05fde3 | op=IoTAgentNGSI.Request | from=n/a | srv=openiot | subsrv=/ | msg=Response [
    "urn:ngsi-ld:HeightSensor:hsensor31061690_a"
] | comp=IoTAgent
time=2024-05-30T16:55:54.000Z | lvl=DEBUG | corr=01307aed-e06c-4a1f-84b5-2719df05fde3 | trans=01307aed-e06c-4a1f-84b5-2719df05fde3 | op=IoTAgentNGSI-LD | from=n/a | srv=openiot | subsrv=/ | msg=Unknown error executing update operation | comp=IoTAgent
time=2024-05-30T16:55:54.001Z | lvl=ERROR | corr=01307aed-e06c-4a1f-84b5-2719df05fde3 | trans=01307aed-e06c-4a1f-84b5-2719df05fde3 | op=IOTAUL.HTTP.Binding | from=n/a | srv=openiot | subsrv=/ | msg=MEASURES-002: Couldn't send the updated values to the Context Broker due to an error: {"name":"ENTITY_GENERIC_ERROR","message":"Error accesing entity data for device: urn:ngsi-ld:HeightSensor:hsensor31061690_a of type: HeightSensor and {\"timestamp\":true,\"defaultResource\":\"/iot/d\",\"explicitAttrs\":true,\"multiCore\":false,\"relaxTemplateValidation\":false,\"defaultEntityNameConjunction\":\":\",\"defaultType\":\"Thing\",\"lazy\":[],\"commands\":[],\"staticAttributes\":[{\"name\":\"category\",\"type\":\"Property\",\"value\":\"sensor\"},{\"name\":\"supportedProtocol\",\"type\":\"Property\",\"value\":\"ul20\"}],\"_id\":\"6658af9976ff3b1fc9d81d1d\",\"creationDate\":\"2024-05-30T16:55:53.973Z\",\"id\":\"hsensor31061690_a\",\"type\":\"HeightSensor\",\"name\":\"urn:ngsi-ld:HeightSensor:hsensor31061690_a\",\"service\":\"openiot\",\"subservice\":\"/\",\"apikey\":\"dummykeyasdasd\",\"__v\":0,\"active\":[{\"object_id\":\"h\",\"name\":\"height\",\"type\":\"Property\"},{\"object_id\":\"b\",\"name\":\"batteryLevel\",\"type\":\"Property\"},{\"object_id\":\"gps\",\"name\":\"location\",\"type\":\"geo:point\"}],\"subscriptions\":[]}","details":["urn:ngsi-ld:HeightSensor:hsensor31061690_a"],"code":201} | comp=IoTAgent

I think this would fix FIWARE/tutorials.IoT-Agent#23

… in update operation

with orion ld 1.5.1 during the transmission of the first measure operation the context broker respond with 201 status code
@AlvaroVega AlvaroVega changed the title fix ENTITY_GENERIC_ERROR when context broker respond with status code… [NGSILD] fix ENTITY_GENERIC_ERROR when context broker respond with status code… (201 code) May 31, 2024
@AlvaroVega

AlvaroVega commented May 31, 2024

Copy link
Copy Markdown
Member

An update operation in CB could response with a 201 ?
is this just for ngsi-ld ?

@fgalan

fgalan commented May 31, 2024

Copy link
Copy Markdown
Member

Maybe the author of the NGSI-LD contributio (@jason-fox ) could have a look and provide feedback on this.

@aquarta

aquarta commented May 31, 2024

Copy link
Copy Markdown
Contributor Author

And update operation in CB could response with a 201 ?

I think yes, if is the first measure, since in this case the entity is created in context broker

is this just for ngsi-ld ?

I don't know, I've experimented that only for ngsi-ld with orion-ld, I didn't tried other context brokers for that.

@jason-fox

Copy link
Copy Markdown
Contributor

Yes any 2xx Status codes are legitimate here in NGSI-LD. LGTM 👍

@fgalan

fgalan commented May 31, 2024

Copy link
Copy Markdown
Member

Yes any 2xx Status codes are legitimate here in NGSI-LD. LGTM 👍

Great!

@aquarta please add a line in the CHANGES_NEXT_RELEASE file briefly describing the fix and this PR will me merged.

@aquarta

aquarta commented Jun 2, 2024

Copy link
Copy Markdown
Contributor Author

Done

@fgalan fgalan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fgalan
fgalan merged commit f161af2 into telefonicaid:master Jun 3, 2024
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

Successfully merging this pull request may close these issues.

"Error accesing entity data for device: motion001' of type: Thing"

5 participants