Google app engine launcher: Invalid username or password - google-app-engine

I've download google app engine (python) for windows and install it. Then I went to console.developers.google.com/project and create new project. After that, I launched google app engine launcher, create new application and named it as project I have recently create. I click on deploy and constantly getting this error:
03:35 PM Application: udacity-hello-pozdrav; version: 1
03:35 PM Host: appengine.google.com
03:35 PM
Starting update of app: udacity-hello-pozdrav, version: 1
03:35 PM Getting current resource limits.
Password for t******.****#gmail.com: Invalid username or password.
2014-09-06 15:35:56,690 ERROR appcfg.py:2411 An error occurred processing file '': HTTP Error 401: Unauthorized. Aborting.
Error 401: --- begin server output ---
Must authenticate first.
--- end server output ---
2014-09-06 15:35:56 (Process exited with code 1)
You can close this window now.
I've read about appcfg.py but when I enter it in cmd, It says that it's not recognized.

Would be much better if you will use appcfg.py with --oauth2 flag.
Like appcfg.py --oauth2 update /path/to/your/app.
For the first time you will see the browser window where you'll need to allow access to your account. Then you can deploy without entering any credentials and without confirmations. This will work even with 2-step authentication turned on.

The "Invalid username or password" error is due to Google security protection. To overcome this error message and be able to deploy from the Launcher, go to your Google Account Settings, then enable "Access for Less Secure Apps" under Security Check Up.

Related

Download logs from Google App Engine with server errors

I try to download the logs from my Google App Engines with the command:
appcfg.py request_logs [directory] mylogs.txt
However, I encountered the server error as below:
C:\Program Files (x86)\Google\google_appengine>appcfg.py request_logs E:\PhD\cod
e\python\webDevelop\similarAPI\similarAPI/ mylogs.txt
05:22 PM Application: similarapi
05:22 PM Host: appengine.google.com
05:22 PM Downloading request logs for app similarapi version 1.
Error 500: --- begin server output ---
Server Error (500)
A server error has occurred.
--- end server output ---
I have looked at the official document and related Stack Overflow questions, but no clues are found. Actually I can get the logs in Dec, 2016 but not now. And I tried it for one week without the success, so it should not be the error of Google's infrastructure.
Does anyone know how to solve that problem? Thanks in advance.
Just a workaround, not a direct answer.
The GAE SDK might be getting a bit less attention compared to the cloud SDK (which is the recommended one lately). I, for one, can't even get as far as you got since appcfg.py request_logs can't properly detect my multi-service app from its directory and was not happy with any syntax attempt I made to specify it via args.
But I have the cloud SDK installed as well and I was able to get the logs for my app using gcloud app logs read (after setting up the gcloud context for my app)
FWIW, this isn't yet enough to make me switch, I'm still primarily a GAE SDK user. YMMV.
Finally, it has be proved that it is a bug of Google's infrastructure from 22 Mar to 10 Apr, 2017. Three related bug reports can be seen in the Google Issue Tracker 36637246, 37192011, 36969442.
Now the command appcfg.py request_logs [directory] mylogs.txt works well.

Error message "You do not have permission to modify this app" from a Google App Engine deployment

