Google cloud platform Terraform apply无法在Google云平台上保存状态:HTTP错误:308

Google cloud platform Terraform apply无法在Google云平台上保存状态:HTTP错误:308,google-cloud-platform,gitlab,terraform,nodes,Google Cloud Platform,Gitlab,Terraform,Nodes,我在尝试terraformapply在Google上启动几个节点时出错,只是为Kubernetes上的GitLab Ci/CD管道准备infra terraform apply -auto-approve -lock=false google_container_cluster.default: Creating... google_container_cluster.default: Still creating... [10s elapsed] Failed to save s

我在尝试
terraformapply
在Google上启动几个节点时出错,只是为Kubernetes上的GitLab Ci/CD管道准备infra

terraform apply -auto-approve -lock=false       
google_container_cluster.default: Creating...
google_container_cluster.default: Still creating... [10s elapsed]
Failed to save state: HTTP error: 308


Error: Failed to persist state to backend.

The error shown above has prevented Terraform from writing the updated state
to the configured backend. To allow for recovery, the state has been written
to the file "errored.tfstate" in the current working directory.

Running "terraform apply" again at this point will create a forked state,
making it harder to recover.

To retry writing this state, use the following command:
    terraform state push errored.tfstate

感谢
Michael Crilly
@ninja
@ashishonnet
对DevOps LoungeDiscord社区的建议,对
后端“http{}
行进行评论,并尝试其他一些事情。实际上,在谷歌云平台上的HTTP错误:308上,评论工作正常

多亏了
@guillaume blaquiere
,当他发现我使用项目名称而不是项目ID时,他是正确的

provider "google" {
 credentials = file("~/gitops-project-290611-01b6aabd6093.json")
 project     = "gitops-project-290611"
 region      = "us-central1-a"
}

terraform似乎无法写入状态文件。您是否尝试将地形状态文件复制到本地环境并重新运行
terraform apply
命令?您的.tfstate保存在哪里?308错误代码=“永久重定向”,这意味着在用于持久化.tfstate的任何东西上都可能存在DNS/服务器错误。它位于我的本地环境中。我还没有将它移动到GitLab,只是第一次运行它。也在谷歌云上开启Kubernetes服务,但它要求我添加一张新的非虚拟卡,并增加新项目的配额。已经完成并等待批准:)UPD:得到一个建议,对行
后端“http”{}
进行注释。我以前的GC帐户有问题,放弃并注册了一个新帐户。无法确定如何添加角色,错误:
错误403:Required“container.clusters.create”
。已尝试此脚本:
gcloud项目添加iam策略绑定gitops-project-290611--role=roles/container.clusters.admin--member=serviceCount:gitops-webinar@gitops-project-290611.iam.gserviceaccount.com
,收到错误:
错误:(gcloud.projects.add iam策略绑定)无效的参数:此资源不支持角色/container.clusters.create
。地形原木。