Closed udh-mendix closed 2 years ago
same/similar issue here:
Error: Post "/api/folders": unsupported protocol scheme ""
431 on folders.tf line 9, in resource "grafana_folder" "metrics":
432 9: resource "grafana_folder" "metrics" {
Terraform: 0.13 Terraform Grafana Provider: 1.13.4 Grafana: v8.1.2
This error is encountered for one environment but not the other. Both environments have the same versions for Terraform, Grafana (both hosted instances of Grafana Cloud, with different domains), and Grafana provider plugin.
The failing instance is a Grafana Cloud trial instance (quotas/limits to number of resources).
The successful instance is a Grafana Cloud company-wide domain (i.e., <company-name>.grafana.net
).
The error has miraculously disappeared when upgrading to Terraform 1.0 (same other versions). Not sure if coincidence or cause.
Hi, @justinTM and @udh-mendix, I just wanted to confirm something in order to reprodue: suppose your dashboard URL is http://example.net/d/abc123/some-name
, what value are you using for importing the dashboard:
terraform import grafana_dashboard.sample abc123
# or
terraform import grafana_dashboard.samepl some-name
I know the documentation says to use the slug, but I'm afraid that might be wrong.
Thanks!
Hi @inkel, I've tried with both and it fails with the same error.
Thanks. Can you paste me the full error output?
I've tried with both dashboard ID and the slug, and its the same error.
Command for dashboard http://example.net/d/l9ji-5wWz/abc-slug -
terraform import -var-file=abcvarfile.tfvars module.grafana.grafana_dashboard.abc l9ji-5wWz
Relevant TF debug logs -
module.grafana.grafana_dashboard.abc: Importing from ID "l9ji-5wWz"...
module.grafana.grafana_dashboard.abc: Import prepared!
Prepared grafana_dashboard for import
module.grafana.grafana_dashboard.abc: Refreshing state... [id=l9ji-5wWz]
2021/08/31 11:11:06 [ERROR] module.grafana: eval: *terraform.EvalRefresh, err: Get /api/dashboards/db/l9ji-5wWz: unsupported protocol scheme ""
2021/08/31 11:11:06 [ERROR] module.grafana: eval: *terraform.EvalSequence, err: Get /api/dashboards/db/l9ji-5wWz: unsupported protocol scheme ""
2021/08/31 11:11:06 [TRACE] [walkImport] Exiting eval tree: import module.grafana.grafana_dashboard.abc result
2021/08/31 11:11:06 [TRACE] vertex "import module.grafana.grafana_dashboard.abc result": visit complete
@julienduchesne thanks for getting this fixed in #395. When will the release be cut? I'm waiting for that so terraform can pick up the latest tag.
@julienduchesne thanks for getting this fixed in #395. When will the release be cut? I'm waiting for that so terraform can pick up the latest tag.
This was released in v1.20.0
Terraform Version
Terraform: 0.12.9 Terraform Grafana Provider: 1.13.3 Grafana: v8.0.6
Affected Resource(s)
grafana_dashboard
Terraform config
Expected Behavior
Importing grafana dashboard should succeed
Actual Behaviour
Import fails with following error -
Error: Get /api/dashboards/db/abc: unsupported protocol scheme ""
grafana_url
is a HTTPS URL, so its unclear why I'm getting this error.Steps to Reproduce
Import grafana dashboard into terraform
terraform import grafana_dashboard.abc abc-slug