Skip to content

Error occurred when requesting STH-Comet with sth-source-operator from Wirecloud. #376

@fisuda

Description

@fisuda

Hi @aarranz Cc: @fgalan

I encountered Invalid cookie value error when requesting STH-Comet with sth-source-operator from Wirecloud.

Response received from STH:

response: "{"statusCode":400,"error":"Bad Request","message":"Invalid cookie value"}"

STH log:

time=2019-02-09T23:25:50.720Z | lvl=WARN | corr=c0a1a597-38f8-488b-b430-7848962341b7 | trans=c0a1a597-38f8-488b-b430-7848962341b7 | op=OPER_STH_GET | from=n/a | srv=test | subsrv=/ | comp=STH | msg=GET /STH/v1/contextEntities/type/Room/id/Room1/attributes/temperature?hLimit=30&hOffset=0, event={"request":"1549754750690:sth-comet:15:jry3yn1l:10000","timestamp":1549754750703,"tags":["state","error"],"data":{"header":"_ga=GA1.2.1613225138.1529842581, _csrf=CxfXpBBwOkX5NWWoxkOJyl1Z, _gid=GA1.2.2115011858.1549664031","errors":[{"name":"_ga","value":"GA1.2.1613225138.1529842581, _csrf=CxfXpBBwOkX5NWWoxkOJyl1Z, _gid=GA1.2.2115011858.1549664031","settings":{"strictHeader":true,"ignoreErrors":false,"isSecure":true,"isHttpOnly":true,"isSameSite":"Strict","path":null,"domain":null,"ttl":null,"encoding":"none"},"reason":"Invalid cookie value"}]},"internal":true}

I checked a request header which Wirecloud sent to STH. It seems that cookie is a cause of this error.

host : 127.0.0.1:8999
connection : close
user-agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
accept-encoding : gzip, deflate, br
accept : text/javascript, text/html, application/xml, text/xml, */*
x-real-ip : 192.168.11.70
x-forwarded-for : 192.168.11.70, 172.20.0.1
fiware-service : test
fiware-servicepath : /
x-requested-with : XMLHttpRequest
referer : https://mashup.lab.fisuda.jp/kz-suda/sth
accept-language : ja,en;q=0.9
via : 1.0 mashup.lab.fisuda.jp (Wirecloud-python-Proxy/1.1)
cookie : _ga=GA1.2.1613225138.1529842581, _csrf=CxfXpBBwOkX5NWWoxkOJyl1Z, _gid=GA1.2.2115011858.1549664031
  server.route([
    {
      method: 'GET',
      path: '/STH/v1/contextEntities/type/{entityType}/id/{entityId}/attributes/{attrName}',
      handler: sthGetDataHandler,
      config: {
        validate: {
          headers: sthHeaderValidator,
          query: {
            lastN: joi.number().integer().greater(-1).optional(),
            hLimit: joi.number().integer().greater(-1).optional(),
            hOffset: joi.number().integer().greater(-1).optional(),
            aggrMethod: joi.string().valid('max', 'min', 'sum', 'sum2', 'occur').optional(),
            aggrPeriod: joi.string().required().valid('month', 'day', 'hour', 'minute', 'second').optional(),
            dateFrom: joi.date().optional(),
            dateTo: joi.date().optional(),
            filetype: joi.string().optional(),
            count: joi.boolean().optional()
          }

        },
        state: {
           "parse": true,
           "failAction": "ignore"
        }
      }
    },

Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions