1. Infrastructure-metrics query locally

Infrastructure-metrics query locally

Home Forums FABRIC General Questions and Discussion Infrastructure-metrics query locally

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #8153
    Bjoern Sagstad
    Participant

      Dear everyone,

      I have been using the infrastructure-metrics website to query for different information, and it works really well there. However, when I run the same requests locally or through postman I get a error 500. This used to work as late as last week, however, those exact same requests now fail with error 500 as stated above. Did anything change, or is there something I can do to allow for my requests to go through?

      I’m currently testing both the https://infrastructure-metrics.fabric-testbed.net/query and https://infrastructure-metrics.fabric-testbed.net/query_range queries

      #8163
      Charles Carpenter
      Participant

        I’m not sure I understand what the fail is that gives you the 500 error.

        Are you saying that you can see the data on the website Grafana GUI but making the same calls to https://infrastructure-metrics.fabric-testbed.net/query does not work?

        Or do some calls to  https://infrastructure-metrics.fabric-testbed.net/query work and some do not depending on where the call is made from?

        There were some updates made late Friday to the query code, but those “should” not affect the calls.  I can still use the example curl calls successfully from jupyter hub or from my local laptop.
        If you were trying on Friday, you may have unluckly hit the updating time.

        #8165
        Bjoern Sagstad
        Participant

          Thank you for responding so quickly.

          Yes. I can see the data on the graphical interface, but when I make any requests locally(using the python requests library as normal or using a postman request) I get a error 500 internal server error.  I don’t believe I have changed the code on my end since it last worked.

          None of the requests I have made locally has worked today or yesterday. I tested various queries such as {"query": "rate(ifHCOutOctets[5m])"} and more advanced ones. I tested it on the jupyter.fabric-testbed too with the same error 500 result.

          Would you have an example snippet of code, or the curl command you have used for it to work that you could share with me and I could test it on my end, just in case something has gone wrong on my side?

          #8167
          Charles Carpenter
          Participant

            Here is the code snippet.
            curl https://infrastructure-metrics.fabric-testbed.net/query -H “Authorization: fabric-token YOURTOKEN” –data-urlencode ‘query=rate(ifHCOutOctets[5m])’

            #8168
            Charles Carpenter
            Participant

              There is a minor typo in the above query should be — before data

              curl https://infrastructure-metrics.fabric-testbed.net/query -H “Authorization: fabric-token xxxx” –data-urlencode ‘query=rate(ifHCOutOctets[5m])’

              I did find an error in the new code that would cause a 500 error if the given token did not represent a valid user.

               

              #8169
              Bjoern Sagstad
              Participant

                Thank you!

                When I run the same request on my end I get this response:

                <!doctype html>
                <html lang=en>
                <title>500 Internal Server Error</title>

                Internal Server Error

                The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

                I attempted to make sure that the token was correct, and when I put in a token that is not correct I get this response:

                {“error”:”Permission Denied. JWT Decode error”}

                • This reply was modified 2 weeks, 4 days ago by Bjoern Sagstad.
                • This reply was modified 2 weeks, 4 days ago by Bjoern Sagstad. Reason: easier to read hopefully
                • This reply was modified 2 weeks, 4 days ago by Bjoern Sagstad.
                • This reply was modified 2 weeks, 4 days ago by Bjoern Sagstad.
                #8173
                Charles Carpenter
                Participant

                  It looks like the formatter is messing with the double dash and changing it to a single dash. There should be a double dash before data-urlencode in the below command.

                  curl https://infrastructure-metrics.fabric-testbed.net/query -H “Authorization: fabric-token xxxx” --data-urlencode ‘query=rate(ifHCOutOctets[5m])’

                   

                  #8175
                  Charles Carpenter
                  Participant

                    Try again now & check your email for more information.

                     

                    #8176
                    Bjoern Sagstad
                    Participant

                      It works! Thank you so much for all your help.

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • The topic ‘Infrastructure-metrics query locally’ is closed to new replies.
                    FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

                    KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)
                    FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

                    KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)