Running appcfg.py - google-app-engine

I have python + google app engine installed on a windows XP machine. Google App engine is installed in the default directory of python25.
How do I run appcfg.py from command line?
I tried running it after changing directory to python25 but I get an error that the program is not a valid win32.exe
I also tried running it directly from c:\program files\google\google_appengine but I also get an error.
Secondly, I need to run appcfg with the rollback option. How do I do this?
Thanks

you needs to assign python scripts to python.exe or do the following [Path to Python]\python.exe [Path to appcfg]\appcfg.py rollback [path to app].

Related

goapp test not working,getting error "GOPATH must be absolute" while it is absolute

I'm tying to write tests for my google cloud app. I read the documents and it seems the only way to run the test locally is the running the command goapp test in the test package directory. But when I run the command I get the error go: GOPATH entry is relative; must be absolute path: "".
I'm pretty sure my GOPATH is set absolutely. Here are the results when I run the command go env | grep GOPATH:
GOPATH=":/home/mohammad/go:/home/mohammad/go/src/gitlab.com/gc-auth"
Also getting the same output when I run echo $GOPATH.
Any help is appreciated.
PS: I have ubuntu 18.04 and my go version is 1.10.4
results of gcloud version:
Google Cloud SDK 228.0.0
app-engine-go
app-engine-python 1.9.80
bq 2.0.39
cloud-datastore-emulator 2.0.2
core 2018.12.07
gsutil 4.34
GOPATH=":/home/mohammad/go:/home/mohammad/go/src/gitlab.com/gc-auth"
The GOPATH starts with an empty path (which is technically relative), followed by two absolute paths. The error message is correct.

Persmision denied in a fresh installed python google app engine

I am trying to run my server on a Linux mint 18.1 machine on a google app engine.
The following command :
/home/mint/Downloads/google-cloud-sdk/platform/google_appengine/dev_appserver.py --log_level info --storage_path /media/mint/TI31315100A/PycharmProjects/database.db /media/mint/TI31315100A/PycharmProjects/optimallinux
Returns the following error :
bash: /home/mint/Downloads/google-cloud-sdk/platform/google_appengine/dev_appserver.py: Permission denied
I have checked the pathes and the files, everything is right.
Also, I have tried to run the command with sudo and reinstalled the app-engine sevral times, but nothing helped.

Trouble with Google appengine id

I successfully launched an app locally on the local host
When I deployed to the appengine I got an error.
com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=my_id&version=1&
404 Not Found
This application does not exist (app_id=u'my_id').
For some reason the ID given in the error has u and a space appended in the beginning
I doubled checked the application exists and succesfuly uploaded the app from another computer
All the solutions I can find (like "This application does not exist (app_id=xxx)", or "GAE - Deployment Error: “AttributeError: can't set attribute”") mention running appcfg.py with the --no_cookies
C:\Program Files (x86)\Google\google_appengine\appcfg.py
appcfg.py --no_cookies update my-app-folder\
# or (2-steps verificatio enabled)
appcfg.py --oauth2 --no_cookies update my-app-folder\
If the project contains Java7 classes, you need to add the --use_java7 option, as shown in the question "Failed to deploy to Google App Engine because --use_java7 flag has not been set".
While you can run appcfg from the GAE installation path, the page "Using the Google Plugin for Eclipse" mentions (at the bottom of the page):
Some features of the App Engine Java SDK tools are only available by running the tools directly from the command line. If you have installed the SDK using Eclipse, you can run these tools from the Eclipse plugin installation directory.
The SDK is located in your Eclipse installation directory, under plugins/com.google.appengine.eclipse.sdkbundle_VERSION/, where VERSION is a version identifier for the SDK.
In this directory is the appengine-java-sdk/bin/ subdirectory containing the tools.

In which directory do files get downloaded when using download_data command in gae

I am following the instructions at https://developers.google.com/appengine/docs/python/tools/uploadingdata to download data from google app engine. The data gets successfully downloaded (per the python output) but I am not able to find the file on the filesystem.
E.g., For the following command, I get success but I can't find bulkloader.yaml in my computer. I have tried microsoft (Win 7) inbuilt search, google-desktop search, but I get 0 results.
C:\Program Files (x86)\Google\google_appengine>python appcfg.py create_bulkloader_config --filename=bulkloader.yaml --url=http://appname.appspot.com/remote_api
Any help in this regard will be greatly appreciated. Thanks.
Assuming that all worked, the file should be in the same directory from which you started the command appcfg.py. the default directory of command prompt windows is something like C:\Documents and Settings\User. Try to take a look there or restart command from a directory of your choice.
edit: in your case the file is probably in C:\Program Files (x86)\Google\google_appengine

Google App Engine: appcfg.py rollback

I'm using Windows 7 and for the life of me I cannot figure out how to call the rollback function on appcfg.py. All I want to know is what to type into the command prompt so I can rollback my app.
Try this: appcfg.py rollback <directory>
If your application myapp resides in C:\Users\Nilesh\Documents\ then directory path should be C:\Users\Nilesh\Documents\myapp
If you installed Google App Engine Launcher in your system, then installation path should be something like this C:\Program Files\Google\google_appengine
Now open the command prompt and type the following:
C:\Program Files\Google\google_appengine>appcfg.py rollback C:\Users\Nilesh\Documents\myapp
This will solve your issue. :)
The rollback command can rollback a transaction on the server, but you are unlikely to need to use that unless an update of your app failed for some reason. You should be getting some feedback from appcfg.py that such an action is required. Is that what you want to do? If so, just open a command prompt and type appcfg.py rollback.
Otherwise, please let us know what you are trying to accomplish by performing a 'rollback'.
E:\eclipse-jee-indigo-win32\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.6.1.v201201120043r37\appengine-java-sdk-1.6.1\bin>appcfg.cmd rollback E:\AdminApp\Admin\war
For Rollback Java Application
try this :
this was how I did it (all from the command line) which is a slightly simpler
method, which achieved the same effect.....
C:\Documents and Settings\Amit\My Documents\newproject>"C:\Program
Files\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine-java-sdk-1.2.5\bin\appcfg" rollback war
Reading application configuration data...
2009-09-17 20:47:35.859::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
Beginning server interaction for idebanet...
0% Rolling back the update.
Success.
Cleaning up temporary files...
C:\Documents and Settings\Amit\My Documents\newproject>
If you use maven for deploying your app (with goal appengine:update), then you can also run maven with goal appengine:rollback. It solved the issue for me.
I couldn't get mine to work, until I did this:
C:\Program Files (x86)\Google\google_appengine>python appcfg.py rollback "C:\Pro
gram Files (x86)\Google\google_appengine\mirror-quickstart-python"
I had to add in the double quotes and "python" before the appcfg.py
Here is how I did this on my Linux machine (after many trials and errors):
cd ~/.eclipse/org.eclipse.platform_3.5.0_155965261/plugins/com.google.appengine.eclipse.sdkbundle_1.5.1.r35v201106211634/appengine-java-sdk-1.5.1/bin
chmod +x appcfg.sh
./appcfg.sh -s appengine.google.com -e [my-email]#gmail.com rollback /home/erelsgl/workspace/ImitatorGWT/war
Hope this helps.
10, I had this problem little while ago and I have resolved it.
First, I moved to bin directory using:
cd ~/.eclipse/org.eclipse.platform_3.5.0_155965261/plugins/com.google.appengine.eclipse.sdkbundle_1.5.1.r35v201106211634/appengine-java-sdk-1.5.1/bin
Then, I ran the rollback command:
./appcfg.sh rollback /home/workspace/vchat/war
I hope this will help.
Here I have fix it on my ubuntu machine:
cd /home/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.6.5/appengine-java-sdk-1.6.5/bin/
sh ./appcfg.sh -A appId -s appengine.google.com -e youdID#google.com rollback /home/workspace/projectName/war
Hope this helps
For all those who deploy using Google App Engine Launcher, you can fix the issue by opening command prompt and python appcfg.py rollback <directory of your application>
In my case, I have not set up Python env variable so:
C:\Python25\python C:\Program Files\Google\Google App Engine\appcfg.py rollback C:\eclipse\applicatoin
In Linux uploading an App through appcfg creates a staging directory in /tmp
0% Created staging directory at: '/tmp/appcfg8593320566371318406.tmp'
To rollback you may also this directory in rollback command
appcfg.sh -A yourAppId -s appengine.google.com rollback /tmp/appcfg8593320566371318406.tmp
After experiencing quite a it of frustration trying to 'appcfg rollback' on my Mac, I read Jaky's answer and resolved the problem in a couple of minutes by changing the version number.
If you're using eclipse, just open the appengine-web.xml under war>WEB-INF in the project & change the version number there.
Very late to the game, but I'd like to add what worked for me in Windows XP. In a command prompt:
C:\Python27>python C:\Progra~1\Google\google_appengine\appcfg.py rollback C:\Docume~1\myname\MyDocu~1\Projects\myproject\
Python 2.7 and the short names in the Windows path were key.
I am using 64 bit Windows7 with GAE-Java Typing all this detail at the command prompt can be frustrating. My solution: create a batch file.
I created a batch file named 'rollback.bat' & saved it in my WORKSPACE directory. The contents look like this:
cd C:\Users\Organize4Joy\My Code\EclipseWORKSPACE\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.8.3\appengine-java-sdk-1.8.3\bin\appcfg.cmd rollback C:\Users\Organize4Joy\EclipseWORKSPACE\iTreewareMAIN\war
run the batch file by simply typing "rollback"
this local utility changes directory, runs the appcfg rollback EXE & points it to my war directory.
Even better would be to establish a common utility(bin) directory and add it to my path variable. That way I can run this utility from anywhere.
Traverse to the path where the appcfg.py is placed
Run the Command python appcfg.py rollback (The Directory of your project folder)
Open dos
place yourself in the folder containing appcfg.cmd (bin of the GAE SDK)
If your application myapp resides in C:\Users\Nilesh\Documents\ then directory path should be C:\Users\Nilesh\Documents\myapp\war.
Now open the command prompt and type the following:
appcfg.cmd rollback C:\Users\Nilesh\Documents\myapp\war
Note don't forget to add 'war' at then end of your app folder
then enter your email and password
This has been answered many times, but I had issues getting it to work for me too. If you are running Java and are also having problems or if you have Google's 2 factor authentication setup and that is giving you problems, here are the steps I used to make it succeed:
1) Make sure you have the Google App Engine in your Path in Environment variables.
IE: C:\Users\yourUserName\Desktop\Eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.9.18\appengine-java-sdk-1.9.18\bin
2) Open up a command window AS AN ADMINISTRATOR! Do not just type cmd and enter, you need to type cmd, right-click on it, and open as admin
3) First, CD to the folder that has the WAR file in it. In my case, that was:
cd "C:\Users\yourUserName\Documents\MyWorkspace\Project1"
This is the same folder that has the src, .settings, and war folders in it.
4) In the cmd window, type: "appcfg rollback war" and press enter.
5) It will ask for your google credentials. If you do not have 2 factor authentication setup, simply type them in and press enter and you will be set.
6) If you DO have 2 factor authentication setup, go to your google accounts page (Just google for 'google account') and it will be the first or second one.
Next, under the "Signing In" category, go to App passwords.
Next, go to the bottom and under the select app dropdown menu, choose other and type in anything (IE: GAE rollback)
It will give you a password (16 digit random numbers).
Finally, type in your email address in the command window and then type/ paste in this new temporary 16 digit password into the password section.
7) Profit!
-Sil
In my case, I had to use the --no_cookies, without it, I had no premissions to do the operation.
C:\Users\user_name.gradle\appengine-sdk\appengine-java-sdk-1.9.30\bin\appcfg --no_cookies --application=app_name --version=1 rollback C:\projects\android\app\backend\build\exploded-app
I don't know much about these coding things everyone is talking about here..but I found a simple way to update the application..
Select your application and click on "EDIT".
A wordpad file should open up with application details.
Below the application there is version:1
Simply change the version to version:2 instead of 1 and click "Save".
So, instead of updating the same version..you are deploying a new version..
Click on "DEPLOY".
Check your application now!

Resources