We use proprietary and third party´s cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy

First time here? Check out the FAQ!

Ask Your Question
0

Error at Cygnus when receives a Notification from "Orion context Broker" : 'fiware-servicepath' header value does not match the number of notified context responses

asked Aug 31 '17

Nacho gravatar image

I have created a Subscription at Orion Context Broker in order to send the data to Cygnus for persist the data in mongodb. When Orion receives and new event value send the notification to Cygnus and I get the following log info at console.

time=2017-08-31T10:10:56.130Z | lvl=INFO | corr=ad9caef6-8e34-11e7-885a-fa163e0d608a | trans=c08becae-0e14-4859-940c-32558dfec7f3 | srv=default | subsrv=/cygnusservicepath | comp=cygnusagent | op=getEvents | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[286] : [NGSIRestHandler] Starting internal transaction (c08becae-0e14-4859-940c-32558dfec7f3) time=2017-08-31T10:10:56.141Z | lvl=INFO | corr=ad9caef6-8e34-11e7-885a-fa163e0d608a | trans=c08becae-0e14-4859-940c-32558dfec7f3 | srv=default | subsrv=/cygnusservicepath | comp=cygnusagent | op=getEvents | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[304] : [NGSIRestHandler] Received data ({"subscriptionId":"xxxxxxxxx","data":[{"id":"id1","type":"type1,....) time=2017-08-31T10:10:56.239Z | lvl=WARN | corr=ad9caef6-8e34-11e7-885a-fa163e0d608a | trans=c08becae-0e14-4859-940c-32558dfec7f3 | srv=default | subsrv=/cygnusservicepath | comp=cygnusagent | op=getEvents | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[324] : [NGSIRestHandler] Bad HTTP notification ('fiware-servicepath' header value does not match the number of notified context responses time=2017-08-31T10:10:56.240Z | lvl=WARN | corr=ad9caef6-8e34-11e7-885a-fa163e0d608a | trans=c08becae-0e14-4859-940c-32558dfec7f3 | srv=default | subsrv=/cygnusservicepath | comp=cygnusagent | op=doPost | msg=org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet[186] : Received bad request from client. org.apache.flume.source.http.HTTPBadRequestException: 'fiware-servicepath' header value does not match the number of notified context responses at com.telefonica.iot.cygnus.handlers.NGSIRestHandler.getEvents(NGSIRestHandler.java:327) at org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet.doPost(HTTPSource.java:184) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at javax.servlet.http.HttpServlet.service(HttpServlet.java:814) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

The header is sent from Orion Context Broker to Cygnus, show what can I do to solve the problem?

Maybe something is not properly configured?

cat /usr/cygnus/conf/agent_mongo.conf cygnusagent.sources = http-source cygnusagent.sinks = mongo-sink cygnusagent.channels = mongo-channel

cygnusagent.sources.http-source.channels = mongo-channel cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource cygnusagent.sources.http-source.port = 5050 cygnusagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.NGSIRestHandler cygnusagent.sources.http-source.handler.notificationtarget = /notify cygnusagent.sources.http-source.handler.defaultservice = default cygnusagent.sources.http-source.handler.defaultservicepath = /cygnusservicepath cygnusagent.sources.http-source.handler.eventsttl = 10 cygnusagent.sources.http-source.interceptors = ts gi cygnusagent.sources.http-source.interceptors.ts.type = timestamp cygnusagent.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.NGSIGroupingInterceptor$Builder cygnusagent ... (more)

edit

Comments

I have the same problem, any update on this issue?

pedrosalgado gravatar imagepedrosalgado (Dec 14 '17)

1 answer

Sort by » oldest newest most voted
0

answered Oct 10 '18

Jason Fox gravatar image

When setting up the subscription, Cygnus currently only accepts notifications in the older NGSI v1 format- the attrsFormat=legacy is therefore needed.

see this : Stack Overflow Answer for more details

edit link
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: Aug 31 '17

Seen: 2,424 times

Last updated: Oct 10 '18