grafana-wizzy / wizzy

Manage & automate Grafana with easy wizzy
https://grafana-wizzy.com
Apache License 2.0
468 stars 60 forks source link

Sync during the export dashboards to grafana #149

Closed Jasstkn closed 5 years ago

Jasstkn commented 5 years ago

Hello, fellows. I built latest version of wizzy and tried to export my grafana dashboards. Command was completed, but I've got error (see below). Could you check, what's wrong with it? In the release 0.6.0 this issue is not reproduced.

@johnsudaar FYI

/wizzy/src/remote/grafana/exportSrv.js:287
          logger.showOutput(response.getBody('utf8'));
                                     ^

TypeError: Cannot read property 'getBody' of undefined
    at /wizzy/src/remote/grafana/exportSrv.js:287:38
    at arrayEach (/wizzy/node_modules/lodash/lodash.js:516:11)
    at Function.forEach (/wizzy/node_modules/lodash/lodash.js:9342:14)
    at Request.saveHandler [as _callback] (/wizzy/src/remote/grafana/exportSrv.js:213:7)
    at Request.self.callback (/wizzy/node_modules/request/request.js:186:22)
    at Request.emit (events.js:198:13)
    at Request.EventEmitter.emit (domain.js:448:20)
    at Request.<anonymous> (/wizzy/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:198:13)
    at Request.EventEmitter.emit (domain.js:448:20)
Sytten commented 5 years ago

Ok this logging line is wrong, but I cannot reproduce the underlining error. Can you reproduce and give me the full log please! EDIT: I pushed the fix to remove the problematic line

Jasstkn commented 5 years ago

@Sytten is any debug options for wizzy exists?

Jasstkn commented 5 years ago

I used following command:

wizzy set grafana url $GRAFANA_URL
wizzy export dashboards

And the error was appeared after the second one was executed. I'm afraid that I can't provide any additional and useful information for u

Sytten commented 5 years ago

Hum there is a debug flag, but it is not very useful at the moment. I am not sure I will be able to help further though, most likely there was a network glitch and the request returned a bad result/timeout. I will add better exceptions in the future.

Jasstkn commented 5 years ago

It would be nice to fix it, because I use it in Jenkins pipeline for syncing grafana between several environments and I have to change exit code of script for successful build execution

Jasstkn commented 5 years ago

@Sytten I build wizzy with latest commit and seems like issue was gone.

Sytten commented 5 years ago

Great! I will still keep an eye out to have better logging for network issues