英文:
Google App Engine Task Queue: googleapi: Error 500: Backend Error
问题
我已经为我的应用程序引擎应用程序定义了一个拉取队列,并希望通过 REST API 从外部填充它。
不幸的是,它不起作用,我总是收到一个错误500:后端错误。
即使我尝试使用文档中的 API Explorer 填充它。
它的响应是:
500 Internal Server Error
- 显示头部信息 -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
有什么办法可以解决这个问题吗?
英文:
I've defined a pull queue for my app engine application and want to fill it from outside via the REST api.
Unfortunately it doesn't work, I always get an error 500: backend error.
Even if I try to fill it with the api explorer from the documentation.
It responses:
500 Internal Server Error
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
Any idea how to solve it?
答案1
得分: 3
你能粘贴一下你正在进行租赁操作的代码吗?一个常见的错误是忘记在你的App Engine项目中包含"s~"。例如,如果你的应用程序ID是"my-awesome-app",那么你调用的是:
tq.get(project='my-awesome-app', taskqueue=PULL_QUEUE_NAME...
而你应该调用的是:
tq.get(project='s~my-awesome-app', taskqueue=PULL_QUEUE_NAME...
(感谢bossylobster提供的原始答案:https://stackoverflow.com/questions/17063073/pull-queues-authorization-from-compute)
英文:
Can you paste your code that is doing the leasing? One common mistake is forgetting to include the s~ in your App Engine Project. For example, if your application ID is my-awesome-app, then you are calling
tq.get(project='my-awesome-app', taskqueue=PULL_QUEUE_NAME...
when you should be calling
tq.get(project='s~my-awesome-app', taskqueue=PULL_QUEUE_NAME...
(thanks to bossylobster for this original answer: https://stackoverflow.com/questions/17063073/pull-queues-authorization-from-compute)
答案2
得分: 3
同时,事实证明你必须在JSON主体中提供queueName
,除了payloadBase64
之外,这是由Frank Ren在这个帖子中发现的。
英文:
Also it turns out you must supply the queueName
in the JSON body, in addition to payloadBase64
, as discovered by Frank Ren in this thread
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论