google_cloud_run_service return 创建期间带有正文的 HTTP 响应 404

google_cloud_run_service return HTTP response 404 with body during creation

google_cloud_run_service.skills-online: Creating...  
Error: Error creating Service: googleapi: got HTTP response code 404 with body:  
<title>Error 404 (Not Found)!!1</title> <style> *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px} </style>
    404. That’s an error.

    The requested URL /apis/serving.knative.dev/v1/namespaces/skills-online/services was not found on this server. That’s all we know.

    on main.tf line 11, in resource "google_cloud_run_service" "skills-online":
    11: resource "google_cloud_run_service" "skills-online" {

使用基础架构即代码地形创建 google 云 运行 在 $ terraform apply return 带有正文的 HTTP 响应 404 之后,在创建期间

Terraform 版本 地形版本:v0.12.24 Google 提供商:v3.19.0

Terraform 配置文件

    provider "google" {
      credentials = file("skills-online.json")
      project = "skills-online"
      region = "asia-south1"
    }

    resource "google_project_service" "run" {
      service = "run.googleapis.com"
    }

    resource "google_cloud_run_service" "skills-online" {
      name = "skills-online"
      location = "asia-south1"

      template {
        spec {
          containers {
            image = "gcr.io/skills-online/imagename"
          }
        }
      }

      traffic {
        percent = 100
        latest_revision = true
      }
    }

terraform.tf 文件受影响的资源 google_cloud_run_service

调试输出文件 https://gist.github.com/Ameen-Alam/7765d293028a9fd7b29630edfb8e45a3

预期行为 已创建云 运行 服务

重要事实

    image = "gcr.io/skills-online/imagename"
    image = "gcr.io/skills-online/---------------"
due to security reason, I wrote the name of the image as a dummy

Ameen Alam 打开了这个问题 https://github.com/terraform-providers/terraform-provider-google/issues/6258

google 云 运行 服务在 asia-south1 区域不可用

这就是为什么 "Error creating Service: googleapi: got HTTP response code 404 with body:" 正在发生,在创建期间 google_cloud_run_service

我根据这个列表更改了代码中的区域 https://cloud.google.com/run/docs/locations.

我选择了asia-east1(台湾)地区

错误已解决。

已关闭此问题 https://github.com/terraform-providers/terraform-provider-google/issues/6258