I am following the instructions on http://beta.appinventor.mit.edu/learn/reference/other/tinywebdb.html , trying to create a custom TinyWebDB for a grade 10 class I teach. After creating a new Project (the instructions say create an Application, but I only see a Create a new project button), I change the project name in the local file app.yaml file, load it in, and click on Deploy. I get the following error message:
Starting update of app: npicswebdb, version: 1
01:35 PM Getting current resource limits.
2016-03-09 13:35:26,727 ERROR appcfg.py:2396 An error occurred processing file '': HTTP Error 403: Forbidden Unexpected HTTP status 403. Aborting.
Error 403: --- begin server output ---
You do not have permission to modify this app (app_id=u's~npicswebdb').
--- end server output ---
2016-03-09 13:35:26 (Process exited with code 1)
Is there some way I need to log in to the App Engine Launcher so it connects with my App Engine in the cloud? There is nothing in the instructions about doing that, and I don't see any way to do that in the launcher.
Thanks for your help.
Try adding "--no_cookies":
appcfg.py -A projectname update app.yaml --no_cookies
Delete cookie file something like this: ~/.appcfg_oauth2_tokens_java.
Re-run your command, it will prompt to login from browser and copy-paste a token back to the terminal.
Similar to the other answers. I run into the same issue and removing those stored credentials helped me, i.e:
rm ~/.appcfg_oauth2_tokens_java
rm ~/.appcfg_cookies
Found more details here: IT Code Hub - AppEngine deployment

Can't download data via appcfg.py. "Application Default Credentials are not available" error

This has worked for years. Today is not working.
Running appcfg.py download_data --flags..., and cannot get properly authorized.
Ran gcloud auth login
and got back:
Saved Application Default Credentials.
You are now logged in as [correct#gmail.com].
Your current project is [correct].
but when I run appcfg.py download_data ... I get this error:
raise ApplicationDefaultCredentialsError(ADC_HELP_MSG)
oauth2client.client.ApplicationDefaultCredentialsError: The
Application Default Credentials are not available. They are available if
running in Google Compute Engine. Otherwise, the environment variable
GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file
defining the credentials. See
https://developers.google.com/accounts/docs/application-default
credentials for more information.
I updated the Google Cloud SDK, and now get a different error:
client.py:539 Attempting refresh to obtain initial access_token
client.py:797 Refreshing access_token
Error 302: --- begin server output ---
--- end server output ---
I have also set the credentials in Terminal:
set GOOGLE_APPLICATION_CREDENTIALS "https://www.myurl/credentials.json"
set CLOUDSDK_PYTHON_SITEPACKAGES 1
gcloud config set project "correct_project_name"
I have also tried setting the env_variable flag in the appcfg command:
--env_variable=GOOGLE_APPLICATION_CREDENTIALS:"https://www.myurl/credentials.json"
Seems to be a GAE bug. Removing the login:admin from the remote_api handler in app.yaml fixes it in production, but not local dev server. The 302 was telling me that the app was trying to redirect, perhaps to a Google login page. Was never seeing the prompt asking for email and password.
handlers:
- url: /remote_api
script: google.appengine.ext.remote_api.handler.application
#login: admin <-- removing admin fixes it in production
secure: always
On the dev server, removing the admin login yields this:
client.py:797 Refreshing access_token
Error 401: --- begin server output ---
You must be logged in as an administrator to access this.
--- end server output ---
Did Google change something in the --oauth2 workflow? I appear to be authorized, but the download crashes at the auth step.
Thanks.
Seems to be a bug in GoogleAppEngineLauncher-1.9.27, where it does not allow a login prompt. When reverting back to 1.9.26, it works. Interestingly, my gcloud components still have the 1.9.27 version:
>$ gcloud version
Google Cloud SDK 0.9.83
alpha 2015.10.08
app 2015.10.16
app-engine-python 1.9.27
beta 2015.10.08
core 2015.10.16
core-nix 2015.09.03
gcloud 2015.10.16
temporary solution: go to https://console.developers.google.com/storage/browser/appengine-sdks/featured/ to get version 1.9.26
Submitted bug report: https://code.google.com/p/google-cloud-sdk/issues/detail?id=340

Remote implementation for app_identity_service.GetAccessToken failed at GAE PHP dev

Google App Engine SDK for PHP (at local environment) returns error on any try to use Google Cloud Storage. Error message is:
Fatal error: Uncaught exception 'google\appengine\runtime\RPCFailedError' with message 'Remote implementation for app_identity_service.GetAccessToken failed' in /media/data/home/vladimir/setup/gae/google_appengine/php/sdk/google/appengine/runtime/RemoteApiProxy.php on line 92
It exactly repeats the problem described here:
App engine update breaks CloudStorage in dev php env
Test code from the question above shows the same result.
I tried App Engine SDK for PHP versions 1.9.19, 1.9.20, 1.9.21 without success.
On Win10 this issue can be solved by generating an application-default credentials file:
D:\Workspace\Sourcecode>gcloud auth application-default login
Credentials saved to file: [C:\Users\Otje\AppData\Roaming\gcloud\application_default_credentials.json]
And then setting the environment in commandline:
D:\Workspace\Sourcecode>SET GOOGLE_APPLICATION_DEFAULT=C:\Users\Otje\AppData\Roaming\gcloud\application_default_credentials.json
Seems to me GAE on local just outputs limited error information when it can't find the right credentials to succesfully connect to remote endpoint.
It seems that it was GAE's server side issue. They fixed it. I discovered that it started to work as expected today without any changes applied by me.

google appengine deployment authorization problems

Im having problems deploying my GAE. I've got two running already so I should have all the right lirbaries and whatnot. But obviously Im missing something.
I registered my applet with googe appengine developers.
i enter the app_id in the app.yaml of the project as application name.
in cmd, i go to google_appengine and run the "appcfg.py update" on the root directory of my project. "C:/Development/GAE/projectname"
type in email and pw,
and then i get this error msg
12:47 AM Application: processing#######; version: 1
12:47 AM Host: appengine.google.com
12:47 AM
Starting update of app: processing######, version: 1
12:47 AM Getting current resource limits.
Password for ############gmail.com: Invalid username or password.
2014-09-19 00:47:36,404 ERROR appcfg.py:2416 An error occurred processing file '': HTTP Error 401: Unauthorized. Aborting.
Error 401: --- begin server output ---
Must authenticate first.
--- end server output ---
Any ideas what Im missing? Ive triple-checked all these steps cause thats all i can think of.
My App.yaml contains this
application: processing######
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /statics
static_dir: statics
- url: /sketches
static_dir: sketches
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
- name: jinja2
version: latest
Ive upgraded my GAE to the latest version too, still no change. I also tried uploading it to a different application, same problem.
Ive added 2 static folder I use for to run Processing embedded in my website.
PS my app runs fine locally and there's nothing that throws errors or doesnt compile. I think the fault lies somewehre else.
Cheers
Ok so as usual, more research eventually revealed the answer. And stackoverflow.
Guess I missed this first because it specified with php.Stack Overflow Question
Basically i wasnt doing anything wrong afterall, the permission problem was that it was being blocked by my google account.
I had to go to my Account Security permissions, and enable access from less-secure devices.
This must be a new, recent setting Google changed, becuase Ive already deployed 2 apps before.
To mention here for other people with the same problem:
First go through the steps I went through to make sure everything is set up correctly.
Then you should solving it the way I did.
Otherwise you can try setting it up so you can upload without password, this might avoid the problem if it lies somewehre else --oauth without pw
Finally I read that for some people the problem was in timezones. When the time on their computer was different to GAE or server I think that lead to miscommunication, so double-check that your time is set correctly and that it agrees with the time you see in the Launcher Log.
well for me the below 02 options worked
appcfg.py update . --oauth2 --noauth_local_webserver
The authentication flow was :
the command and options generated a url in stdout, which i copied and accessed from my browser, the browser generated a code, which I gave in my command line. I could see appcfg as one of the apps under connected apps and services of my google account.
It seems like an error with your user or password.
Are you sure you can access the project in the developer console, the email configured under permissions is the one which you are using to connect and the app id in yaml file is the same ID on the developers console? If so, the only thing I can imagine is a fail in your password.
Maybe a key pressed? Try typing it in a text processor.
A last idea, deploy the app via the launcher of the sdk. Add the existing app in the file menu (search the app.yaml file) and click deploy to see if there you can authenticate.

Resources