通过Google Cloud支持修复的问题:
我从我的 endpoints yaml文件中移除了/ _ah / spi / *处理程序,并且
- url: /.*
script: api.app
没有实例化 endpoints .
自从为以前的版本部署API以来,它曾经工作过,但是对于新版本,没有任何明确的部署endopoints . 所以处理程序需要
handlers:
- url: /_ah/spi/.*
script: api.app
- url: /.*
script: api.app
将问题保存在下面以供参考
我刚刚部署了我的应用程序的新版本,并且调用http://app.appspot.com/_ah/api/app/version/method现在返回404.它在更新之前完美运行 .
但是,日志中根本没有跟踪,并且在调用/ ping这些URI时没有启动实例 .
如果我调用/ _ah / whatever / app / version / method,我仍然有404,但它出现在我的模块日志中,它有以下消息
{"state": "APPLICATION_ERROR", "error_message": "Not Found"}
该应用程序使用模块配置,我的app.yaml定义为
application: appname
version: 2015-04-07
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /_ah/spi/.*
script: api.api.app
- url: /.*
script: www.www.app
secure: always
libraries:
- name: pycrypto
version: latest
- name: endpoints
version: 1.0
- name: webapp2
version: latest
- name: jinja2
version: latest
并且,在api / api.yaml中
application: appname
module: default
version: 2015-04-07
runtime: python27
api_version: 1
threadsafe: true
inbound_services:
- warmup
handlers:
- url: /.*
script: api.app
libraries:
- name: pycrypto
version: latest
- name: endpoints
version: 1.0
- name: ssl
version: latest
我已经更新了应用程序以在管理控制台中提供此新版本,并且所有其他模块都可以正常运行 .
此外,我无法在API资源管理器中看到我的API,https://appname.appspot.com/_ah/api/explorer返回一个空列表(当我在localhost上运行dev服务器时看到它) .
- Update :我刚刚注意到,在GAE cloud endpoints - Api not updating after deploy中查看了@bossylobster的回复,我在"Completed update of a new alternate version"之后的日志中没有"Successfully updated API configuration" . 但是,大概时候我的所有内容都是404.但是,我不知道为什么在我的日志中有这个API删除查询 . 什么可能是错的?
这是一个正在制作的应用程序,因此移动版本目前正在下降 . 如果有帮助,我很高兴将应用程序ID发送给PM中的devrel .