Unable to save the dashboards
srkfru opened this issue · 2 comments
Hi Team,
I have followed all the steps in here (https://github.com/ysde/grafana-backup-tool ), but while i am running "grafana-backup save" command it is throwing the below error.
Note: Grafana server is running with HTTPS, I think we have to copy the cacert.pem file somewhere. (Changed the server name with XXXXXXXXXX)
Error Log:
grafana health: https://XXXXXXXXXX:3000/api/health
Traceback (most recent call last):
File "/grafana/grafanavirt/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/grafana/grafanavirt/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/grafana/grafanavirt/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in validate_conn
conn.connect()
File "/grafana/grafanavirt/lib/python3.8/site-packages/urllib3/connection.py", line 411, in connect
self.sock = ssl_wrap_socket(
File "/grafana/grafanavirt/lib/python3.8/site-packages/urllib3/util/ssl.py", line 428, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
File "/grafana/grafanavirt/lib/python3.8/site-packages/urllib3/util/ssl.py", line 472, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib64/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib64/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib64/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/grafana/grafanavirt/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/grafana/grafanavirt/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/grafana/grafanavirt/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='XXXXXXXXX', port=3000): Max retries exceeded with url: /api/health (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/grafana/grafanavirt/bin/grafana-backup", line 8, in
sys.exit(main())
File "/grafana/grafanavirt/lib/python3.8/site-packages/grafana_backup/cli.py", line 43, in main
save(args, settings)
File "/grafana/grafanavirt/lib/python3.8/site-packages/grafana_backup/save.py", line 25, in main
(status, json_resp, uid_support, paging_support) = api_checks(settings)
File "/grafana/grafanavirt/lib/python3.8/site-packages/grafana_backup/api_checks.py", line 12, in main
(status, json_resp) = health_check(grafana_url, http_get_headers, verify_ssl, client_cert, debug)
File "/grafana/grafanavirt/lib/python3.8/site-packages/grafana_backup/dashboardApi.py", line 8, in health_check
return send_grafana_get(url, http_get_headers, verify_ssl, client_cert, debug)
File "/grafana/grafanavirt/lib/python3.8/site-packages/grafana_backup/dashboardApi.py", line 184, in send_grafana_get
r = requests.get(url, headers=http_get_headers, verify=verify_ssl, cert=client_cert)
File "/grafana/grafanavirt/lib/python3.8/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/grafana/grafanavirt/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/grafana/grafanavirt/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/grafana/grafanavirt/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/grafana/grafanavirt/lib/python3.8/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='XXXXXXXXXXXX', port=3000): Max retries exceeded with url: /api/health (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
Have you tried setting verify_ssl
to false? I don't know what your TLS configuration looks like and if you're using valid certificates or self-signed, etc.
I have set this to false and it is working now. Thanks for the quick help @acjohnson .