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

FIWARE.Question.Tech.Data.OrionContextBroker.Subscriptions don't seem to work using dockerized fiware-orion.

    Details

      Description

      Created question in FIWARE Q/A platform on 14-04-2016 at 15:04
      Please, ANSWER this question AT http://stackoverflow.com/questions/36624433/subscriptions-dont-seem-to-work-using-dockerized-fiware-orion

      Question:
      Subscriptions don't seem to work using dockerized fiware-orion

      Description:
      I'm using Fiware-Orion ContextBroker 0.28, the dockerized version in my localhost on ubuntu 15.10 64 bits.

      $ curl localhost:1026/version
      {
      "orion" : {
      "version" : "0.28.0-next",
      "uptime" : "0 d, 0 h, 0 m, 6 s",
      "git_hash" : "067e13618c247daa4af61f82d7831f3015d9eb5d",
      "compile_time" : "Mon Mar 14 13:04:02 UTC 2016",
      "compiled_by" : "root",
      "compiled_in" : "838a42ae8431"
      }
      }

      The docker configuration I'm using is:

      $ cat docker-compose.yml
      mongo:
      image: mongo:2.6
      command: --smallfiles --nojournal
      orion:
      image: fiware/orion
      links:

      • mongo
        ports:
      • "1026:1026"
        command: -dbhost mongo

      The warning I get from orion/docker when I do the subscriptions is:

      orion_1 | WARNING@12:19:14 AlarmManager.cpp[303]: Raising alarm NotificationError localhost:1028/accumulate: (curl_easy_perform failed: Couldn't connect to server)

      I'm following the API V1 walkthorugh to test subscriptions to changes. I start with a mint new dockerized (sudo docker-compose up and all that fuzz) fiware-orion 0.28 with mongodb. Then I start the accumulator

      $ ./accumulator-server.py 1028 /accumulate localhost on
      verbose mode is on

      Then I register Room1

      $ (curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \
      > -header 'Accept: application/json' -d @ | python -mjson.tool) <<EOF
      > {
      > "contextElements": [
      > {
      > "type": "Room",
      > "isPattern": "false",
      > "id": "Room1",
      > "attributes": [
      >

      { > "name": "temperature", > "type": "float", > "value": "23" > }

      ,
      >

      { > "name": "pressure", > "type": "integer", > "value": "720" > }

      > ]
      > }
      > ],
      > "updateAction": "APPEND"
      > }
      > EOF
      {
      "contextResponses": [
      {
      "contextElement": {
      "attributes": [

      { "name": "temperature", "type": "float", "value": "" }

      ,

      { "name": "pressure", "type": "integer", "value": "" }

      ],
      "id": "Room1",
      "isPattern": "false",
      "type": "Room"
      },
      "statusCode":

      { "code": "200", "reasonPhrase": "OK" }

      }
      ]
      }

      Then I test query context just to check:

      $ (curl localhost:1026/v1/queryContext -s -S --header 'Content-Type: application/json' \
      > -header 'Accept: application/json' -d @ | python -mjson.tool) <<EOF
      > {
      > "entities": [
      >

      { > "type": "Room", > "isPattern": "false", > "id": "Room1" > }

      > ]
      > }
      > EOF
      {
      "contextResponses": [
      {
      "contextElement": {
      "attributes": [

      { "name": "pressure", "type": "integer", "value": "720" }

      ,

      { "name": "temperature", "type": "float", "value": "23" }

      ],
      "id": "Room1",
      "isPattern": "false",
      "type": "Room"
      },
      "statusCode":

      { "code": "200", "reasonPhrase": "OK" }

      }
      ]
      }

      Then I do the subscription

      $ (curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' \
      > -header 'Accept: application/json' -d @ | python -mjson.tool) <<EOF
      > {
      > "entities": [
      >

      { > "type": "Room", > "isPattern": "false", > "id": "Room1" > }

      > ],
      > "attributes": [
      > "pressure"
      > ],
      > "reference": "http://localhost:1028/accumulate",
      > "duration": "P1M",
      > "notifyConditions": [
      >

      { > "type": "ONCHANGE", > "condValues": [ > "pressure" > ] > }

      > ],
      > "throttling": "PT5S"
      > }
      > EOF
      {
      "subscribeResponse":

      { "duration": "P1M", "subscriptionId": "570f8ac247fcf8a62722353c", "throttling": "PT5S" }

      }

      At this point the manual says that the accumulator might receive a first update but it's not required, so I don't receive nothing but maybe that's OK. Or maybe not, because after sending the subscription query, orion's docker says:

      orion_1 | WARNING@12:19:14 AlarmManager.cpp[303]: Raising alarm NotificationError localhost:1028/accumulate: (curl_easy_perform failed: Couldn't connect to server)

      Finally I update the entity and I should receive the update on the accumulator, but I don't:

      $ (curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \
      > -header 'Accept: application/json' -d @ | python -mjson.tool) <<EOF
      > {
      > "contextElements": [
      > {
      > "type": "Room",
      > "isPattern": "false",
      > "id": "Room1",
      > "attributes": [
      >

      { > "name": "temperature", > "type": "float", > "value": "56.5" > }

      ,
      >

      { > "name": "pressure", > "type": "integer", > "value": "553" > }

      > ]
      > }
      > ],
      > "updateAction": "UPDATE"
      > }
      > EOF
      {
      "contextResponses": [
      {
      "contextElement": {
      "attributes": [

      { "name": "temperature", "type": "float", "value": "" }

      ,

      { "name": "pressure", "type": "integer", "value": "" }

      ],
      "id": "Room1",
      "isPattern": "false",
      "type": "Room"
      },
      "statusCode":

      { "code": "200", "reasonPhrase": "OK" }

      }
      ]
      }

      I should also say that it's quite difficult to get fiware-orion to compile on Ubuntu, and that's the reason why I'm using docker.

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        mev Manuel Escriche made changes -
        Assignee Fermín Galán [ fermin ]
        backlogmanager Backlog Manager made changes -
        Summary FIWARE.Question.Tech.Subscriptions don&#39;t seem to work using dockerized fiware-orion. FIWARE.Question.Tech.Data.OrionContextBroker.Subscriptions don&#39;t seem to work using dockerized fiware-orion.
        HD-Chapter Data [ 10838 ]
        mev Manuel Escriche made changes -
        HD-Enabler Orion [ 10875 ]
        Description
        Created question in FIWARE Q/A platform on 14-04-2016 at 15:04
        {color: red}Please, ANSWER this question AT{color} http://stackoverflow.com/questions/36624433/subscriptions-dont-seem-to-work-using-dockerized-fiware-orion


        +Question:+
        Subscriptions don&#39;t seem to work using dockerized fiware-orion

        +Description:+
        I'm using Fiware-Orion ContextBroker 0.28, the dockerized version in my localhost on ubuntu 15.10 64 bits.

        $ curl localhost:1026/version
        {
          "orion" : {
          "version" : "0.28.0-next",
          "uptime" : "0 d, 0 h, 0 m, 6 s",
          "git_hash" : "067e13618c247daa4af61f82d7831f3015d9eb5d",
          "compile_time" : "Mon Mar 14 13:04:02 UTC 2016",
          "compiled_by" : "root",
          "compiled_in" : "838a42ae8431"
        }
        }


        The docker configuration I'm using is:

        $ cat docker-compose.yml
        mongo:
          image: mongo:2.6
          command: --smallfiles --nojournal
        orion:
          image: fiware/orion
          links:
            - mongo
          ports:
            - "1026:1026"
          command: -dbhost mongo


        The warning I get from orion/docker when I do the subscriptions is:

        orion_1 | WARNING@12:19:14 AlarmManager.cpp[303]: Raising alarm NotificationError localhost:1028/accumulate: (curl_easy_perform failed: Couldn't connect to server)


        I'm following the API V1 walkthorugh to test subscriptions to changes. I start with a mint new dockerized (sudo docker-compose up and all that fuzz) fiware-orion 0.28 with mongodb. Then I start the accumulator

        $ ./accumulator-server.py 1028 /accumulate localhost on
        verbose mode is on
         * Running on http://localhost:1028/ (Press CTRL+C to quit)


        Then I register Room1

        $ (curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \
        &gt; --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        &gt; {
        &gt; "contextElements": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room1",
        &gt; "attributes": [
        &gt; {
        &gt; "name": "temperature",
        &gt; "type": "float",
        &gt; "value": "23"
        &gt; },
        &gt; {
        &gt; "name": "pressure",
        &gt; "type": "integer",
        &gt; "value": "720"
        &gt; }
        &gt; ]
        &gt; }
        &gt; ],
        &gt; "updateAction": "APPEND"
        &gt; }
        &gt; EOF
        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "temperature",
                                "type": "float",
                                "value": ""
                            },
                            {
                                "name": "pressure",
                                "type": "integer",
                                "value": ""
                            }
                        ],
                        "id": "Room1",
                        "isPattern": "false",
                        "type": "Room"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        Then I test query context just to check:

        $ (curl localhost:1026/v1/queryContext -s -S --header 'Content-Type: application/json' \
        &gt; --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        &gt; {
        &gt; "entities": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room1"
        &gt; }
        &gt; ]
        &gt; }
        &gt; EOF
        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "pressure",
                                "type": "integer",
                                "value": "720"
                            },
                            {
                                "name": "temperature",
                                "type": "float",
                                "value": "23"
                            }
                        ],
                        "id": "Room1",
                        "isPattern": "false",
                        "type": "Room"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        Then I do the subscription

        $ (curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' \
        &gt; --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        &gt; {
        &gt; "entities": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room1"
        &gt; }
        &gt; ],
        &gt; "attributes": [
        &gt; "pressure"
        &gt; ],
        &gt; "reference": "http://localhost:1028/accumulate",
        &gt; "duration": "P1M",
        &gt; "notifyConditions": [
        &gt; {
        &gt; "type": "ONCHANGE",
        &gt; "condValues": [
        &gt; "pressure"
        &gt; ]
        &gt; }
        &gt; ],
        &gt; "throttling": "PT5S"
        &gt; }
        &gt; EOF
        {
            "subscribeResponse": {
                "duration": "P1M",
                "subscriptionId": "570f8ac247fcf8a62722353c",
                "throttling": "PT5S"
            }
        }


        At this point the manual says that the accumulator might receive a first update but it's not required, so I don't receive nothing but maybe that's OK. Or maybe not, because after sending the subscription query, orion's docker says:

        orion_1 | WARNING@12:19:14 AlarmManager.cpp[303]: Raising alarm NotificationError localhost:1028/accumulate: (curl_easy_perform failed: Couldn't connect to server)


        Finally I update the entity and I should receive the update on the accumulator, but I don't:

        $ (curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \
        &gt; --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        &gt; {
        &gt; "contextElements": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room1",
        &gt; "attributes": [
        &gt; {
        &gt; "name": "temperature",
        &gt; "type": "float",
        &gt; "value": "56.5"
        &gt; },
        &gt; {
        &gt; "name": "pressure",
        &gt; "type": "integer",
        &gt; "value": "553"
        &gt; }
        &gt; ]
        &gt; }
        &gt; ],
        &gt; "updateAction": "UPDATE"
        &gt; }
        &gt; EOF
        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "temperature",
                                "type": "float",
                                "value": ""
                            },
                            {
                                "name": "pressure",
                                "type": "integer",
                                "value": ""
                            }
                        ],
                        "id": "Room1",
                        "isPattern": "false",
                        "type": "Room"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        I should also say that it's quite difficult to get fiware-orion to compile on Ubuntu, and that's the reason why I'm using docker.
        Created question in FIWARE Q/A platform on 14-04-2016 at 15:04
        {color: red}Please, ANSWER this question AT{color} http://stackoverflow.com/questions/36624433/subscriptions-dont-seem-to-work-using-dockerized-fiware-orion


        +Question:+
        Subscriptions don&#39;t seem to work using dockerized fiware-orion

        +Description:+
        I'm using Fiware-Orion ContextBroker 0.28, the dockerized version in my localhost on ubuntu 15.10 64 bits.

        $ curl localhost:1026/version
        {
          "orion" : {
          "version" : "0.28.0-next",
          "uptime" : "0 d, 0 h, 0 m, 6 s",
          "git_hash" : "067e13618c247daa4af61f82d7831f3015d9eb5d",
          "compile_time" : "Mon Mar 14 13:04:02 UTC 2016",
          "compiled_by" : "root",
          "compiled_in" : "838a42ae8431"
        }
        }


        The docker configuration I'm using is:

        $ cat docker-compose.yml
        mongo:
          image: mongo:2.6
          command: --smallfiles --nojournal
        orion:
          image: fiware/orion
          links:
            - mongo
          ports:
            - "1026:1026"
          command: -dbhost mongo


        The warning I get from orion/docker when I do the subscriptions is:

        orion_1 | WARNING@12:19:14 AlarmManager.cpp[303]: Raising alarm NotificationError localhost:1028/accumulate: (curl_easy_perform failed: Couldn't connect to server)


        I'm following the API V1 walkthorugh to test subscriptions to changes. I start with a mint new dockerized (sudo docker-compose up and all that fuzz) fiware-orion 0.28 with mongodb. Then I start the accumulator

        $ ./accumulator-server.py 1028 /accumulate localhost on
        verbose mode is on
         * Running on http://localhost:1028/ (Press CTRL+C to quit)


        Then I register Room1

        $ (curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \
        &gt; --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        &gt; {
        &gt; "contextElements": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room1",
        &gt; "attributes": [
        &gt; {
        &gt; "name": "temperature",
        &gt; "type": "float",
        &gt; "value": "23"
        &gt; },
        &gt; {
        &gt; "name": "pressure",
        &gt; "type": "integer",
        &gt; "value": "720"
        &gt; }
        &gt; ]
        &gt; }
        &gt; ],
        &gt; "updateAction": "APPEND"
        &gt; }
        &gt; EOF
        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "temperature",
                                "type": "float",
                                "value": ""
                            },
                            {
                                "name": "pressure",
                                "type": "integer",
                                "value": ""
                            }
                        ],
                        "id": "Room1",
                        "isPattern": "false",
                        "type": "Room"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        Then I test query context just to check:

        $ (curl localhost:1026/v1/queryContext -s -S --header 'Content-Type: application/json' \
        &gt; --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        &gt; {
        &gt; "entities": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room1"
        &gt; }
        &gt; ]
        &gt; }
        &gt; EOF
        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "pressure",
                                "type": "integer",
                                "value": "720"
                            },
                            {
                                "name": "temperature",
                                "type": "float",
                                "value": "23"
                            }
                        ],
                        "id": "Room1",
                        "isPattern": "false",
                        "type": "Room"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        Then I do the subscription

        $ (curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' \
        &gt; --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        &gt; {
        &gt; "entities": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room1"
        &gt; }
        &gt; ],
        &gt; "attributes": [
        &gt; "pressure"
        &gt; ],
        &gt; "reference": "http://localhost:1028/accumulate",
        &gt; "duration": "P1M",
        &gt; "notifyConditions": [
        &gt; {
        &gt; "type": "ONCHANGE",
        &gt; "condValues": [
        &gt; "pressure"
        &gt; ]
        &gt; }
        &gt; ],
        &gt; "throttling": "PT5S"
        &gt; }
        &gt; EOF
        {
            "subscribeResponse": {
                "duration": "P1M",
                "subscriptionId": "570f8ac247fcf8a62722353c",
                "throttling": "PT5S"
            }
        }


        At this point the manual says that the accumulator might receive a first update but it's not required, so I don't receive nothing but maybe that's OK. Or maybe not, because after sending the subscription query, orion's docker says:

        orion_1 | WARNING@12:19:14 AlarmManager.cpp[303]: Raising alarm NotificationError localhost:1028/accumulate: (curl_easy_perform failed: Couldn't connect to server)


        Finally I update the entity and I should receive the update on the accumulator, but I don't:

        $ (curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \
        &gt; --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        &gt; {
        &gt; "contextElements": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room1",
        &gt; "attributes": [
        &gt; {
        &gt; "name": "temperature",
        &gt; "type": "float",
        &gt; "value": "56.5"
        &gt; },
        &gt; {
        &gt; "name": "pressure",
        &gt; "type": "integer",
        &gt; "value": "553"
        &gt; }
        &gt; ]
        &gt; }
        &gt; ],
        &gt; "updateAction": "UPDATE"
        &gt; }
        &gt; EOF
        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "temperature",
                                "type": "float",
                                "value": ""
                            },
                            {
                                "name": "pressure",
                                "type": "integer",
                                "value": ""
                            }
                        ],
                        "id": "Room1",
                        "isPattern": "false",
                        "type": "Room"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        I should also say that it's quite difficult to get fiware-orion to compile on Ubuntu, and that's the reason why I'm using docker.
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] Subscriptions don&#39;t seem to work using dockerized fiware-orion FIWARE.Question.Tech.Subscriptions don&#39;t seem to work using dockerized fiware-orion.
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: