-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR SyntaxError: Unexpected token < in JSON at position 0 #134
Comments
Looks like we might be able to debug it a bit with #127. Handful of additional questions:
# 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 , |
Let's try using the debug branch to get a better look at it. In your
Then, in your environment settings, set Here's an example of it encountering a redirect:
|
Describe the bug
I'm trying to get Grafana dashboard to slack API using hubot. Once tyoe @Jarvis-bot graf list, its giving following error
ubuntu@ubuntu:~/hubot$ HUBOT_SLACK_TOKEN=xoxb-XXXXXXXXXXXXXXXXXXXX ./bin/hubot --adapter slack
audited 168 packages in 4.264s
2 packages are looking for funding
run
npm fund
for detailsfound 0 vulnerabilities
[Sun Jan 03 2021 08:15:18 GMT+0000 (Coordinated Universal Time)] INFO hubot-slack adapter v4.8.1
warn: SlackDataStore is deprecated and will be removed in the next major version. See project documentation for a migration guide.
warn: SlackDataStore is deprecated and will be removed in the next major version. See project documentation for a migration guide.
[Sun Jan 03 2021 08:15:19 GMT+0000 (Coordinated Universal Time)] INFO Logged in as @Jarvis-bot in workspace Team-PSMT
[Sun Jan 03 2021 08:15:20 GMT+0000 (Coordinated Universal Time)] INFO Connected to Slack RTM
[Sun Jan 03 2021 08:15:20 GMT+0000 (Coordinated Universal Time)] INFO hubot-redis-brain: Using default redis on localhost:6379
[Sun Jan 03 2021 08:15:21 GMT+0000 (Coordinated Universal Time)] INFO hubot-redis-brain: Data for hubot brain retrieved from Redis
[Sun Jan 03 2021 08:16:06 GMT+0000 (Coordinated Universal Time)] ERROR SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (:null:null)
at /home/ubuntu/hubot/node_modules/hubot-grafana/src/grafana.coffee:428:7, :424:21
at IncomingMessage. (/home/ubuntu/hubot/node_modules/scoped-http-client/src/index.js:95:22)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
To Reproduce
Steps to reproduce the behavior:
1.Installed proetheus, node_exporter as service and installed grafana with image render plugin using docker-compose in a Raspberry pi 4 (armv8)
Expected behavior
getting grafana dashboard without error
Screenshots
Software:
The text was updated successfully, but these errors were encountered: