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

FIWARE.Question.Tech.Cygnus: Bad HTTP notification (curl/7.29.0 user agent not supported).

    Details

      Description

      Created question in FIWARE Q/A platform on 06-10-2015 at 17:10
      Please, ANSWER this question AT https://stackoverflow.com/questions/32973654/cygnus-bad-http-notification-curl-7-29-0-user-agent-not-supported

      Question:
      Cygnus: Bad HTTP notification (curl/7.29.0 user agent not supported)

      Description:
      I installed cygnus version 0.8.2 on Fiware instance basing on the image CentOS-7-x64 using:

      sudo yum install cygnus

      I configured my agent as the following:

      cygnusagent.sources = http-source
      cygnusagent.sinks = mongo-sink
      cygnusagent.channels = mongo-channel

      #=============================================

      1. source configuration
      2. channel name where to write the notification events
        cygnusagent.sources.http-source.channels = mongo-channel
      3. source class, must not be changed
        cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
      4. listening port the Flume source will use for receiving incoming notifications
        cygnusagent.sources.http-source.port = 5050
      5. Flume handler that will parse the notifications, must not be changed
        cygnusagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.OrionRestHandler
      6. URL target
        cygnusagent.sources.http-source.handler.notification_target = /notify
      7. Default service (service semantic depends on the persistence sink)
        cygnusagent.sources.http-source.handler.default_service = def_serv
      8. Default service path (service path semantic depends on the persistence sink)
        cygnusagent.sources.http-source.handler.default_service_path = def_servpath
      9. Number of channel re-injection retries before a Flume event is definitely discarded (-1 means infinite retries)
        cygnusagent.sources.http-source.handler.events_ttl = 10
      10. Source interceptors, do not change
        cygnusagent.sources.http-source.interceptors = ts gi
      11. TimestampInterceptor, do not change
        cygnusagent.sources.http-source.interceptors.ts.type = timestamp
      12. GroupinInterceptor, do not change
        cygnusagent.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder
      13. Grouping rules for the GroupingInterceptor, put the right absolute path to the file if necessary
      14. See the doc/design/interceptors document for more details
        cygnusagent.sources.http-source.interceptors.gi.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf
      1. ============================================
      2. OrionMongoSink configuration
      3. sink class, must not be changed
        cygnusagent.sinks.mongo-sink.type = com.telefonica.iot.cygnus.sinks.OrionMongoSink
      4. channel name from where to read notification events
        cygnusagent.sinks.mongo-sink.channel = mongo-channel
      5. FQDN/IP:port where the MongoDB server runs (standalone case) or comma-separated list of FQDN/IP:port pairs where the MongoDB replica set members run
        cygnusagent.sinks.mongo-sink.mongo_hosts = 127.0.0.1:27017
      6. a valid user in the MongoDB server (or empty if authentication is not enabled in MongoDB)
        cygnusagent.sinks.mongo-sink.mongo_username =
      7. password for the user above (or empty if authentication is not enabled in MongoDB)
        cygnusagent.sinks.mongo-sink.mongo_password =
      8. prefix for the MongoDB databases
        cygnusagent.sinks.mongo-sink.db_prefix = kura_
      9. prefix pro the MongoDB collections
        cygnusagent.sinks.mongo-sink.collection_prefix = kura_
      10. true is collection names are based on a hash, false for human redable collections
        cygnusagent.sinks.mongo-sink.should_hash = false

      #=============================================

      1. mongo-channel configuration
      2. channel type (must not be changed)
        cygnusagent.channels.mongo-channel.type = memory
      3. capacity of the channel
        cygnusagent.channels.mongo-channel.capacity = 1000
      4. amount of bytes that can be sent per transaction
        cygnusagent.channels.mongo-channel.transactionCapacity = 100

      I tried to test it locally using the following curl command:

      URL=$1

      curl $URL v -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Fiware-Service: qsg" --header "Fiware-ServicePath: testsink" -d @ <<EOF
      {
      "subscriptionId" : "51c0ac9ed714fb3b37d7d5a8",
      "originator" : "localhost",
      "contextResponses" : [
      {
      "contextElement" : {
      "attributes" : [

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

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

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

      }
      ]
      }
      EOF

      but I got this exception:

      2015-10-06 14:38:50,138 (1251445230@qtp-1186065012-0) [INFO - com.telefonica.iot.cygnus.handlers.OrionRestHandler.getEvents(OrionRestHandler.java:150)] Starting transaction (1444142307-244-0000000000)
      2015-10-06 14:38:50,140 (1251445230@qtp-1186065012-0) [WARN - com.telefonica.iot.cygnus.handlers.OrionRestHandler.getEvents(OrionRestHandler.java:180)] Bad HTTP notification (curl/7.29.0 user agent not supported)
      2015-10-06 14:38:50,140 (1251445230@qtp-1186065012-0) [WARN - org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet.doPost(HTTPSource.java:186)] Received bad request from client.
      org.apache.flume.source.http.HTTPBadRequestException: curl/7.29.0 user agent not supported
      at com.telefonica.iot.cygnus.handlers.OrionRestHandler.getEvents(OrionRestHandler.java:181)
      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)

      Any idea of what can be the cause of this exception?

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2017-06-08 18:06|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-06-08 18:06|CREATED monitor | # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-06-08 21:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-06-08 21:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-06-09 00:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-06-09 00:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            frb Francisco Romero
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: