3

I'm trying to make a rollback due a deploy failed, my server code is on java, and also i'm using App Engine Eclipse PlugIn for. my appcfg.sh file is located at /Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/appcfg.sh


but i get "Command not Found" when i try this sudo /Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/appcfg.sh rollback /Documents/workspace/server_side/war

I can't realize what's wrong. i don`t know if is the right appcfg, because there is appcfg.cmd and appcfg.sh, i'm using an imac(Unix enviro) so i use the appcfg.sh to made the rollback. i've tried in several different ways. and nothing good happen. maybe i'm missing something. thanks!

Dan Holevoet
  • 9,183
  • 1
  • 33
  • 49
AXSM
  • 1,142
  • 1
  • 12
  • 27
  • What happens when you run `/Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/appcfg.sh` without any arguments? – R Samuel Klatchko Feb 26 '13 at 22:26
  • Nothing, just says command not found. like this `sudo: /Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/appcfg.sh: command not found` – AXSM Feb 27 '13 at 01:11

5 Answers5

10

It does not have execute permission by default:

-rw-r--r--  1 yorkw  staff   558 11 Dec 06:01 appcfg.sh

Run chmod 755 appcfg.sh to change the permission:

-rwxr-xr-x  1 yorkw  staff   558 11 Dec 06:01 appcfg.sh

Then you should be able to run it in terminal.

yorkw
  • 40,926
  • 10
  • 117
  • 130
  • Hi @yorkw, I've typed `chmod 755 appcfg.sh`, the issue still happen. it says `-bash: appcfg: command not found` when i try to rollback. – AXSM Feb 27 '13 at 20:02
  • type `cd /Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/`, then type `chmod 755 appcfg.sh`. – yorkw Feb 27 '13 at 20:09
  • 1
    this is the output: `total 64 -rw-r--r-- 1 useami03 staff 286 Feb 5 12:18 appcfg.cmd -rwxr-xr-x 1 useami03 staff 558 Feb 5 12:18 appcfg.sh -rw-r--r-- 1 useami03 staff 368 Feb 5 12:18 dev_appserver.cmd -rw-r--r-- 1 useami03 staff 636 Feb 5 12:18 dev_appserver.sh -rw-r--r-- 1 useami03 staff 940 Feb 5 12:18 endpoints.cmd -rw-r--r-- 1 useami03 staff 1100 Feb 5 12:18 endpoints.sh -rw-r--r-- 1 useami03 staff 196 Feb 5 12:18 google_sql.cmd -rw-r--r-- 1 useami03 staff 479 Feb 5 12:18 google_sql.sh` – AXSM Feb 27 '13 at 20:23
  • 3
    @AlexSanchez, if you are in that directory, try `./appcfg.sh`. – yorkw Feb 27 '13 at 20:25
  • it works, thanks, but i'm still missing some arguments to commit the rollback i think. – AXSM Feb 27 '13 at 20:29
  • i'd like to continue on chat. – AXSM Feb 27 '13 at 20:35
  • @AlexSanchez, chat room [here](http://chat.stackoverflow.com/rooms/25249/room-for-yorkw-and-alexsanchez). – yorkw Feb 27 '13 at 20:43
  • @AlexSanchez Could we have so the right solution at the problem? Becuase i'm still stuck – Aerox Mar 20 '14 at 16:06
  • 2
    You also need to elevate the permissions for run_java.sh. Do 'chmod +x run_java.sh' – fIwJlxSzApHEZIl Oct 20 '14 at 21:34
  • I also had to create app password. https://support.google.com/accounts/answer/185833 – Shajeel Afzal Jun 17 '15 at 07:27
5

I also encountered the same problem as the original poster of this question, but I still got a permission denied error when attempting to rollback, even after changing the permissions of the appcfg.sh file.

It turned out I also needed to chmod 755 run_java.sh (located in the same directory as appcfg.sh), and then I was able to rollback without problems.

I thought I would post this in case anyone encountered the same set of issues that I did.

user3627269
  • 51
  • 1
  • 1
2

For anyone else who stumbles upon this and wants more detail...

In Terminal go to GAE-SDK-PATH/bin (where appcfg.sh is located) for instance:

/Applications/Eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.8.3/appengine-java-sdk-1.8.3/bin

You may not have enabled permissions with appcfg.sh, so do what @yorkw suggested if you are getting 'Permission Denied', in the bin directory type:

chmod 755 appcfg.sh

then to rollback type

./appcfg.sh --email=PROJECT_EMAIL --passin rollback ROOT_PROJECT_FOLDER/war

You will be prompted to enter the password for the project email, and then it should work! Google doc: https://developers.google.com/appengine/docs/java/tools/uploadinganapp

jwilkey
  • 326
  • 3
  • 11
1

Maybe you made the same silly oversight as me and left out "sh" at the beginning? i.e.

sh /Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/appcfg.sh rollback /Documents/workspace/server_side/war
scyntl
  • 53
  • 5
0

Use the following commands on OSX. Note the appcfg.sh doesn't have execute permission by default so you need to add it via chmod.

cd /Users/Labuser/Downloads/appengine-java-sdk-1.9.22/bin

chmod 755 appcfg.sh

sh appcfg.sh rollback /Users/Labuser/Ducuments/AndroidWS/AndroidStudioProjects/AndroidProject/modulebackend/src/main/webapp/
Hamzeen Hameem
  • 2,360
  • 1
  • 27
  • 28