kamon-io / docker-grafana-graphite

Docker image with StatsD, Graphite, Grafana 2 and a Kamon Dashboard
Apache License 2.0
1.14k stars 495 forks source link

Is wizzy working? (export-datasources-and-dashboards (exit status 1; not expected)) #113

Open vonpupp opened 7 years ago

vonpupp commented 7 years ago

Hi,

I am trying to run this as follows:

docker-compose up

kamon-grafana-dashboard | 2017-10-08 22:08:42,337 INFO success: graphite-webapp entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
kamon-grafana-dashboard | 2017-10-08 22:08:42,337 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
kamon-grafana-dashboard | 2017-10-08 22:08:42,337 INFO success: carbon-cache entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
kamon-grafana-dashboard | 2017-10-08 22:08:56,036 INFO exited: export-datasources-and-dashboards (exit status 1; not expected)
kamon-grafana-dashboard | 2017-10-08 22:08:57,038 INFO spawned: 'export-datasources-and-dashboards' with pid 102
kamon-grafana-dashboard | 2017-10-08 22:08:58,039 INFO success: export-datasources-and-dashboards entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
kamon-grafana-dashboard | 2017-10-08 22:09:11,835 INFO exited: export-datasources-and-dashboards (exit status 1; not expected)
kamon-grafana-dashboard | 2017-10-08 22:09:12,009 INFO spawned: 'export-datasources-and-dashboards' with pid 164
kamon-grafana-dashboard | 2017-10-08 22:09:13,054 INFO success: export-datasources-and-dashboards entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
kamon-grafana-dashboard | 2017-10-08 22:09:26,826 INFO exited: export-datasources-and-dashboards (exit status 1; not expected)
kamon-grafana-dashboard | 2017-10-08 22:09:27,842 INFO spawned: 'export-datasources-and-dashboards' with pid 226
kamon-grafana-dashboard | 2017-10-08 22:09:28,843 INFO success: export-datasources-and-dashboards entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Since it is export-datasources-and-dashboards that seems to fail, I open up the script and saw a wizzy call. So I shell into the container and executed manually the command with the following result:

root@fbb596061171:/# cat /src/export-datasources-and-dashboards.sh 
#!/bin/bash
# sleeping for 10 seconds to let grafana get up and running
sleep 10 && wizzy export datasources && wizzy export dashboards
root@fbb596061171:/# wizzy export datasources
/usr/lib/node_modules/wizzy/src/commands.js:72
            grafana.export(_.drop(commands));
                   ^

TypeError: Cannot read property 'export' of undefined
    at Commands.instructions (/usr/lib/node_modules/wizzy/src/commands.js:72:11)
    at Command.listener (/usr/lib/node_modules/wizzy/node_modules/commander/index.js:300:8)
    at emitOne (events.js:96:13)
    at Command.emit (events.js:188:7)
    at Command.parseArgs (/usr/lib/node_modules/wizzy/node_modules/commander/index.js:637:12)
    at Command.parse (/usr/lib/node_modules/wizzy/node_modules/commander/index.js:457:21)
    at Object.<anonymous> (/usr/lib/node_modules/wizzy/src/index.js:14:9)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)

If you just type wizzy without arguments it also fails.

Any idea, please?

Thanks a lot.

repomaa commented 6 years ago

Having the same issue here. Prevents me from saving dashboards or alerts.

jotadepicas commented 6 years ago

+1

mduft commented 6 years ago

Seeing the same crash:

grafana_1 | 2018-01-29 07:41:43,275 INFO exited: export-datasources-and-dashboards (exit status 1; not expected) grafana_1 | 2018-01-29 07:41:43,796 INFO spawned: 'export-datasources-and-dashboards' with pid 617 grafana_1 | 2018-01-29 07:41:44,835 INFO success: export-datasources-and-dashboards entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

However it does not seem to keep me from using anything. I can create and save dashboards just fine. My "only" problem with this is the log cluttering so far :D

randonia commented 6 years ago

This looks like it relates to #116 . @jryberg posted a potential workaround solution but it would be nice to see a real fix.

It looks like relevant code in the main wizzy project for the most part it appears to be behaving as expected - it checks for a non HTTP 200 status and then aborts.

According to the Grafana HTTP API, it returns an HTTP 412 if the dashboard already exists. image

The export-datasources-and-dashboards responds with output:

{"message":"A dashboard with the same name already exists","status":"name-exists"}
wflanagan commented 5 years ago

Is there a workaround for this?