Code Monkey home page Code Monkey logo

Comments (3)

stephenyeargin avatar stephenyeargin commented on August 16, 2024 1

Looks like we might be able to debug it a bit with #127. Handful of additional questions:

  1. Has it worked previously or is this a new install?
  2. Can you confirm that you can open <your grafana host>/api/search?type=dash-db from the bot host?
# If you have an API key
curl -H "Authorization: bearer <your token>" "<your grafana host>/api/search?type=dash-db"

# If you do not have an API token
curl "<your grafana host>/api/search?type=dash-db"

The JSON parsing error is because it received some other content instead of JSON, which is usually caused by an HTML page coming over instead. The linked PR aims to improve debugging to find this out sooner, but I'm not a fan of the way it requires changing every method call in order to echo back to the user.

from hubot-grafana.

Sandaru48 avatar Sandaru48 commented on August 16, 2024

Looks like we might be able to debug it a bit with #127. Handful of additional questions:

  1. Has it worked previously or is this a new install?
  2. Can you confirm that you can open <your grafana host>/api/search?type=dash-db from the bot host?
# If you have an API key
curl -H "Authorization: bearer <your token>" "<your grafana host>/api/search?type=dash-db"

# If you do not have an API token
curl "<your grafana host>/api/search?type=dash-db"

The JSON parsing error is because it received some other content instead of JSON, which is usually caused by an HTML page coming over instead. The linked PR aims to improve debugging to find this out sooner, but I'm not a fan of the way it requires changing every method call in order to echo back to the user.

Hi @stephenyeargin ,
Sorry for the late response. Answers for 2 questions ;

  1. Yes . this is fresh installation.
  2. Yes, I can open <your grafana host>/api/search?type=dash-db from the bot host
    image

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on August 16, 2024

Let's try using the debug branch to get a better look at it. In your package.json, change to:

"hubot-grafana": "stephenyeargin/hubot-grafana#improve-error-handling",

Then, in your environment settings, set HUBOT_LOG_LEVEL=debug.

Here's an example of it encountering a redirect:

Hubot> !graf list
Hubot> [Sat Jan 09 2021 22:32:04 GMT-0600 (Central Standard Time)] DEBUG Message '!graf list' matched regex //^\s*[@]?(?:Hubot[:,]?|![:,]?)\s*(?:(?:grafana|graph|graf) list\s?(.+)?)/i/; listener.options = { id: null }
[Sat Jan 09 2021 22:32:04 GMT-0600 (Central Standard Time)] DEBUG Executing listener callback for Message '!graf list'
[Sat Jan 09 2021 22:32:04 GMT-0600 (Central Standard Time)] DEBUG <html>
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx/1.15.10</center>
</body>
</html>

[Sat Jan 09 2021 22:32:04 GMT-0600 (Central Standard Time)] ERROR An error ocurred calling the Grafana API on <http://play.grafana.org>. See logs for details.
[Sat Jan 09 2021 22:32:04 GMT-0600 (Central Standard Time)] DEBUG false
[Sat Jan 09 2021 22:32:04 GMT-0600 (Central Standard Time)] DEBUG false
An error ocurred calling the Grafana API on <http://play.grafana.org>. See logs for details.

from hubot-grafana.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.