The GitHub action "download Terraform state" failed whilst deploying
chilts opened this issue · comments
Hi everyone and firstly thanks for Wildebeest. I much appreciate it already.
I did run into a problem during my deploy though. All actions above this one - "download Terraform state" - are successful. However, this one failed. I can see that the KV namespace exists, so any help appreciated.
Paste of the output from the action:
Run cloudflare/wrangler-action@2.0.0
/usr/bin/docker run ...etc...
npm WARN deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
added 101 packages, and audited 102 packages in 2s
11 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Using API Token authentication
$ Running: wrangler kv:key get --namespace-id=eea...NamespaceId...69e terraform.tfstate > ./tf/terraform.tfstate
▲ [WARNING] Processing wrangler.toml configuration:
- D1 Bindings are currently in alpha to allow the API to evolve before general availability.
Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose
Note: Run this command with the environment variable NO_D1_WARNING=true to hide this message
For example: `export NO_D1_WARNING=true && wrangler <YOUR COMMAND HERE>`
- D1 Bindings are currently in alpha to allow the API to evolve before general availability.
Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose
Note: Run this command with the environment variable NO_D1_WARNING=true to hide this message
For example: `export NO_D1_WARNING=true && wrangler <YOUR COMMAND HERE>`
✘ [ERROR] Failed to fetch https://api.cloudflare.com/client/v4/accounts/***/storage/kv/namespaces/eea...NamespaceId...69e/values/terraform.tfstate - 404: Not Found);
The eea...NamespaceId...69e
does exist under my https://dash.cloudflare.com/ece...AccountId...3fd/workers/kv/namespaces page.
Many thanks.
I can confirm it's reproducible. I retried the job several times to fix earlier errors before getting to this point, maybe that could have confused it.
If I go ahead and create an empty terraform.tfstate in the namespace mentioned, then rerun the job, it gets all the way to configure:
cloudflare_access_application.wildebeest_access: Creating...
random_password.user_key: Creation complete after 0s [id=none]
╷
│ Error: error creating workers kv namespace: create namespace: 'a namespace with this account ID and title already exists' (10014)
│
│ with cloudflare_workers_kv_namespace.wildebeest_cache,
│ on main.tf line 86, in resource "cloudflare_workers_kv_namespace" "wildebeest_cache":
│ 86: resource "cloudflare_workers_kv_namespace" "wildebeest_cache" {
│
╵
╷
│ Error: error creating workers kv namespace: create namespace: 'a namespace with this account ID and title already exists' (10014)
│
│ with cloudflare_workers_kv_namespace.terraform_state,
│ on main.tf line 91, in resource "cloudflare_workers_kv_namespace" "terraform_state":
│ 91: resource "cloudflare_workers_kv_namespace" "terraform_state" {
│
╵
╷
│ Error: error creating Access Application for account "***": access.api.error.invalid_request: domain does not belong to zone (12130)
│
│ with cloudflare_access_application.wildebeest_access,
│ on main.tf line 165, in resource "cloudflare_access_application" "wildebeest_access":
│ 165: resource "cloudflare_access_application" "wildebeest_access" {
│
╵
Error: Terraform exited with code 1.
Error: Process completed with exit code 1.
I had the same issue.
I went to the KV section, deleted anything there and rerun the deploy.
This seems to fix it.