【问题标题】:Error posting to URL 400 Bad Request when I try deploy to app engine当我尝试部署到应用引擎时,发布到 URL 400 错误请求时出错
【发布时间】:2016-09-02 05:17:10
【问题描述】:

几个月前,我的应用程序完美部署到 appengine,但我今天尝试部署它,但在日志中出现以下错误:

Beginning interaction for module default...
May 07, 2016 3:46:08 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=%24%7Bapp.id%7D&version=1&
400 Bad Request
Client Error (400)The request is invalid for an unspecified reason.
This is try #0
May 07, 2016 3:46:08 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=%24%7Bapp.id%7D&version=1&
400 Bad Request
Client Error (400)The request is invalid for an unspecified reason.
This is try #1
May 07, 2016 3:46:08 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=%24%7Bapp.id%7D&version=1&
400 Bad Request
Client Error (400)The request is invalid for an unspecified reason.
This is try #2
May 07, 2016 3:46:09 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=%24%7Bapp.id%7D&version=1&
400 Bad Request
Client Error (400)The request is invalid for an unspecified reason.
This is try #3

com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=%24%7Bapp.id%7D&version=1&
400 Bad Request
Client Error (400)The request is invalid for an unspecified reason.

Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=%24%7Bapp.id%7D&version=1&
400 Bad Request
Client Error (400)The request is invalid for an unspecified reason.

Please see the logs [/var/folders/dg/1d63fk7n5r9c05hnbn7z2nx80000gp/T/appcfg6594780979158835679.log] for further information.

我认为问题出在url中指定的app_idhttps://appengine.google.com/api/appversion/getresourcelimits?app_id=%24%7Bapp.id%7D&version=1&

该网址中的app_id%24%7Bapp.id%7D,但实际上是ornate-woodland-130423

这是我的 appengine_web.xml:

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>${app.id}</application>
    <version>${app.version}</version>
    <threadsafe>true</threadsafe>

    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    </system-properties>
</appengine-web-app>

从我的 pom.xml 中提取:

<properties>
    <app.id>ornate-woodland-130423</app.id>
    <app.version>1</app.version>
    <appengine.version>1.9.37</appengine.version>
    <gcloud.plugin.version>2.0.9.89.v20151202</gcloud.plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
</properties>

有没有办法解决这个问题?

【问题讨论】:

  • 解码后的 url 如下所示:https://appengine.google.com/api/appversion/getresourcelimits?app_id=${app.id}&amp;version=1&amp;。似乎 app.id 的变量未设置,请检查或发布您的 pom.xml 和 appengine-web.xml
  • 这很有帮助。在我明确地将 app_id 放入 appengine_web.xml 而不是 ${app.id} 之后,它起作用了。它以前一直有效,但由于某种原因现在不行了。

标签: google-app-engine maven-compiler-plugin appengine-maven-plugin


【解决方案1】:

这不起作用的原因是app.id 需要在appengine_web.xml 中明确指定。因此为什么在 URL 中它说app.id%24%7Bapp.id%7D。正如上面有人指出的那样,这实际上是 ${app.id}。

所以不要像这样隐式设置它;

<application>${app.id}</application>

我把它改成了这个,它工作了

<application>ornate-woodland-130423</application>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-10-10
    • 1970-01-01
    • 2016-06-19
    • 1970-01-01
    • 2018-02-01
    • 2018-06-30
    • 2021-11-22
    • 1970-01-01
    相关资源
    最近更新 更多