EEException:服务器返回 HTTP 代码:404 — 使用 Google App Engine 和 Google Earth Engine 测试应用程序并具有经过身份验证的访问权限
EEException: Server returned HTTP code: 404 — testing app with Google App Engine and Google Earth Engine with an authenticated access
我有这个问题。
我有 Google Earth Engine 来授予对我的主帐户的访问权限。我在 运行 我的应用程序之前进行了身份验证。但是,仍然提示我对 earthengine 进行身份验证。
这是痕迹:
ERROR 2018-09-04 08:51:12,986 wsgi.py:263]
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-
sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 240,
in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "C:\Users\esther\dev\ndvi-time-series\server.py", line 90, in <module>
ee.Initialize()
File "C:\Users\esther\dev\ndvi-time-series\lib\ee\__init__.py", line 93, in Initialize
credentials = _GetPersistentCredentials()
File "C:\Users\esther\dev\ndvi-time-series\lib\ee\_helpers.py", line 40, in _GetPersistentCredentials
raise EEException('Please authorize access to your Earth Engine account '
EEException: Please authorize access to your Earth Engine account by running
earthengine authenticate
in your command line, and then retry.
INFO 2018-09-04 16:51:13,023 module.py:880] default: "GET / HTTP/1.1"
500 -
INFO 2018-09-04 16:51:13,325 instance.py:294] Instance PID: 12352
INFO 2018-09-04 16:51:15,380 instance.py:294] Instance PID: 3368
这是我通过Earth Engine认证后得到的:
#>earthengine authenticate
Opening the following address in a web browser:
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fearthengine+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=517222506229-vsmmajv00ul0bs7p89v5m89qs8eb9359.apps.googleusercontent.com
Please authorize access to your Earth Engine account, and paste the generated
code below. If the web browser does not start, please manually browse the URL
above.
Please enter authorization code: (authorization code)
Successfully saved authorization token.
那么,我是否必须让 Google Earth Engine 授予对我用于应用程序开发的服务帐户的访问权限?
是的。您需要注册服务帐号。参见 this reference。
我有这个问题。
我有 Google Earth Engine 来授予对我的主帐户的访问权限。我在 运行 我的应用程序之前进行了身份验证。但是,仍然提示我对 earthengine 进行身份验证。
这是痕迹:
ERROR 2018-09-04 08:51:12,986 wsgi.py:263]
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-
sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 240,
in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "C:\Users\esther\dev\ndvi-time-series\server.py", line 90, in <module>
ee.Initialize()
File "C:\Users\esther\dev\ndvi-time-series\lib\ee\__init__.py", line 93, in Initialize
credentials = _GetPersistentCredentials()
File "C:\Users\esther\dev\ndvi-time-series\lib\ee\_helpers.py", line 40, in _GetPersistentCredentials
raise EEException('Please authorize access to your Earth Engine account '
EEException: Please authorize access to your Earth Engine account by running
earthengine authenticate
in your command line, and then retry.
INFO 2018-09-04 16:51:13,023 module.py:880] default: "GET / HTTP/1.1"
500 -
INFO 2018-09-04 16:51:13,325 instance.py:294] Instance PID: 12352
INFO 2018-09-04 16:51:15,380 instance.py:294] Instance PID: 3368
这是我通过Earth Engine认证后得到的:
#>earthengine authenticate
Opening the following address in a web browser:
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fearthengine+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=517222506229-vsmmajv00ul0bs7p89v5m89qs8eb9359.apps.googleusercontent.com
Please authorize access to your Earth Engine account, and paste the generated
code below. If the web browser does not start, please manually browse the URL
above.
Please enter authorization code: (authorization code)
Successfully saved authorization token.
那么,我是否必须让 Google Earth Engine 授予对我用于应用程序开发的服务帐户的访问权限?
是的。您需要注册服务帐号。参见 this reference。