IzakMarais / reporter

Service that generates a PDF report from a Grafana dashboard
Apache License 2.0
946 stars 304 forks source link

dial tcp 127.0.0.1:3000: connect: connection refused #358

Open vikram29694 opened 7 months ago

vikram29694 commented 7 months ago

I am running Grafana on windows and grafana-server on wsl when i try to generate report for dashboard getting below error. i run grafana on localhost:3000. in firewall i added 8686 port to allow provide solution for this

vikram@INGURWN110387:/mnt/c/WINDOWS/system32$ grafana-reporter 2023/11/30 19:41:38 grafana reporter, version: 2.3-0 hash: 124b9a35302b3e9d4746ec0cf643abfecda8c21d 2023/11/30 19:41:38 serving at ':8686' and using grafana at 'http://localhost:3000' 2023/11/30 19:41:38 SSL check enforced 2023/11/30 19:41:38 Using sequential report layout. Consider enabling 'grid-layout' so that your report more closely follow the dashboard layout. 2023/11/30 19:43:14 Reporter called 2023/11/30 19:43:14 Called with api Token: 2023/11/30 19:43:14 Called without variable 2023/11/30 19:43:14 Called with dashboard: dcc2a785-7647-4ff5-a5aa-a334074ca087 2023/11/30 19:43:14 Called with time range: {now-1h now} 2023/11/30 19:43:14 Connecting to dashboard at http://localhost:3000/api/dashboards/uid/dcc2a785-7647-4ff5-a5aa-a334074ca087 2023/11/30 19:43:14 Error generating report: error fetching dashboard dcc2a785-7647-4ff5-a5aa-a334074ca087: error executing getDashboard request for http://localhost:3000/api/dashboards/uid/dcc2a785-7647-4ff5-a5aa-a334074ca087: Get http://localhost:3000/api/dashboards/uid/dcc2a785-7647-4ff5-a5aa-a334074ca087: dial tcp 127.0.0.1:3000: connect: connection refused 2023/11/30 20:18:45 Reporter called 2023/11/30 20:18:45 Called with api Token: 2023/11/30 20:18:45 Called without variable 2023/11/30 20:18:45 Called with dashboard: cd-a154-4850-9458-105fafd91a70 2023/11/30 20:18:45 Called with time range: {now-1h now} 2023/11/30 20:18:45 Connecting to dashboard at http://localhost:3000/api/dashboards/uid/cd-a154-4850-9458-105fafd91a70 2023/11/30 20:18:45 Error generating report: error fetching dashboard cd-a154-4850-9458-105fafd91a70: error obtaining dashboard from http://localhost:3000/api/dashboards/uid/cd-a154-4850-9458-105fafd91a70. Got Status 401 Unauthorized, message: {"extra":null,"message":"Unauthorized","messageId":"auth.unauthorized","statusCode":401,"traceID":""}

RealPingu commented 6 months ago

@vikram29694 Im getting the same error, did you find a solution ?

vikram29694 commented 6 months ago

@RealPingu still facing same issue. Did you find any solution?

RealPingu commented 6 months ago

No sadly, I didn't use this implementation for what I wanted, in the end I downloaded the images with a request then I used python-docx-templates to replace them from a template.

ventra007 commented 4 months ago

I work on Linux, but I guess it might be similar for Windows, in the grafana.ini I modified the value rendering_ignore_https_errors = true under the [plugin.grafana-image-renderer] section. Perhaps this will point you to where it might be for Windows?

mahendrapaipuri commented 3 months ago

@vikram29694 I think the error is because the reporter app does not have auth access to Grafana to download dashboards. Please check the new reporter app that can be integrated into Grafana as plugin app and hence no need to manage external auth and API tokens.