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

FIWARE.Question.Tech.FIWARE Orion Context Broker subscription not pushing to accumulator-server.

    Details

      Description

      Created question in FIWARE Q/A platform on 28-01-2020 at 11:01
      Please, ANSWER this question AT https://stackoverflow.com/questions/59946406/fiware-orion-context-broker-subscription-not-pushing-to-accumulator-server

      Question:
      FIWARE Orion Context Broker subscription not pushing to accumulator-server

      Description:
      I've been stuck here for a day... I'm not sure if its an Orion problem or a docker problem.
      I'm playing around with Orion and a few other FIWARE components in docker-compose. I followed the 1 instruction to try the subscription but it doesn't work, as the accumulator-server doesn't receive any update notifications.

      I've checked several similar questions on StackOverflow, and here are 3 possible issues that I found and my situations.

      Might be a connection issue due to the truth that Orion is running docker container on MacOS and trying to reach external acc-server.
      My situation: According to2, I've tried to change the url filed in subscription request from "http://localhost:1028/accumulate" to "http://host.docker.internal:1028/accumulate". It still doesn't work. I use a bridge network in my docker-compose.yml. I'm new to docker and I'm not sure what other settings do I need to specify in order to reach server on the localhost from a container.
      Something wrong with OCB or subscription.
      My situation: Once I POST the subscription (I put subsciption in the appendix below. Orion is supposed to send notification to acc-server once I update the value of a self-defined dummy sensor), there's an HTTP 201 response that looks correct. The log in Orion looks like below:

      orion_1 | INFO@06:48:35 connectionOperations.cpp[375]: Database Operation Successful (insert: { _id: ObjectId('5e2fd943bcf1cf1869212cfe'), expiration: 1893506400, reference: "http://host.docker.internal:1028/accumulate", custom: false, throttling: 1, servicePath: "/#", description: "A subscription to notify clampPressure change", status: "active", entities: [

      { id: "RoboticArm", isPattern: "false", type: "multiSensor", isTypePattern: false }

      ], attrs: [ "clampPressure" ], metadata: [], blacklist: false, onlyChanged: false, conditions: [ "clampPressure" ], expression:

      { q: "", mq: "", geometry: "", coords: "", georel: "" }

      , format: "normalized" })

      If I check GET v2/subsciptions. All the subscriptions are there showing "active". While when I update the entity, the notification never reaches the acc-server. And if I check the logs of Orion, there's only logs about updating entity. There's nothing related to subscription status...Only the above one when first POST subscription. It seems like the Orion doesn't operate the subscription.

      Issue with accumulator-server.py
      My situation: I started it as 2, it looks fine. It just never receives anything from orion. If I try to post something through host, it works fine. I think the problem is more likely realted to Orion or connection.

      Thanks for helping!!! I suppose that this is not a very difficult issue but I just can't solve it on my own...

      And below is my POST /v2/subscriptions operation:

      curl v localhost:1026/v2/subscriptions -s -S -H "Content-Type: application/json" -d @ <<EOF
      {
      "description": "A subscription to notify clampPressure change",
      "subject": {
      "entities": [

      { "id": "RoboticArm", "type": "multiSensor" }

      ],
      "condition":

      { "attrs": [ "clampPressure" ] }

      },
      "notification": {
      "http":

      { "url": "http://host.docker.internal:1028/accumulate" }

      ,
      "attrs": [
      "clampPressure"
      ]
      },
      "expires": "2030-01-01T14:00:00.00Z",
      "throttling": 1
      }
      EOF

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2020-01-28 12:06|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2020-01-28 12:06|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        kzangeli Ken Zangelin added a comment -

        Answered and with happy client

        Show
        kzangeli Ken Zangelin added a comment - Answered and with happy client

          People

          • Assignee:
            kzangeli Ken Zangelin
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: