Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine - Deploy failing with Error 1: Unauthorised

I'm trying to get my first (PHP) application working. It works OK in Google App Engine Launcher, but when I try to deploy it I get the following message:

2014-08-19 15:37:58 Running command: "['C:\\Program Files\\Python\\pythonw.exe', '-u', 'C:\\Program Files\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'[email protected]', '--passin', 'update', 'C:\\Documents and Settings\\Barry\\My Documents\\test\\high-winter-668']"
03:38 PM Application: high-winter-668; version: 1
03:38 PM Host: appengine.google.com
03:38 PM 
Starting update of app: high-winter-668, version: 1
03:38 PM Getting current resource limits.
Password for [email protected]: Invalid username or password.
2014-08-19 15:38:08,967 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 ---

I can login OK to the application I created at appengine.google.com

and I am using the right/same email address and password. I can see other topics where server/local time difference is the issue. My local PC time is the same as the time in the above error msg.

What have I got wrong?

Also: I tried using appcfg.py on the command line and ran into another issue: It errored saying I didnt have a "high-winter-668.yaml" file. So I changed the name of my "app.yaml" to "high-winter-668.yaml" - it then complained that I didnt specify a 'module" in the yaml file. Meantime Google App Engine Launcher errored say I didnt have an "app.yaml" file. Are they written by different companies!!??

like image 508
user801347 Avatar asked Aug 19 '14 15:08

user801347


3 Answers

Well, in floundering around I've found an answer.

I went here: https://www.google.com/settings/security/lesssecureapps

and selected "Enable" less secure devices and apps to access your data. When I tried to Deploy - it worked.

like image 75
user801347 Avatar answered Nov 15 '22 08:11

user801347


THIS WILL HAPPEN IF YOU HAVE 2-FACTOR authentication activated. The solution in that case is to go to the application-specific passwords page and generate a new password. You can name it "Google app engine" or the like and you'll get a long alpha string to use as the password when deploying.

If you use Google App Engine Launcher and have 2-factor in use you are guaranteed to run into this error on deploy (current version 1.9.17), and it has been that way for at least 1.5 years. It seems like the app engine launcher folks could trap that error and generate a helpful message but instead maybe you'll find it on stackoverflow :)

like image 36
Ezekiel Kruglick Avatar answered Nov 15 '22 09:11

Ezekiel Kruglick


This happenned to me because I forgot the version line in app.yaml: version: 1

like image 28
daiquiri33 Avatar answered Nov 15 '22 09:11

daiquiri33