-
Notifications
You must be signed in to change notification settings - Fork 265
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
MongoCommonUpdate.cpp[236]: Runtime Error (unknown metadata value type in DB: 4) #4434
Comments
We would need some additional information. First one is the way you run ContextBroker:
|
We use docker-compose:
|
Please, change this line:
to
and repeat your tests to raise the trace again. The After the redeployment, repeat your tests to raise the trace again. You will find a corr= field along with the "Runtime error". Gather all the traces messages with the same corr= and post them as comment in this issue, please. (More info about the log format here: https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/admin/logs.md) |
Thanks for the explanation!
If I understand correctly, the entity Here is the entity as displayed in mongo-express. Is the metadata type
|
Useful curl command based on this (adjust curl localhost:1026/v2/entities/urn:ngsi-ld:roomCenter:temperatureSensor:05/attrs?type=temperatureSensor -X PATCH -s -S -H 'Content-Type: application/json' -H 'fiware-service: hil2' -H 'fiware-servicepath: /HiL2' -d @- <<EOF
{
"temperature": {
"type": "Number",
"value": -0.25,
"metadata": {
"Xij": {
"type": "Array",
"value": [
0.0173,
0.000289,
0,
0.05774,
0,
0,
0.00289,
0,
0
]
},
"TimeInstant": {
"type": "DateTime",
"value": "2023-10-05T14:57:41.074Z"
}
}
},
"unit": {
"type": "Text",
"value": "°C",
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-10-05T14:57:41.074Z"
}
}
},
"brick:hasPoint": {
"type": "Relationship",
"value": "urn:ngsi-ld:roomCenter:temperatureSensors:01",
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-10-05T14:57:41.074Z"
}
}
},
"Name": {
"type": "Text",
"value": "Temperature Room Center Climate Chamber",
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-10-05T14:57:41.074Z"
}
}
},
"TimeInstant": {
"type": "DateTime",
"value": "2023-10-05T14:57:41.074Z"
}
}
EOF |
I have had a look into this issue. In the equalMetadataValues() function we have this:
It seems that although object or array values are supported (i.e. they can be stored and retrieved in ContextBroker entities) the comparison logic used in equalMetadataValues() doesn't take them into account. Thus, the program flow ends in the Note that in attrValueChanges() we have a similar logic (this time for attribute values instead of metadata values):
In this case, we have a case for arrays and object, so we don't get the Runtime Error (although the lack of support is similar). In some sense, this problem is another "view" of issue #4211 and the solution would be similar: a deep-compare JSON mechanism. |
Thanks for debugging this! Is the function |
I would say that it is used only in the subscription triggering logic so when getting entity via HTTP it is not invoked. Anyway, it is easy to check: just get the entity via HTTP and check if you get the Runtime Error in the logs or not. |
Look for this in the code:
|
Related issue #643 (probably, a duplicate) |
PR #4444 |
A fix for this problem has been provided (in master branch by the time being). The version of Orion available in @FWuellhorst it would be great if you could test with that version an provide feedback (either if the issue is solver or not), please. Thanks! |
Thanks for the quick fix! We tested it and it works, thanks! |
@FWuellhorst thank you for the feedback! Based in your positive report, this issue will be closed. |
Bug description
With the latest orion, we get an error during runtime:
Enabling debug level does not print any useful hint on what the error is. As we don't know what causes the error, we can't provide information to reproduce it. A solution would be to hint the user to the metadata which causes this error.
Additionally, portainer indicates that the container is unhealthy and requests take multiple seconds.
The text was updated successfully, but these errors were encountered: