How do I execute the command 'appcfg rollback'?

17,057

Solution 1

You want appcfg.sh rollback (which is in path_to_your_app_engine_sdk/bin/). appcfg comes in different variants for each type of runtime (Python, Java, Go), so the suggested command is a bit generic.

If, for whatever reason, you don't have easy access to the entire war directory of your project (if, for example your IDE only gives you a .war file), you can do the following:

  1. Make a directory named war.
  2. Inside the war folder make another directory and name it as WEB-INF.
  3. In the folder WEB-INF drop two xml files, namely web.xml and appengine-web.xml. These should have the contents of your deployed web.xml and appengine-web.xml files respectively.

Then run the following shell command (this assumes you execute it from the bin directory of the App Engine Java SDK):

[non-admin@user bin]$ ./appcfg.sh rollback /home/non-admin/NetBeansProjects/PersonalSite/web/war

If you are using the Go appengine tools, then you'll need to run:

$ cd [your go_appengine directory]
$ ./appcfg.py rollback [your app directory with app.yaml in it]

Solution 2

If you are using windows, follow the same steps given above and run command in DOS prompt..

C:\eclipse-jee-helios-win32\eclipse\plugins\com.google.appengine.eclipse.sdkbund le_1.7.3\appengine-java-sdk-1.7.3\bin> appcfg.cmd rollback "C:\home\myweb\war"

Solution 3

Another easy way is given below:

  1. to change the version number in app.yaml...
  2. then deploy new version,
  3. and finally delete the old version via google app engine webform

Edit:

to answer dg99's question: the version code you need to change is up to you (it is the version of your application)

Solution 4

If you are using eclipse & maven build envrioment, maybe you are uploading application by maven command, appengine:update, right ?

Then, when you have a problem like that "409 Conflict". You can use maven command on eclipse->project->run as->maven build...-> "appengine:rollback"

Try this. I solved problem by this way

Solution 5

This works for me!! (Win OS)

C:\eclipse-jee-helios-win32\eclipse\plugins\com.google.appengine.eclipse.sdkbund le_1.7.3\appengine-java-sdk-1.7.3\bin> appcfg.cmd rollback C:\home\myweb\war

Share:
17,057

Related videos on Youtube

Suhail Gupta
Author by

Suhail Gupta

"There's nothing more permanent than a temporary hack." - Kyle Simpson "The strength of JavaScript is that you can do anything. The weakness is that you will." - Reg Braithwaite I am on internet Twitter @suhail3 E-mail [email protected]

Updated on July 13, 2022

Comments

  • Suhail Gupta
    Suhail Gupta almost 2 years

    While uploading the project , there was a network failure and I had to stop, when the uploading process was only 31% complete. Now when I click to deploy application to google app engine the following message is produced :

    com.google.appengine.tools.admin.HttpIoException: Error posting to URL: 
    https://appengine.google.com/api/appversion/create?app_id=programworks&version=1&
    409 Conflict
    Another transaction by user suhailgupta03 is already in progress for app: 
    s~programworks, version: 1. That user can undo the transaction with 
    "appcfg rollback".
    
    Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=programworks&version=1&
    409 Conflict
    Another transaction by user suhailgupta03 is already in progress for app: 
    s~programworks, version: 1. That user can undo the transaction with "appcfg rollback".
    

    I open my shell prompt and type in there appcfg rollback but I get a message that this command is not found.I have installed google app engine as a plugin for netbeans.

    The path where I have kept the jars of google app engine : /home/non-admin/appengine-java-sdk-1.6.6/lib/

    Please tell what should I do to rollback the previous process ? I badly need to upload the war file.!

  • Suhail Gupta
    Suhail Gupta over 11 years
    appcfg.sh rollback after being inside the directory bin
  • Dan Holevoet
    Dan Holevoet over 11 years
    Which bin is it? Is bin in your $PATH? If it's the sdk/bin/ you might try using ./appcfg.sh rollback instead.
  • Suhail Gupta
    Suhail Gupta over 11 years
  • Suhail Gupta
    Suhail Gupta over 11 years
    I tried the ./appcfg.sh rollback command after being inside the bin directory the server's sdk and this is what message I got. What is the reason for this ?
  • Dan Holevoet
    Dan Holevoet over 11 years
    Can you do an ls of the directory you are in? Is there a file named appcfg.sh in there?
  • Suhail Gupta
    Suhail Gupta over 11 years
    Is there anything I am missing ??
  • Dan Holevoet
    Dan Holevoet over 11 years
  • AXSM
    AXSM about 11 years
    Hi.@DanHolevoet, I don't really konw if u can see this message, but BTW. Why if i've typed sudo appcfg.cmd rollback "/Documents/workspace/server side/war" from the appcfg's dir i'm still getting this error sudo: appcfg.cmd: command not found, and all files inside war dir are ok. appreciate it.
  • dg99
    dg99 over 10 years
    Answering an ancient, resolved question is probably only going to be helpful if you include the same level of detail as the accepted answer. What code is required to change the version number in app.yaml? What is an example of the before and after of that change? How does one deploy a new version? etc.
  • Tino
    Tino about 10 years
    I just wanted to help others which are running into the same issue as I did (i dont care how old this thread is - I had this problem these days so maybe others are interested to). Yes it was already resolved but I give a different solution which is more easy and faster so I just thought it helps.
  • Neil
    Neil almost 10 years
    If you are using maven, the bin dir would be similar to /.m2/repository/com/google/appengine/appengine-java-sdk/1.9.‌​4/appengine-java-sdk‌​/appengine-java-sdk-‌​1.9.4/bin
  • Zied Hamdi
    Zied Hamdi over 9 years
    When the .sh file has no executable priviledges, the message file not found is displayed. select all files in the bin directory, right click and select "properties" in the privildges tab check the executable checkbox
  • Micro
    Micro about 8 years
    This helped me in Android Studio. I updated the version number in appengine-web.xml
  • Shajeel Afzal
    Shajeel Afzal about 8 years
    It says: Either the access code is invalid or the OAuth token is revoked.Details: invalid_grant
  • ssw
    ssw almost 8 years
    Thank you. This answer is what I need. In addition to your step, you may have to upgrade your appengine sdk. You may get "Bad authentication response: 404 Not Found" if you have older appengine sdk. Older sdk uses google.com/accounts/ClientLogin, which is deprecated. We need to move to newer sdk to use oauth2. Newer sdk will redirect you to browser to login and gives you a code. Copy and paste the code back to the command prompt.