google-app-engine - 迁移到 Google Endpoints V2 后出现 404

标签 google-app-engine google-cloud-endpoints-v2

我们已经在我们的应用程序中成功使用 Endpoints V1 几年了。现在,当尝试迁移到 Endpoints V2 时,它突然因为找不到 EndpointsServlet 而突然刹车,并且总是返回 404。

  • 我可以使用 https://apis-explorer.appspot.com/apis-explorer/ 浏览 api
  • 我可以看到请求到达后端以及我正在使用的一个过滤器
  • 但它从未找到/到达 EndpointsServlet 或任何端点
  • 奇怪的是它在本地主机开发服务器上工作??

这仍然是一个已知问题(对于某些应用程序)或者我该如何解决该问题?

404 响应如下所示:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "\u003chtml\u003e\u003chead\u003e\n\u003cmeta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\"\u003e\n\u003ctitle\u003e404 Not Found\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody text=#000000 bgcolor=#ffffff\u003e\n\u003ch1\u003eError: Not Found\u003c/h1\u003e\n\u003c/body\u003e\u003c/html\u003e\n"
   }
  ],
  "code": 404,
  "message": "\u003chtml\u003e\u003chead\u003e\n\u003cmeta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\"\u003e\n\u003ctitle\u003e404 Not Found\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody text=#000000 bgcolor=#ffffff\u003e\n\u003ch1\u003eError: Not Found\u003c/h1\u003e\n\u003c/body\u003e\u003c/html\u003e\n"
 }
}

最佳答案

解决方案是在使用 Endpoints V2 部署应用程序时使用全新的未使用的版本名称,而不是:

https://test-dot-[app_id].appspot.com (this used previously Endpoints V1)

使用全新的版本名称,例如

https://test-new-dot-[app_id].appspot.com

正如这里所说:https://cloud.google.com/endpoints/docs/known-issues

"...you must currently deploy to a new App Engine app version. Reusing an old app version may conflict with the old Endpoints deployment..."

关于google-app-engine - 迁移到 Google Endpoints V2 后出现 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49133695/

相关文章:

node.js - 从连接到 Google Functions 的端点调用时,Firebase ID token 的 "aud"(受众)声明不正确

eclipse - 如何在 Mac OS X 的 .app 中选择一个文件?

node.js - 仅在 Azure AD 登录上使用 GCP 自定义域时,GCP 和 Azure : AADSTS700016:You may have sent your authentication request to the wrong tenant. 错误

java - 谷歌应用程序引擎上的 Cron 工作每周只有五天

python - 将数据从应用程序引擎(python)发送到远程服务器(带 php 的 linux)

google-app-engine - 迁移到 Google Cloud Endpoints v2

firebase - Google Cloud Endpoints + Firebase 身份验证 : method_info is not set

firebase - Google 端点错误 : Firebase ID token has incorrect "aud" (audience) claim. 预期...但得到

java - 具有非默认应用引擎服务的 Google Cloud Endpoints v2 自定义域

python - 坏值错误 : Indexed value message_text must be at most 1500 bytes