google app engine python uploading application first time - google-app-engine

i'm trying to upload my app engine project for the very first time and i have no clue why it is not working. the error from my terminal is:
[me][~/Desktop]$ appcfg.py update ProjectDir/
Application: tacticalagentz; version: 1
Host: appengine.google.com
Starting update of app: tacticalagentz, version: 1
Scanning files on local disk.
Error 404: --- begin server output ---
This application does not exist (app_id=u'tacticalagentz').
--- end server output ---
i'm using python 2.6.5 and ubuntu 10.04.
not sure if this is relevant, but i just created a google app engine account today. and i also just created the application today (like a couple of hours ago). this is really frustrating because i just want to upload what i have so far (as a demo). in my app.yaml this is my first line:
application: tacticalagentz
Furthermore, i checked on my admin console, and i CLEARLY see the app id right there, and it matches letter for letter with the app id in my app.yaml
could someone please enlighten me and tell me what i am doing wrong? or is it something beyond my comprehension (like indexing issue with Google that they need time to index my app id) ?
thank you very much in advance

apparently adding the "--no_cookies" parameter will work
appcfg.py update --no_cookies ProjectDir/
the way i was able to find my answer was by uploading my app from my Mac OS X (thank god i have linux mac and windows). AppEngine on Mac OS X comes with a GUI interface, and it worked for uploading. so then i found the command they used in the console, which included "--no_cookies". perhaps if you run into similar issues in the future, this is one approach to getting the answer

App Engine for Java have the same problem. The problem is about account login.
If you are using Eclipse, use Sign In button.
If u are using command-line, use "-e" option, like this:
appcfg.sh -e your#email.com update yoursite/

