【问题标题】:error : domain is already mapped to a project in google cloud platform错误:域已映射到谷歌云平台中的项目
【发布时间】:2018-07-31 01:00:26
【问题描述】:

我在谷歌云平台中映射域时遇到问题,所以我刚刚验证了我的域,但后来我遇到了这个问题

但问题是我还没有将我的域添加到我的项目中,如下图所示

所以我没有将“w3youtube.com”添加到映射或创建任何 dns 记录,但我仍然拥有www.w3youtube.com is already mapped to a project.

我该怎么办?为了删除映射或解决这个问题?

【问题讨论】:

  • 1年后,这个问题还在。
  • 我觉得你兄弟..

标签: dns google-cloud-platform


【解决方案1】:

截至 2018 年,仅命令行请求对我不起作用。对我有用的是来自 Google Group here 的这些说明。总之,

  1. 前往API Explorer

  2. 按以下格式填写表格:

  3. 确保启用 OAuth 并执行请求。

  4. 如果成功,您将看到如下响应:

    200
    
    - Show headers -
    
    {
     "name": "apps/example/operations/abcde-efgh-ijkl-mnop
     "metadata": {
      "@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1",
      "method": "google.appengine.v1.DomainMappings.CreateDomainMapping",
      "insertTime": "2018-03-16T03:44:49.167Z",
      "user": "you@example.com",
      "target": "apps/example/domainMappings/example.com"
     }
    }
    

    重要提示:您需要运行此请求两次 - 一次为您的域(没有 www(example.com))运行。还有一次使用 www (www.example.com)。我错过了这一步,我的应用停止为 www.example.com 提供服务。

  5. 要(重新)启用 SSL 支持: 返回到您的云控制台,然后是 AppEngine 域设置,然后单击“启用托管安全”按钮,如下所示:

  6. 如果仍然不起作用,您可以从控制台中删除域,然后使用以下命令通过命令行重新添加:

    gcloud beta app domain-mappings create <domain name>
    

    请记住,只有在您通过 API 资源管理器运行请求后,上述命令才会起作用。

希望这会有所帮助。

干杯。

【讨论】:

  • 如果你使用gcloud app domain-mappings create,它现在会给你一个有用的错误,你需要这个标志。遵循这些说明对我有用。完整的错误是:App [project-id] is the subject of a conflict: Domain 'www.example.com' is already mapped to another application. You must delete the existing domain mapping before you can re-map the domain, or you may specify 'DomainOverrideStrategy.OVERRIDE' on the request to force overwrite the existing mapping. Domain 'www.example.com' is currently mapped to an application on which you do not have permissions.
  • 截图没有出现。所以我在这里记录我的参数。 overrideStrategy=OVERRIDE, Request.body.id=example.com
【解决方案2】:

简单的步骤:

  1. 尝试使用以下命令映射域:gcloud app domain-mappings create &lt;domain&gt;
  2. 然后你会看到类似:&lt;your_domain&gt; is currently mapped to application '&lt;project&gt;'.
  3. 并且在您知道哪个项目使用该域后,您可以使用以下命令轻松删除映射的一个:gcloud --project &lt;project_name&gt; app domain-mappings delete &lt;your_domain&gt;

【讨论】:

  • 谢谢,它对我有用。只需为每个 https:// 和 www 运行相同的删除代码。和子域。
【解决方案3】:

尝试使用 gcloud 命令行工具,而不是使用 Web 控制台。我能够通过它解决。 gcloud beta app domain-mappings create <domain name> 此外,在上述命令中使用 beta 将自动为 SSL 添加托管证书。

【讨论】:

  • 它对我有用。实际上,该命令并没有为 www 添加 CNAME 记录,而是添加了所有其余记录。之后,我能够在管理控制台中查看和管理它们,因此我删除并重新创建了所有它们。当然,在开始映射域之前,请确保没有将另一个帐户/项目映射到它。
  • 这仍然有效。谢谢!从命令行添加后,它会显示在 console.cloud.google.com
猜你喜欢
  • 2021-10-11
  • 2020-12-11
  • 2019-10-31
  • 2016-08-23
  • 1970-01-01
  • 2020-07-23
  • 1970-01-01
  • 2019-08-16
  • 2020-01-11
相关资源
最近更新 更多