Solving Google App Engine Deployment Time Error #409 “Rollback”

DZone 's Guide to

Solving Google App Engine Deployment Time Error #409 “Rollback”

· Cloud Zone ·
Free Resource

Fellow geeks, if you had an App Engine application and if things go awry while deploying, you may need to roll it back. You will get a message like this when things are messed up and you try to “Deploy Application”:

08:21 PM Host: appengine.google.com

08:21 PM Application: dev-nirvana; version: secureable

08:21 PM

Starting update of app: dev-nirvana, version: secureable

08:21 PM Getting current resource limits.

Password for developers.nirvana@gmail.com: 08:21 PM Scanning files on local disk.

Error 409: --- begin server output ---

Another transaction by user developers.nirvana is already in progress for app: s~dev-nirvana, version: secureable. That user can undo the transaction with "appcfg rollback".

--- end server output ---

2015-01-27 20:21:26 (Process exited with code 1)

You can close this window now.

I have searched corners of net for finding a solution for this but ended up with incomplete and improper answers that the experts have suggested. No proper solution is available for Erro#409 concerned with deploying Java applications on Google’s App Engine using Eclipse IDE.

The possible reason for the above can be the network failure, which is 99% the case with all the geeks who face this. Your application would’ve stopped at a given value (say 78% as in my case). Now when you click to deploy application to google app engine the above message is produced.

As the picture itself says, you need to fire the “appcfg” command with “rollback” action.

Now here comes the actual part.

o  What is appcfg?

o  Where is appcfg located?

o  What is rollback action?

o  How to fire appcfg command?

1.  The App Engine SDK includes a command for interacting with engine called appcfg. You can use this command to upload new versions of your app's code, and its configuration and static files. You can also use this command to manage datastore indexes and download log data. A version of appcfg is included with the SDK for each runtime environment. (Java, Python, PHP, GO).

2.  The appcfg.bat file is located inside the \bin of the app engine sdk, regardless of the language runtime you installed. If you downloaded AppEngine via Eclipse plugin then you can find it inside “(your-eclipse-location)\ plugins\ com.google.appengine.eclipse.sdkbundle\appengine-java-sdk-1.9.8\bin”

Else if you have downloaded a standalone sdk from google, it would be located at “(your-drive_name)\ appengine-java-sdk-1.9.8\appengine-java-sdk-1.9.8\bin”

3.  Now the “rollback” undoes a partially completed update for the given application. You can use this if an update was interrupted, and the command is reporting that the application cannot be updated due to a lock.

4.  To solve the deployment time Error#409 you need to open your command prompt and you need to type the fully qualified path-name for appcg (till \bin) IN DOUBLE QUOTES, followed by “rollback” followed by the fully qualified name of your application (eclipse project) till \war, IN DOUBLE QUOTES.

MAKE SURE TO INCLUDE \war SINCE IT IS THE PLACE WHERE THE appcfg WILL FIND THE required files for deployment.

The following snapshot might prove useful which I did for myself

I have specified the option ‘-A’ here which is your app engine application identifier, ‘nirvana-it-edge’ in my case.

This is not a mandatory field, though it is recommended.

You will be prompted for the google’s username and password for the specified app engine application. (See the snapshot below).

After successful authentication, the rollback action would be performed and you would be go-ready for the re-deployment process. You wont receive any error#409

However there are some cases when the appcfg command doesn’t seem to work as stated above. (Happened with me). In such cases, provide two more options “—oauth2” and “--passin” (as you can see in the image below). These optional parameters will open the default browser of your system and will take you to the Google’s authentication page. Fill in your credentials and a CODE will be displayed. COPY THAT CODE FROM BROWSER AND PASTE IT IN THE COMMAND PROMPT which is awaiting for the code.

That’s it, your application will be rolled back and you are good to go like new.

The image below illustrates the ending of process:-

I hope this article have proved useful.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}