google-app-enginemaven-compiler-pluginappengine-maven-plugin

Error posting to URL 400 Bad Request when I try deploy to app engine


A few months ago my application was deploying perfectly to appengine but I tried to deploy it today but I got these errors in the log:

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.

I think the problem comes from the app_id specified in the url; https://appengine.google.com/api/appversion/getresourcelimits?app_id=%24%7Bapp.id%7D&version=1&

The app_id in that url is %24%7Bapp.id%7D but it is actually ornate-woodland-130423

Here is my 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>

Extract from my 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>

Is there anyway I can fix this?


Solution

  • The reason this wasn't working was because the app.id needs to be specified explicitly in appengine_web.xml. Hence why in the URL it said the app.id was %24%7Bapp.id%7D. Which is actually ${app.id} as someone above pointed out.

    So instead of setting it implicitly like this;

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

    I changed it to this and it worked

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