[ https://jira.fiware.org/browse/HELP-19264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fernando Lopez reassigned HELP-19264: ------------------------------------- Assignee: Miguel Ángel Pedraza > [fiware-stackoverflow] perseo rule state is false and is not working > -------------------------------------------------------------------- > > Key: HELP-19264 > URL: https://jira.fiware.org/browse/HELP-19264 > 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 24-02-2022 at 08:02 > {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/71249072/perseo-rule-state-is-false-and-is-not-working > +Question:+ > perseo rule state is false and is not working > +Description:+ > I am working on the following case and got problem on adding and triggering rules. > subscribe orion-01 > add a post rule to perseo-core > trigger orion-02 api to update mongo db > Orion-01 has been subscribed successfully and perseo-core/fe gets notifications each time orion-01's entity is updated. > However, the rule posted to /perseo-core/rules always gets the response below and the state is shown as false, and the mongo db of orion-02 is never updated by the action defined on the rule. > { > "name": "user_temperature_update", > "timeLastStateChange": 1645682515095, > "text": "select 'user_temperature_post' as ruleName, ev.id? as id, ev.temperature__type? as type, ev.temperature? as value, * from pattern [every ev=iotEvent]", > "state": false > } > Here is the rule added to /perseo-core/rules. > { > "name":"user_temperature_post", > "text":"select \'user_temperature_post\' as ruleName, ev.id? as id, ev.temperature__type? as type, ev.temperature? as value, * from pattern [every ev=iotEvent]", > "action":{ > "type":"post", > "parameters":{ > "url": "https://<orion-02-host>/v2/entities/${id}/attrs", > "method": "PATCH", > "version": 2, > "headers": { > "Content-type": "application/json", > "Fiware-Service": "db01", > "Fiware-ServicePath": "/", > }, > "qs": { > "temperature": { > "value": "${value}", > "type": "${type}" > } > } > } > } > } > ------- > Here is the subscription > ------- > { > "id": "621625c7ce222f48a9364a91", > "expires": "2022-03-25T12:17:11.000Z", > "status": "active", > "subject": { > "entities": [ > { > "id": "1", > "type": "User" > } > ], > "condition": { > "attrs": [ > "temperature" > ] > } > }, > "notification": { > "timesSent": 26, > "lastNotification": "2022-02-23T16:42:56.000Z", > "attrs": [ > "temperature" > ], > "onlyChangedAttrs": false, > "attrsFormat": "legacy", > "http": { > "url": "http://<perseo-fe-host>/notices" > }, > "lastFailure": "2022-02-23T12:18:41.000Z", > "lastFailureReason": "Timeout was reached", > "lastSuccess": "2022-02-23T16:42:56.000Z", > "lastSuccessCode": 200 > }, > "throttling": 1 > } > Additionally, when I update orion-01's entities, perseo-fe gets this log. > time=2022-02-23T16:19:44.747Z | lvl=INFO | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=6ea05786-22b1-4514-8f85-6b4aea1be760 | op=/notices | path=/notices | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=incoming request {"method":"POST","url":"/notices","headers":{"user-agent":"orion/3.4.0 libcurl/7.61.1","fiware-service":"db01","fiware-servicepath":"/","accept":"application/json","content-length":"268","content-type":"application/json; charset=utf-8","fiware-correlator":"699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2","host":"<perseo-fe-host>:80","x-forwarded-host":"<perseo-fe-host>:80","x-forwarded-port":"80","x-forwarded-proto":"http","forwarded":"for=10.129.6.45;host=<perseo-fe-host>:80;proto=http","x-forwarded-for":"10.129.6.45"},"body":{"subscriptionId":"621625c7ce222f48a9364a91","originator":"localhost","contextResponses":[{"contextElement":{"type":"User","isPattern":"false","id":"1","attributes":[{"name":"temperature","type":"Number","value":98}]},"statusCode":{"code":"200","reasonPhrase":"OK"}}]},"subservice":"/","service":"db01"} > time=2022-02-23T16:19:44.748Z | lvl=INFO | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=6ea05786-22b1-4514-8f85-6b4aea1be760 | op=/notices | path=/notices | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=posting notice {"subscriptionId":"621625c7ce222f48a9364a91","originator":"localhost","contextResponses":[{"contextElement":{"type":"User","isPattern":"false","id":"1","attributes":[{"name":"temperature","type":"Number","value":98}]},"statusCode":{"code":"200","reasonPhrase":"OK"}}],"subservice":"/","service":"db01"} > time=2022-02-23T16:19:44.748Z | lvl=DEBUG | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=6ea05786-22b1-4514-8f85-6b4aea1be760 | op=/notices | path=/notices | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=notice processed: {"noticeId":"699472c0-94c4-11ec-bd3a-512a14e9c79f","noticeTS":1645633184748,"id":"1","type":"User","isPattern":"false","subservice":"/","service":"db01","temperature":98,"temperature__type":"Number","stripped":[{"name":"temperature","type":"Number","value":98}]} > time=2022-02-23T16:19:44.748Z | lvl=INFO | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=6ea05786-22b1-4514-8f85-6b4aea1be760 | op=/notices | path=/notices | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=making post to http://<perseo-core-host>/perseo-core/events > time=2022-02-23T16:19:44.762Z | lvl=INFO | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=1bcd01fb-ad58-463e-a333-504c4a6cf7f4 | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=incoming request {"method":"POST","url":"/actions/do","headers":{"content-type":"application/json; charset=utf-8","fiware-correlator":"699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23","fiware-service":"db01","fiware-servicepath":"/","x-real-ip":"::ffff:10.130.6.23","user-agent":"Java/11.0.12","host":"fiware-perseo-fe:9090","accept":"text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2","connection":"keep-alive","content-length":"72"},"body":{"ruleName":"User_temperature_post","id":"1","type":"Number","value":98},"subservice":"/","service":"db01"} > time=2022-02-23T16:19:44.762Z | lvl=DEBUG | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=1bcd01fb-ad58-463e-a333-504c4a6cf7f4 | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=Post action > time=2022-02-23T16:19:44.763Z | lvl=DEBUG | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=1bcd01fb-ad58-463e-a333-504c4a6cf7f4 | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=response-time: 2 statusCode: 200 > time=2022-02-23T16:19:44.764Z | lvl=DEBUG | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=1bcd01fb-ad58-463e-a333-504c4a6cf7f4 | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=db01 | subsrv=/ | msg=service db01, subservice /, event {"ruleName":"User_temperature_post","id":"1","type":"Number","value":98,"subservice":"/","service":"db01","fiwarePerseoContext":{"path":"/actions/do","op":"/actions/do","comp":"perseo-fe","trans":"1bcd01fb-ad58-463e-a333-504c4a6cf7f4","corr":"699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23","srv":"db01","subsrv":"/"}} > time=2022-02-23T16:19:44.765Z | lvl=DEBUG | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=1bcd01fb-ad58-463e-a333-504c4a6cf7f4 | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=db01 | subsrv=/ | msg=response-time: 4 > time=2022-02-23T16:19:44.765Z | lvl=DEBUG | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=6ea05786-22b1-4514-8f85-6b4aea1be760 | op=/notices | path=/notices | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=post to http://<perseo-core-host>/perseo-core/events returns {"code":200} > time=2022-02-23T16:19:44.766Z | lvl=INFO | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=6ea05786-22b1-4514-8f85-6b4aea1be760 | op=/notices | path=/notices | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=done post to http://<perseo-core-host>/perseo-core/events > time=2022-02-23T16:19:44.766Z | lvl=INFO | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=6ea05786-22b1-4514-8f85-6b4aea1be760 | op=/notices | path=/notices | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=sending response: 200 {"error":null,"data":[{"code":200}]} > time=2022-02-23T16:19:44.766Z | lvl=DEBUG | corr=699092ea-94c4-11ec-80f1-0a580a81062d; cbnotif=2; node=TX6NM1jBA; perseocep=23 | trans=6ea05786-22b1-4514-8f85-6b4aea1be760 | op=/notices | path=/notices | comp=perseo-fe | srv=db01 | subsrv=/ | from=::ffff:10.130.6.23 | msg=response-time: 19 statusCode: 200 > time=2022-02-23T16:19:44.770Z | lvl=ERROR | corr=n/a | trans=n/a | op=n/a | msg= rule not found User_temperature_post > time=2022-02-23T16:19:44.770Z | lvl=ERROR | corr=n/a | trans=n/a | op=n/a | msg= rule not found User_temperature_post > time=2022-02-23T16:19:44.770Z | lvl=DEBUG | corr=n/a | trans=n/a | op=n/a | msg=response-time: 9 > Could you please help me to solve this problem? -- 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