我正在使用Cloud Endpoints Frameworks(2.0.1)for Java作为我最后一年的项目的一部分,并已迄今为止相对成功。 我在部署到我的appspot.com域时没有任何问题,但是,在本地部署时遇到了一些问题。com.google.api.config.ServiceConfigSupplier - 无法获取服务的默认配置版本(仅在本地主机上)
(下面的代码块到我的项目-ID的任何引用是我的实际谷歌云项目编号别名)
我有一个注释@API类的有效OpenAPI的描述符(openapi.json)的我正在使用“gcloud服务管理部署openapi.json”部署到云端点。 成功的命令返回:
Service Configuration [2017-02-23r0] uploaded for service [api.endpoints.<my-project-id>.cloud.goog]
我然后映射回到config_id正确endpoints_api_service在我的app.yaml
endpoints_api_service:
name: api.endpoints.<my-project-id>.cloud.goog
config_id: 2017-02-23r0
该服务通过使用“gcloud服务管理的gcloud CLI工具上市列表”
NAME TITLE
storage-component.googleapis.com Google Cloud Storage
api.endpoints.<my-project-id>.cloud.goog api.endpoints.<my-project-id>.cloud.goog
etc...
和 “gcloud服务管理CONFIGS列表--service api.endpoints.my-project-id.cloud.goog”
CONFIG_ID SERVICE_NAME
2017-02-23r0 api.endpoints.<my-project-id>.cloud.goog
... other version configs
,并在我的appspot.com域名访问(我可以叫端点和接收正确的响应)
我试图使用Java的行家的AppEngine插件(MVN在本地主机上部署我的项目AppEngine上:devserver),但在码头启动时我被击中但下列情况除外:
WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext...
com.google.api.config.ServiceConfigException: Failed to fetch default config version for service 'api.endpoints.<my-project-id>.cloud.goog'. No versions exist!
at com.google.api.config.ServiceConfigSupplier.fetchLatestServiceVersion(ServiceConfigSupplier.java:155)
....
部署,然后卡在试图启动码头,和被打与该错误消息,并重新启动无限循环等等。任何访问localhost:8080的尝试都会导致a “503:未找到服务”错误
我认为我的应用程序的本地部署将能够访问使用“gcloud service-management deploy”部署的服务配置,方式与appspot.com相同部署可以,但情况并非如此?我收集serviceManagement.services().configs().list(my-service-name).execute()。getServiceConfigs()返回一个空的列表,但为什么是这个只发生在本地?
额外信息
我ENDPOINTS_SERVICE_NAME环境变量匹配 'api.endpoints.my-project-id.cloud.goog'
我注意到,有一个更新(1.0.2)对COM .google.api.config,它依赖于旧版本的com.google.api.services.servicemanagement(依赖于v1-rev14-1.22.0,最新版本为v1-rev340-1.22 .0) 我怀疑这是问题,但我想我会提及它,因为它包含与异常相关的类(ServiceManagement由ServiceConfigSupplier使用,它是thr由于例外)。也许他们在寻找服务配置的地方存在不一致?
我很难过tbh,这有点凌驾于我的头上。我不喜欢删除端点,因为我开始喜欢它,但我们也不能真正失去我们的devserver的使用。我希望有人可以在这个问题上谈一点点。
你是否解决了这个问题?我正在使用Java并且有相同的问题。 –
您好萨姆霍尔登,你能解决这个问题吗?与此相关的文件最近更新了。 https://cloud.google.com/endpoints/docs/frameworks/java/quickstart-frameworks-java 还有设在这里的样本: https://github.com/GoogleCloudPlatform/java-docs -samples/tree/master/appengine/endpoints-frameworks-v2/backend 让我知道!谢谢。 –
@FrankNatividad我在您的链接中提供的快速入门之后,几乎看到了这个确切的错误。 – Benjamin