Google Cloud Endpoints在本地运行,在部署时无法运行(Google Cloud Endpoints, works locally, not working when deploye

编程入门 行业动态 更新时间:2024-10-12 10:27:18
Google Cloud Endpoints在本地运行,在部署时无法运行(Google Cloud Endpoints, works locally, not working when deployed)

更新: 当我尝试将版本1(我只有版本)设置为设置> App Engine>版本中的默认版本时,我得到一个奇怪的错误,说“版本无法设置为默认值”这可能导致问题吗? 有关如何修复的任何想法?

原始邮寄: 我一直在开发一个使用Google Cloud Endpoints的项目。 到目前为止,我已经在当地开发了它。 我今天去部署它,有些东西不起作用。 我可以在localhost上访问API和API资源管理器。 所以http://localhost:8080/_ah/api/myapi/v1/test会起作用,但是当我部署它时,它无效。 当我访问http://myapp.appspot.com/_ah/api/myapi/v1/test时,我收到了'Note found'。 对于api资源管理器也是如此,它在本地工作,但当我尝试在部署的URL上使用它时,我什么也得不到。

部署似乎成功:

% appcfg.py update . 07:00 PM Application: struction-api; version: 1 07:00 PM Host: appengine.google.com 07:00 PM Starting update of app: struction-api, version: 1 07:00 PM Getting current resource limits. 07:00 PM Scanning files on local disk. 07:00 PM Cloning 5 application files. 07:00 PM Uploading 2 files and blobs. 07:00 PM Uploaded 2 files and blobs 07:00 PM Compilation starting. 07:00 PM Compilation completed. 07:00 PM Starting deployment. 07:00 PM Checking if deployment succeeded. 07:00 PM Deployment successful. 07:00 PM Checking if updated app version is serving. 07:00 PM Checking if Endpoints configuration has been updated. 07:00 PM Will check again in 1 seconds. 07:00 PM Checking if Endpoints configuration has been updated. 07:00 PM Will check again in 2 seconds. 07:00 PM Checking if Endpoints configuration has been updated. 07:00 PM Completed update of app: struction-api, version: 1 07:00 PM Uploading index definitions.

检查日志或管理日志时,我也看不到任何错误。

以下是日志: Endpoints: https://1-dot-struction-api.appspot.com/_ah/api/structions@v1 Saved

和管理日志:

根据所有文档,这意味着它已经部署没有错误。

问题可能出现在我的app.yaml中吗? 这里是:

application: my-app version: 1 runtime: python27 threadsafe: true api_version: 1 handlers: # Endpoints handler - url: /_ah/spi/.* script: myapi.APPLICATION libraries: - name: pycrypto version: latest - name: endpoints version: 1.0

根据我发现的一切,我正在做的一切正确,但我的API仍然无法加载。 我正在使用NDB,如果这可能是一个因素,但我甚至无法访问没有任何数据存储的API。

如果有人知道这里发生的事情,请提前感谢,非常令人沮丧。

UPDATE: When I try to set version 1 (I only have version) as the default version in Settings>App Engine> Version I get a weird error saying "The version could not be set as the default" Could this be whats causing the problem? Any ideas on how to fix?

ORIGINAL POST: I have been developing a project with Google Cloud Endpoints. So far I have developed it all locally. I went to deploy it today and something isnt working. I can access the API and API explorer when on localhost. So http://localhost:8080/_ah/api/myapi/v1/test will work but when I deploy it, it isn't working. I get 'Note found' when I visit http://myapp.appspot.com/_ah/api/myapi/v1/test. The same is true for the api explorer, it works locally but then I get nothing when I try to use it on deployed URL.

The deploy seems successful:

% appcfg.py update . 07:00 PM Application: struction-api; version: 1 07:00 PM Host: appengine.google.com 07:00 PM Starting update of app: struction-api, version: 1 07:00 PM Getting current resource limits. 07:00 PM Scanning files on local disk. 07:00 PM Cloning 5 application files. 07:00 PM Uploading 2 files and blobs. 07:00 PM Uploaded 2 files and blobs 07:00 PM Compilation starting. 07:00 PM Compilation completed. 07:00 PM Starting deployment. 07:00 PM Checking if deployment succeeded. 07:00 PM Deployment successful. 07:00 PM Checking if updated app version is serving. 07:00 PM Checking if Endpoints configuration has been updated. 07:00 PM Will check again in 1 seconds. 07:00 PM Checking if Endpoints configuration has been updated. 07:00 PM Will check again in 2 seconds. 07:00 PM Checking if Endpoints configuration has been updated. 07:00 PM Completed update of app: struction-api, version: 1 07:00 PM Uploading index definitions.

I also can't see any errors when I check logs or admin logs.

Here are the logs: Endpoints: https://1-dot-struction-api.appspot.com/_ah/api/structions@v1 Saved

and the admin logs:

According to all the docs, this means it has been deployed with no errors.

Could the issue been in my app.yaml? Here it is:

application: my-app version: 1 runtime: python27 threadsafe: true api_version: 1 handlers: # Endpoints handler - url: /_ah/spi/.* script: myapi.APPLICATION libraries: - name: pycrypto version: latest - name: endpoints version: 1.0

According to everything I have found, I am doing everything correctly but my APIs still won't load. I am using NDB if that could be a factor, but I can't even access APIs that don't have any data storage stuff going on.

Thanks in advance if anybody knows thats going on here, very frustrating.

最满意答案

它最终与版本有关。 出于某种原因,新的Cloud Platform管理控制台抛出错误,不允许我将应用程序设置为默认值。

我去了旧的应用程序引擎管理界面,发现左栏上的版本链接,在这里我能够将我的(唯一)版本设置为默认版本。 一切都开始奏效了。

It did end up having to do with the version. For some reason the new Cloud Platform Admin console was throwing the error not allowing me to set the application as default.

I went the old app engine admin interface, found the versions links on the left bar and in here I was able to set my (only) version as the default. Then everything started to work.

更多推荐

本文发布于:2023-07-18 04:31:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1154807.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Endpoints   Cloud   Google   works   deployed

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!