esnet / gdg

Grafana Dashboard Manager
https://software.es.net/gdg/
Other
343 stars 32 forks source link

error in ds export #81

Closed raghavgupta0 closed 2 years ago

raghavgupta0 commented 2 years ago

Hi,

We are trying to export ds JSON file but getting the below error, so can you please help here

gdg@aa6ed4e8cc6c:/opt/gdg/bin$ gdg ds export time="2022-03-29T05:22:57Z" level=info msg="Exporting datasources" panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x86b426]

goroutine 1 [running]: github.com/netsage-project/gdg/api.(DashNGoImpl).ExportDataSources(0xc0002a96b0, {0xad3cb8, 0xc0002a9cb0}) /go/src/github.com/netsage-project/gdg/api/datasources.go:108 +0x546 github.com/netsage-project/gdg/cmd.glob..func21(0xde3700, {0x9f53d8, 0x0, 0x0}) /go/src/github.com/netsage-project/gdg/cmd/datasourcesExport.go:16 +0x83 github.com/spf13/cobra.(Command).execute(0xde3700, {0xffe1d0, 0x0, 0x0}) /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x5f8 github.com/spf13/cobra.(Command).ExecuteC(0xde4100) /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc github.com/spf13/cobra.(Command).Execute(...) /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902 github.com/netsage-project/gdg/cmd.Execute() /go/src/github.com/netsage-project/gdg/cmd/root.go:40 +0x25 main.main() /go/src/github.com/netsage-project/gdg/main.go:14 +0x4a

JSON file:- { "orgId": 1, "name": "AlertManagerDS", "type": "camptocamp-prometheus-alertmanager-datasource", "typeLogoUrl": "public/app/plugins/datasource/prometheus/img/prometheus_logo.svg", "access": "proxy", "editable": "false", "url": "http://xxxxxxxxxxxxxxxx.svc", "jsonData": { "severity_critical": "critical", "severity_high": "error", "severity_warning": "warning", "severity_info": "information" }

safaci2000 commented 2 years ago

I tried using the JSON provided to create a DS locally. I can import/export without any issues so next questions.

  1. GDG Version
  2. Grafana Version?
  3. Can you try again with the latest version, we moved repos so some of the references are a bit dated and harder to locate. v1.10.0 should be the latest version.
safaci2000 commented 2 years ago

@raghavgupta0 one last poke before I close this issue.