简体   繁体   English

Google App Engine - 部署失败,错误1:未经授权

[英]Google App Engine - Deploy failing with Error 1: Unauthorised

I'm trying to get my first (PHP) application working. 我正在努力让我的第一个(PHP)应用程序正常工作。 It works OK in Google App Engine Launcher, but when I try to deploy it I get the following message: 它在Google App Engine Launcher中运行正常,但是当我尝试部署它时,我收到以下消息:

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=by@onetel.com', '--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 b...@...com: 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 我可以登录我在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. 我的本地PC时间与上述错误消息中的时间相同。

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. 另外:我尝试在命令行上使用appcfg.py并遇到另一个问题:它错误地说我没有“high-winter-668.yaml”文件。 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!!?? 所以我将“app.yaml”的名称更改为“high-winter-668.yaml” - 然后它抱怨我没有在yaml文件中指定“模块”。同时Google App Engine Launcher错误地说我没有“app.yaml”文件。它们是由不同公司编写的!! ??

Well, in floundering around I've found an answer. 好吧,在挣扎中我找到了答案。

I went here: https://www.google.com/settings/security/lesssecureapps 我去了这里: 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. 当我尝试部署时 - 它工作了。

THIS WILL HAPPEN IF YOU HAVE 2-FACTOR authentication activated. 如果您激活了2-FACTOR身份验证,则会发生这种情况。 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. 您可以将其命名为“Google app engine”等,您将获得一个长字母字符串,以便在部署时用作密码。

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. 如果您使用Google App Engine Launcher并且使用2因素,则可以保证在部署(当前版本1.9.17)时遇到此错误,并且这种情况至少持续了1。5年。 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 :) 似乎应用程序引擎启动程序人员可以捕获该错误并生成有用的消息,但也许你会在stackoverflow上找到它:)

这件事发生在我身上,因为我忘记了app.yaml中的版本行:version:1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM