[ https://jira.fiware.org/browse/HELP-19730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fernando Lopez reassigned HELP-19730: ------------------------------------- Assignee: Miguel Ángel Pedraza > [fiware-stackoverflow] error in updating entities with Perseo in Fiware > ----------------------------------------------------------------------- > > Key: HELP-19730 > URL: https://jira.fiware.org/browse/HELP-19730 > Project: Help-Desk > Issue Type: Monitor > Components: FIWARE-TECH-HELP > Reporter: Backlog Manager > Assignee: Miguel Ángel Pedraza > Labels: fiware, fiware-orion, fiware-perseo > > Created question in FIWARE Q/A platform on 19-06-2022 at 10:06 > {color: red}Please, ANSWER this question AT{color} 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 '{"t": "25"}' > 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":[{"name":"event","type":"Text","value":"event test"}]},"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":[{"name":"event","type":"Text","value":"event test"}]},"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":[{"name":"event","type":"Text","value":"event test"}]},"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":{"value":"event test","type":"Text"},"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":{"value":"event test","type":"Text"},"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": "t", "name":"temperature", "type":"Integer"}, > { "object_id": "e", "name":"event", "type":"Text"} > ], > "static_attributes": [ > {"name": "refroom", "type": "Relationship","value": "urn:ngsi-ld:Room:001"} > ] > } -- This message was sent by Atlassian JIRA (v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy