Socket hang up exception sent by server on Orion queryContext request

415 views Asked by At

I'm trying to access FIWARE Orion Context Broker, with the following command, but I receive this error, sent by the remote context broker...

curl -d '{"entities":[{"type":"","isPattern":"true","id":".*"}]}' \
     -H 'Content-type: application/json'\
     -H 'X-Auth-Token: .....'\
     'http://orion.lab.fiware.org:1026/ngsi10/queryContext?limit=5&details=on'
Error: socket hang up
    at createHangUpError (http.js:1453:15)
    at Socket.socketOnEnd [as onend] (http.js:1549:23)
    at Socket.g (events.js:175:14)
    at Socket.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:910:16
    at process._tickCallback (node.js:415:13)

Can someone help me ?

1

There are 1 answers

1
fgalan On

This seems to be related with a recent bug discovered in Orion 0.22.0. The problem seems to happen when the query is too wide so it match with a large number of registrations to which forward messages are being sent (in the case of Orion at orion.lab.fiware.org, that query matches around 1,000 registrations).

We plan to implement a hotfix for this soon (and edit this answer after that). In the meanwhile, I'd recommend you to use "narrower" queries, e.g. fixing the type: {"entities":[{"type":"Room","isPattern":"true","id":".*"}]}.

EDIT: Orion instance has been upgraded in orion.lab.fiware.org and now it seems to work. However, I haven't been able to use exactly your curl line... instead I'm using the following that I understand is functionally equivalent:

(curl 'orion.lab.fiware.org:1026/v1/queryContext?limit=5&details=on' -s -S --header 'X-Auth-Token: ...' --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "entities": [
        {
            "type": "",
            "isPattern": "true",
            "id": ".*"
        }
    ]
}
EOF