Describe the bug
when running hubot graf db test123 hubot-rocketchat is showing ERROR SyntaxError: Unexpected token <
My grafana url is https://test.tools.**.**/grafana
I get below log from hubot container
DEBUG [ 'hubot graf db test123',
'test123',
undefined,
index: 0,
input: 'hubot graf db test123' ]
DEBUG { meta:
{ type: 'db',
canSave: false,
canEdit: false,
canAdmin: false,
canStar: false,
slug: 'test123',
url: '/grafana/d/VKZr7u9mz/test123',
expires: '0001-01-01T00:00:00Z',
created: '2019-02-27T21:26:21Z',
updated: '2019-02-27T21:26:21Z',
updatedBy: 'admin',
createdBy: 'admin',
version: 1,
hasAcl: false,
isFolder: false,
folderId: 0,
folderTitle: 'General',
folderUrl: '',
provisioned: false },
dashboard:
{ annotations: { list: [Object] },
editable: true,
gnetId: null,
graphTooltip: 0,
hideControls: false,
id: 26,
links: [],
panels: [ [Object] ],
schemaVersion: 16,
style: 'dark',
tags: [],
templating: { list: [] },
time: { from: 'now-6h', to: 'now' },
timepicker: { refresh_intervals: [Object], time_options: [Object] },
timezone: '',
title: 'test123',
uid: 'VKZr7u9mz',
version: 1 } }
DEBUG { cacheTimeout: null,
colorBackground: false,
colorValue: false,
colors: [ '#299c46', 'rgba(237, 129, 40, 0.89)', '#d44a3a' ],
format: 'none',
gauge:
{ maxValue: 100,
minValue: 0,
show: false,
thresholdLabels: false,
thresholdMarkers: true },
gridPos: { h: 9, w: 12, x: 0, y: 0 },
id: 2,
interval: null,
links: [],
mappingType: 1,
mappingTypes:
[ { name: 'value to text', value: 1 },
{ name: 'range to text', value: 2 } ],
maxDataPoints: 100,
nullPointMode: 'connected',
nullText: null,
postfix: '',
postfixFontSize: '50%',
prefix: '',
prefixFontSize: '50%',
rangeMaps: [ { from: 'null', text: 'N/A', to: 'null' } ],
sparkline:
{ fillColor: 'rgba(31, 118, 189, 0.18)',
full: false,
lineColor: 'rgb(31, 120, 193)',
show: false },
tableColumn: '',
targets:
[ { expr: '150',
format: 'time_series',
intervalFactor: 1,
refId: 'A' } ],
thresholds: '',
title: 'test123',
type: 'singlestat',
valueFontSize: '80%',
valueMaps: [ { op: '=', text: 'N/A', value: 'null' } ],
valueName: 'avg' }
[Wed Feb 27 2019 23:02:18 GMT+0000 (UTC)] ERROR SyntaxError: Unexpected token <
at Object.parse (native)
at Request._callback (/home/hubot/node_modules/hubot-grafana/src/grafana.coffee:485:27)
at Request.self.callback (/home/hubot/node_modules/hubot-grafana/node_modules/request/request.js:185:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (/home/hubot/node_modules/hubot-grafana/node_modules/request/request.js:1161:10)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at IncomingMessage. (/home/hubot/node_modules/hubot-grafana/node_modules/request/request.js:1083:12)
at IncomingMessage.g (events.js:260:16)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:923:12)
at nextTickCallbackWith2Args (node.js:511:9)
at process._tickCallback (node.js:425:17)
To Reproduce
Create a small dashboard in grafana. Grafana has url /grafana.
Enabled anonymus in grafana
Started hubot-rocketchat with below options
- name: EXTERNAL_SCRIPTS
value: "hubot-help,hubot-pugme,hubot-shipit,hubot-grafana"
- name: HUBOT_GRAFANA_HOST
value: "http://tools.tools.****.####/grafana/"
In rocketchat room
when i do hubot graf db anyname
I get the above error. But graf list command works fine
Expected behavior
Image should be shown in rocketchat
Screenshots
If applicable, add screenshots to help explain your problem.
Software:
- Grafana: 5.4.3
- Hubot: 2.19.0
- Adapter: rocketchat
- Node: v4.8.3
- NPM: 2.15.11
Additional context
We are running rocketchat and grafana in kubernetes.