Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-19730

FIWARE.Question.Tech.error in updating entities with Perseo in Fiware.

    Details

      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 '

      {"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"}

      ]
      }

        Activity

        backlogmanager Backlog Manager created issue -
        Hide
        backlogmanager Backlog Manager added a comment -

        2022-06-20 05:31|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2022-06-20 05:31|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        fla Fernando Lopez made changes -
        Assignee Miguel Ángel Pedraza [ mapedraza ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2022-06-21 05:31|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2022-06-21 05:31|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2022-06-22 05:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2022-06-22 05:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] error in updating entities with Perseo in Fiware FIWARE.Question.Tech.error in updating entities with Perseo in Fiware.
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        1d 1 Backlog Manager 21/Jun/22 7:31 AM
        In Progress In Progress Closed Closed
        1d 1 Backlog Manager 22/Jun/22 7:31 AM

          People

          • Assignee:
            mapedraza Miguel Ángel Pedraza
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: