Details
-
Type:
Monitor
-
Status: Closed
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
Description
Created question in FIWARE Q/A platform on 19-06-2022 at 10:06
Please, ANSWER this question AT https://stackoverflow.com/questions/72676076/error-in-updating-entities-with-perseo-in-fiware
Question:
error in updating entities with Perseo in Fiware
Description:
I am using Perseo, trying to define a rule that update an entity's attribute by using this post request to Perseo :
*
curl -iX POST \
"http://localhost:9090/rules" \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"name": "temperature_rule2",
"text": "select *,\"temperature_rule2\" as ruleName, temperature? as temperature from iotEvent where cast(cast(temperature?, String), double)>22",
"action": {
"type": "update",
"parameters": {
"attributes": [
{
"name":"event",
"type":"Text",
"value":"event test"
}
]
}
}
}'*
But when I change the temperature using this POST request to IoT agent :
*
curl -iX POST \
'http://localhost:7896/iot/json?i=temp001&k=1068318794' \
-H 'Content-Type: application/json' \
-d '
'
the rule got fired based on the logs in Perseo container :
time=2022-06-19T08:49:08.612Z | lvl=DEBUG | corr=n/a | trans=n/a | op=n/a | msg=inserting in queue action {"type":"update","parameters":{"version":2,"attributes":[
]},"index":0}
time=2022-06-19T08:49:08.612Z | lvl=DEBUG | corr=ae8c8884-efac-11ec-9e52-0242ac12000c; cbnotif=1; node=G1RqnXD-NG; perseocep=4 | trans=0c53aaae-fb87-427d-9f38-6b113cc8773b | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=openiot | subsrv=/ | msg=executing axn task {"action":{"type":"update","parameters":{"version":2,"attributes":[
]},"index":0},"event":{"service":"openiot","temperature":"10","ruleName":"temperature_rule1","id":"urn:ngsi-ld:Temp:001","type":"Temp","subservice":"/","fiwarePerseoContext":{"path":"/actions/do","op":"/actions/do","comp":"perseo-fe","trans":"0c53aaae-fb87-427d-9f38-6b113cc8773b","corr":"ae8c8884-efac-11ec-9e52-0242ac12000c; cbnotif=1; node=G1RqnXD-NG; perseocep=4","srv":"openiot","subsrv":"/"}},"context":{"path":"/actions/do","op":"/actions/do","comp":"perseo-fe","trans":"0c53aaae-fb87-427d-9f38-6b113cc8773b","corr":"ae8c8884-efac-11ec-9e52-0242ac12000c; cbnotif=1; node=G1RqnXD-NG; perseocep=4","srv":"openiot","subsrv":"/"}}
time=2022-06-19T08:49:08.622Z | lvl=DEBUG | corr=ae8c8884-efac-11ec-9e52-0242ac12000c; cbnotif=1; node=G1RqnXD-NG; perseocep=4 | trans=0c53aaae-fb87-427d-9f38-6b113cc8773b | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=openiot | subsrv=/ | msg=action: {"type":"update","parameters":{"version":2,"attributes":[
]},"index":0,"interval":0}, event: {"service":"openiot","temperature":"10","ruleName":"temperature_rule1","id":"urn:ngsi-ld:Temp:001","type":"Temp","subservice":"/","fiwarePerseoContext":{"path":"/actions/do","op":"/actions/do","comp":"perseo-fe","trans":"0c53aaae-fb87-427d-9f38-6b113cc8773b","corr":"ae8c8884-efac-11ec-9e52-0242ac12000c; cbnotif=1; node=G1RqnXD-NG; perseocep=4","srv":"openiot","subsrv":"/"}}
time=2022-06-19T08:49:08.623Z | lvl=DEBUG | corr=ae8c8884-efac-11ec-9e52-0242ac12000c; cbnotif=1; node=G1RqnXD-NG; perseocep=4 | trans=0c53aaae-fb87-427d-9f38-6b113cc8773b | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=openiot | subsrv=/ | msg=entity to update: {"actionType":"append","entities":[{"event":
,"id":"urn:ngsi-ld:Temp:001","type":"Temp"}]}*
but entity won't update and this error shows in the logs :
*time=2022-06-19T08:49:08.632Z | lvl=WARN | corr=ae8c8884-efac-11ec-9e52-0242ac12000c; cbnotif=1; node=G1RqnXD-NG1655628444-237-00000000046 | trans=1655628444-237-00000000046 | from=172.18.0.10 | srv=openiot | subsrv=/ | comp=Orion | op=AlarmManager.cpp[496]:badInput | msg=Raising alarm BadInput 172.18.0.10: service '/v1/updateContext/v2/op/update' not found
time=2022-06-19T08:49:08.633Z | lvl=INFO | corr=ae8c8884-efac-11ec-9e52-0242ac12000c; cbnotif=1; node=G1RqnXD-NG1655628444-237-00000000046 | trans=1655628444-237-00000000046 | from=172.18.0.10 | srv=openiot | subsrv=/ | comp=Orion | op=logTracing.cpp[148]:logInfoRequestWithPayload | msg=Request received: POST /v1/updateContext/v2/op/update, request payload (125 bytes): {"actionType":"append","entities":[{"event":
,"id":"urn:ngsi-ld:Temp:001","type":"Temp"}]}, response code: 400*
why there is 400 error in here?
P.s:
here is the entity defined for temperature :
{
"device_id": "temp001",
"entity_name": "urn:ngsi-ld:Temp:001",
"entity_type": "Temp",
"timezone": "Europe/Berlin",
"attributes": [
,
{ "object_id": "e", "name":"event", "type":"Text"} ],
"static_attributes": [
]
}
Activity
- All
- Comments
- History
- Activity
- Transitions