I had the same problem. When I changed the name of the app I used in the launcher to match the one in the app engine, It worked without any problem. The way I figured out, it was the name mismatch which caused the problem. You can see the name of your registered app in the admin console of app engine.(https://appengine.google.com/)

Here's what fixed it for me:
i had an instance of dev_appserver.py myProjDirectory/ on a different terminal.
i guess the scripts are somehow linked and aren't thread safe

An alternate option that worked for me is to just "Clear Deployment Credential" from the Control option of the GUI. When the app was deployed after this, it opened a google page to allow GAE to access the user profile and then deployment was successful.

The key bit is
This application does not exist (app_id=u'tacticalagentz').
which is telling you that appspot.com doesn't know of an application by that name. The admin console (https://appengine.google.com/) shows your applications. Check there. You might have made an inadvertent typo when you registered the app.

Related

Where does Android Studio hide upload permissions for an app engine project?

I had a working app engine project (Java) which I had created from a template some time ago. The upload always worked fine and I don't remember that I had entered credentials when I set it up. Well, probably I did at some point, but I don't remember what the mechanism was.
Now I switched the project to another app engine project which also has a different admin user. I changed to the new application-name-000 in appengine-web.xml and started the upload, but gradle/appengineUpdate keeps telling me this:
Oct 20, 2014 10:06:35 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=application-name-000&version=2&
404 Not Found
This application does not exist (app_id=u'application-name-000').
Sure the application does not exist, because it's a new project for app engine ;-) I tried to set version 2 to version 1 temporarily which doesn't seem to be the problem. I googled and found out it seems to be a permission problem, but I can't find any hint what I need to do or where I can set the new permissions in Android Studio.
What is the process? Will I need to copy some key from app engine into the project, or where can I set my username/oauth whatever in Android Studio?
I finally found out how to fix this. And yes, it is a permissions problem (see proof further below).
Android Studio uses oauth to connect to the project to app engine. When you install Android Studio and then create the project the first time, it creates the following file in your home directory:
.appcfg_oauth2_tokens_java (in Windows this is under c:\Users\{Username}\)
This is a file with no name and just an extension. This file contains the token to connect and upload to app engine.
If the oauth user changes, Android Studio uses the wrong credentials and the upload fails.
To solve the problem:
Delete the file.
Call appengineUpdate from the command line (!), not from the menu (in Windows, you typically open the Terminal from within Android Studio and from within your module, then enter
..\gradlew appengineUpdate
It starts the update and due to the missing file, Android Studio pops open your browser where you select your Google user and give permissions. You then receive a code.
Copy that code and paste it into the Terminal. There is no input box or anything. The command line just stops and says nothing. Paste your code there and press enter.
A new file will then be created for you, the token saved to the file, and your project should upload fine.
The hint to the file I found here http://code.google.com/p/googleappengine/issues/detail?id=8300 and the hint how to copy the code was here http://code.google.com/p/qt-google-calendar/issues/detail?id=2 (awful, Google).
That it was a permissions problem could be seen, when I changed my build.gradle file:
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
}
oauth2 = true produced this error message:
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=...&version=2&
404 Not Found
This application does not exist (app_id=u'...').
while oauth2 = false produced this one:
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=...&version=2&
401 Unauthorized
Must authenticate first.
What do we learn? Never trust an error messages, no matter how explicit it seems to be.
You can simply change the password on the first account and when you try to run appengineUpdate it will prompt you for new account details.

Having issues getting WordPress running under GAE + Cloud SQL

I tried to set up WordPress under Google App Engine earlier tonight (following the instructions here: https://developers.google.com/appengine/articles/wordpress).
It runs fine locally, but when I push to remote I get a database error (visible at https://wp-dot-frontiermediag.appspot.com/). If we throw on a /wp_admin/install.php you get:
This either means that the username and password information in your
wp-config.php file is incorrect or we can't contact the database server
at :/cloudsql/frontiermediag:fmwp. This could mean your host's database
server is down.
Here's the relevant code in wp-config:
/** MySQL hostname */
if(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false) {
define('DB_HOST', ':/cloudsql/frontiermediag:fmwp');
}else{
define('DB_HOST', 'localhost');
}
frontiermediag:fmwp is showing "Status Runnable" in Developers Console > Cloud SQL.
I did this once before and it worked so I'm not sure what I'm missing here. I thought it might have been because I'm using WP 3.8.1. but rolled back to 3.5.1 and same thing's happening.
Any ideas? frontiermediag is listed as an authorized application on the :fmwp ACL.
This situation happened to me earlier.However, I edited my Cloud SQL instance , and set "Preferred Location" as "Follow App Engine App" from Google Developers Console. This database connection problem was solved in my case.
I tried the instructions with wordpress 3.5.1 and the instructions seem to work for me. The code snippet you have above seems right and I am not sure what could be wrong without looking at rest of your code. Can you try the instructions from the beginning one more time with 3.5.1?
I had this issue, because "Follow App Engine App" doesn't seem to be an option for second generation instances in my case, and so the instance connection name includes the region setting.
Look at the instance details, and under properties, find "Instance connection name". That is the text that should follow :cloudsql/.

Problems using Twitter4j on GAE throws 401 just after deploy

Well, I'm having a weird error here:
I'm developing one GAE app to read some Twitter Data, and after read a lot of docs, I have it working on my test server (Running on my pc) but after deploy and test on the real (my appspot domain) it shows this message:
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or >incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the >system clock is in sync.
message - Could not authenticate you
code - 32
I've tried to recreate my OAuthAppToken and OAuthAppTokenSecret keys, even changing the permissions to "Write, Read and Direct Messages" and even assingning one Callback URL but nothing seems to work...
I've tried using twitter4j.properties OR using setOAuthConsumer(TW_CONSUMER_KEY, TW_CONSUMER_SECRET) OR a ConfigurationBuilder whith the correct constants and I'm experimenting the same Issue.
I'm working with AppEngine 1.8.3 and Twitter4j 3.0.4
Iv'e been writing on log and the Twitter object seems to be well created... I dont understand why is working on my PC but not on the real app.
On some other post someone says that could be because it needs to use Sync clock.. but he doesn't explains where to change that property...
Did someone had a clue?
Ok, the problem was me (and Twitter.... well..... I really think it was Twitter problem for being so dark on his api messages)...
On testing server I was looking for an existing account and on the cloud I was looking for an inexistent one. So, It was my mistake. But seriously, what about Twitter saying: "Access Forbidden"? That doesn't have any sense...

Google App Engine : this application does not exist

When i deploy my application in GAE , i get this error
This application does not exist (app_id=u'qsse-ss').
scenario is that this application is already deployed to GAE by some other user , now i have made some changes and i want to update in GAE, so now when i right click on my app in eclipse and go to "deploy to appengine " it gives me this error
Am i doing something wrong , whats the correct way of doing it
thanks
That happened to me as well when I provided a username that wasn't an owner/developer, and even specifying a different account with -e or --email didn't work. What fixed was this:
appcfg.py update . --no_cookies
(same as: https://stackoverflow.com/a/10004722)
You have to login under developer or owner to deploy application. This is bottom left icon in eclipse.
Also check your application name. If id of application correct and user you login has role owner/developer for this application - you will deploy.
You have to make sure that application name in your GAE local client matches the one in your Google account. Check the app.yaml file to make sure that the name of application matches there as well.
That also happend to me when I change the email to create new appid for goagent.
My solution is delete cookie file in the server directory:
rm server/.appcfg_cookies
then, everything is ok!
Deleted .appcfg_oauth2_tokens c:/usrs/etc worked for me after a long overdue upgrade to python27.
At least as of 2017-06-22, it's not enough to create a cloud project. You have to go to the App Engine section of cloud console and choose a language. When it's done saying "Preparing your App Engine services..." then you can deploy.
the problem was different name which i changed from rightClick project ->appenginesettings->ApplicationId .
this name should be same in your google account
Removing the oauth2 token file ~/.appcfg_oauth2_tokens or specifying a different token store file file with the flag "--oauth2_credential_file" might be a permanent solution. MacOSX GoogleAppEngineLauncher.app does not let you change this flag/path when you push the deploy button.
appcfg.py --oauth2_credential_file=~/.appcfg_oauth2_tokens_myappid
I had same error message:
This application does not exist (project_id=u'xxxx-123456'). To create an
App Engine application in this project, run "gcloud app create" in
your console.
I solved it by executing below command:
gcloud app create
It will create app inside your project and assign selected region.

GAE data download shows datastore_errors.BadRequestError

I'm trying to download data from my Google App Engine app, using the official instructions
Remote API is set up & I call:
appcfg.py download_data --application=appname --url=http://app.address.com/_ah/remote_api --filename=alldata.csv
The connection is established, I'm being asked for my e-mail & password, and then a long trace appears ending up with this:
google.appengine.api.datastore_errors.BadRequestError: app s~appname cannot access app appname's data
Any ideas?
If using the high-replication datastore, change the value passed to --application from appname to s~appname.
Found the problem - as an URL I was giving my own app's domain name instead of the 1.appname.appspot.com.
I ran into this same issue, but when attempting to use the remote API from a custom script as opposed to appcfg.py's bulk downloader.
This issue may have been addressed in more recent GAE SDK releases, but for various reasons I'm still using the older 1.7 release. I found the answer in this bug report: https://code.google.com/p/googleappengine/issues/detail?id=4374
Basically, when calling ConfigureRemoteApi, don't specify the APP_ID argument (just pass None) and specify your app ID via the host argument, e.g. 'myapp-hrd.appspot.com'. ConfigureRemoteApi will figure out your app ID correctly and won't add the 's~' that causes this problem.

Resources