Deploy: fails at "Download Terraform state"
crawfordlong opened this issue · comments
Environment: Following deployment instructions provided by Cloudflare without changes.
Expected behavior: Deployment script completes.
Actual behavior: At the "download Terraform state" step, I am receiving an error "Failed to fetch https://api.cloudflare.com/client/v4/accounts/***/storage/kv/namespaces/750f32f1b078482f80f301a1a4094b76/values/terraform.tfstate - 404: Not Found);" If I visit this URL, substituting in my account ID for "***", I see a status page with the message "Missing X-Auth-Key, X-Auth-Email or Authorization headers." The deploy script then fails.
I have same issue.
In my case, this step was success some times. After resolving another issues which caused at after steps, then this happned.
I had a few failures before this one, but they were all easily resolved based on the errors. I've rerun the script a couple of times and this doesn't resolve itself.
For completeness, I did test the API key after I created it and it is working.
roughly the same issue, but different URL:
✘ [ERROR] Failed to fetch https://api.cloudflare.com/client/v4/accounts/***/storage/kv/namespaces/c3ac9ed9fff1419ca07d1783240a44e3/values/terraform.tfstate - 404: Not Found);
I could fix this issue by deleting KV namespace.
This is written in this issue thread
But there is still another issues in my case.
2023-02-12T02:56:03.9507333Z �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mexpected DNS record to not already be present but already exists�[0m
2023-02-12T02:56:03.9573484Z �[31m│�[0m �[0m
2023-02-12T02:56:03.9583821Z �[31m│�[0m �[0m�[0m with cloudflare_record.record,
2023-02-12T02:56:03.9584394Z �[31m│�[0m �[0m on main.tf line 145, in resource "cloudflare_record" "record":
2023-02-12T02:56:03.9585004Z �[31m│�[0m �[0m 145: resource "cloudflare_record" "record" �[4m{�[0m�[0m
2023-02-12T02:56:03.9585591Z �[31m│�[0m �[0m
2023-02-12T02:56:03.9585897Z �[31m╵�[0m�[0m
2023-02-12T02:56:03.9625339Z ##[error]Terraform exited with code 1.
2023-02-12T02:56:03.9650715Z ##[error]Process completed with exit code 1.
It may caused because I try to reuse my root domain.
I replaced domain name with some sub domain and resolved some issues reported this thread, then everything worked well (:
going back through "Troubleshooting \ Starting over" and removing everything from previous runs worked for me.
@crawfordlong sounds like your issue has been solved since. Feel free to reopen the issue if needed