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

FIWARE.Request.Lab.sth comet fiware error.

    Details

    • Type: extRequest
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Fix Version/s: 2021
    • Component/s: FIWARE-TECH-HELP
    • Labels:
      None
    • HD-Enabler:
      STH-Comet

      Description

      Hi, I have a problem making STM Comet work, I hope you could give me a hand
      cause I don’t know anyone with experience in Fiware to help me and I can’t
      find more information about it.

      I followed the guide:
      https://github.com/Fiware/tutorials.Short-Term-History/tree/b47f51e807465642a790ee1c4607d4d6769f7acc#start-up

      I only used the parts of the tutorial which were of my interest, so I did
      the following:

      1) In a brand new CentOS virtual machine I installed Docker and
      Docker-Compose

      2) Pulled the images I needed:

      sudo docker pull mongo:3.6

      sudo docker pull fiware/orion

      sudo docker pull fiware/sth-comet

      3) Created a sth-comet.yml file (see file attached) based on the tutorial

      4) Used the following docker-compose command to start the containers:

      sudo docker-compose -f sth-comet.yml -p fiware up -d --remove-orphans

      5) Inserted in the orion container a couple of test data, which is attached
      in case you wanna give a look to the structure (data.txt)

      6) Made the subscription so the STH-Comet received and save the historic
      information as it is send by Orion in each data update (you can see the
      subscription attached named subscription.txt)

      7) Made several updated on the entity Room1 (this is the entity subscribed)

      8) The query to get the historical information was made as the following:

      *curl -X GET *

      And it returned the error:

      {"statusCode":400,"error":"Bad Request","message":"error=child
      \"fiware-service\"
      fails because [fiware-service is required]","
      validation":{"source":"headers","keys":[]}}

      The error mentioned these 2 headers fiware-service and fiware-service were
      required, so I modified the subscription (subscriptionWithHeaders.txt) and
      the get query to include these 2 headers

      Get query:

      *curl -X GET *

      *'http://localhost:8666/STH/v1/contextEntities/type/Room/id/Room1/attributes/temperature?hLimit=7&hOffset=0
      <http://localhost:8666/STH/v1/contextEntities/type/Room/id/Room1/attributes/temperature?hLimit=7&hOffset=0>'
      *

      *-H 'fiware-service: default' *

      • -H 'fiware-servicepath: /'*

      and the response were the following:

      *{"contextResponses":[{"contextElement":{"attributes":[

      {"name":"temperature","values":[]}

      ],"id":"Room1","isPattern":false,"type":"Room"},"statusCode":{"code":"200","reasonPhrase":"OK"}}]}*

      So no value were returned.

      So I don’t understand what I’m doing wrong, I swear I read everything
      regarding to this subject in the internet, I don’t know what else to do and
      I’m desperate. I really hope you can help me, thanks in advance

      __________________________________________________________________________________________

      You can get more information about our cookies and privacy policies on the following links:

      Fiware-lab-help mailing list
      Fiware-lab-help@lists.fiware.org
      https://lists.fiware.org/listinfo/fiware-lab-help

      [Created via e-mail received from: sofia klein <sofiakleinpalermo@gmail.com>]

      1. data.txt
        0.5 kB
        FW External User
      2. sth.comet.yml
        1.0 kB
        FW External User
      3. subscription.txt
        0.5 kB
        FW External User
      4. subscriptionWithHeaders.txt
        0.6 kB
        FW External User

        Activity

        Hide
        danieles Daniele Santoro added a comment -

        Dear, I forwarded your request to the specific support for STH-Comet GE

        Show
        danieles Daniele Santoro added a comment - Dear, I forwarded your request to the specific support for STH-Comet GE
        Hide
        andres.munoza Andres Muñoz added a comment - - edited

        Hi,

        Please try to verify if your notification is reaching STH, you can test that, emulation a notification for example:
        1 create a file notification.sh
        2 give execution permissions
        3 copy and paste this content:

        Unable to find source-code formatter for language: bash. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
        // Some comments here#!/bin/sh
        URL=$1
        
        if [ "$2" != "" ]
        then
           SERVICE=$2
        else
           SERVICE=default
        fi
        
        if [ "$3" != "" ]
        then
           SERVICE_PATH=$3
        else
           SERVICE_PATH=/
        fi
        
        curl $URL -v -s -S --header 'Content-Type: application/json; charset=utf-8' --header 'Accept: application/json' --header 'User-Agent: orion/0.10.0' --header "Fiware-Service: $SERVICE" --header "Fiware-ServicePath: $SERVICE_PATH" -d @- <<EOF
        {
          "subscriptionId" : "51c0ac9ed714fb3b37d7d5a8",
          "originator" : "localhost",
          "contextResponses" : [
            {
              "contextElement" : {
                "attributes" : [
                  {
                    "name" : "temperature",
                    "type" : "centigrade",
                    "value" : "26.5"
                  }
                ],
                "type" : "Room",
                "isPattern" : "false",
                "id" : "Room1"
              },
              "statusCode" : {
                "code" : "200",
                "reasonPhrase" : "OK"
              }
            }
          ]
        }
        EOF
        
        

        4 run ./notification.sh <your-sth-ip>:<your-sth-port>/notify demo /demo
        5 check your data in sth

        Show
        andres.munoza Andres Muñoz added a comment - - edited Hi, Please try to verify if your notification is reaching STH, you can test that, emulation a notification for example: 1 create a file notification.sh 2 give execution permissions 3 copy and paste this content: Unable to find source-code formatter for language: bash. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml // Some comments here#!/bin/sh URL=$1 if [ "$2" != "" ] then SERVICE=$2 else SERVICE= default fi if [ "$3" != "" ] then SERVICE_PATH=$3 else SERVICE_PATH=/ fi curl $URL -v -s -S --header 'Content-Type: application/json; charset=utf-8' --header 'Accept: application/json' --header 'User-Agent: orion/0.10.0' --header "Fiware-Service: $SERVICE" --header "Fiware-ServicePath: $SERVICE_PATH" -d @- <<EOF { "subscriptionId" : "51c0ac9ed714fb3b37d7d5a8" , "originator" : "localhost" , "contextResponses" : [ { "contextElement" : { "attributes" : [ { "name" : "temperature" , "type" : "centigrade" , "value" : "26.5" } ], "type" : "Room" , "isPattern" : " false " , "id" : "Room1" }, "statusCode" : { "code" : "200" , "reasonPhrase" : "OK" } } ] } EOF 4 run ./notification.sh <your-sth-ip>:<your-sth-port>/notify demo /demo 5 check your data in sth

          People

          • Assignee:
            andres.munoza Andres Muñoz
            Reporter:
            fw.ext.user FW External User
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: