GEE authenticating and geemap initialization errors #1099
-
Hi All, Kindly help me out to fix this. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
This is not a geemap issue. Try the following. import ee
ee.Authenticate()
ee.Initialize() |
Beta Was this translation helpful? Give feedback.
-
I get an error after authentication has been done. It seems that ee.Initialize always faces a refresh error and I am clueless what to do next. Successfully saved authorization token. TypeError Traceback (most recent call last) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/_cloud_api_utils.py in build(**kwargs) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/_helpers.py in positional_wrapper(*args, **kwargs) TypeError: build() got an unexpected keyword argument 'static_discovery' During handling of the above exception, another exception occurred: RefreshError Traceback (most recent call last) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/init.py in Initialize(credentials, opt_url, cloud_api_key, http_transport, project) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/data.py in initialize(credentials, api_base_url, tile_base_url, cloud_api_base_url, cloud_api_key, project, http_transport) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/data.py in _install_cloud_api_resource() /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/_cloud_api_utils.py in build_cloud_resource(api_base_url, api_key, credentials, timeout, headers_supplier, response_inspector, http_transport, raw) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/_cloud_api_utils.py in build(**kwargs) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/_helpers.py in positional_wrapper(*args, **kwargs) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/discovery.py in build(serviceName, version, http, discoveryServiceUrl, developerKey, model, requestBuilder, credentials, cache_discovery, cache, client_options, adc_cert_path, adc_key_path, num_retries) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/discovery.py in _retrieve_discovery_doc(url, http, cache_discovery, cache, developerKey, num_retries) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/_helpers.py in positional_wrapper(*args, **kwargs) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/http.py in execute(self, http, num_retries) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/http.py in _retry_request(http, num_retries, req_type, sleep, rand, uri, method, *args, **kwargs) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google_auth_httplib2.py in request(self, uri, method, body, headers, redirections, connection_type, **kwargs) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google/auth/credentials.py in before_request(self, request, method, url, headers) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google/oauth2/credentials.py in refresh(self, request) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google/oauth2/reauth.py in refresh_grant(request, token_uri, refresh_token, client_id, client_secret, scopes, rapt_token) /misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google/oauth2/_client.py in _handle_error_response(response_data) RefreshError: ('invalid_scope: Bad Request', {'error': 'invalid_scope', 'error_description': 'Bad Request'}) |
Beta Was this translation helpful? Give feedback.
-
I did nothing and after a week when I used the same codes again it started
to work. There is a problem with the gee api because it works sometimes and
sometimes it goes crazy.
…On Fri, Aug 19, 2022 at 9:57 PM Harun İlkhan ***@***.***> wrote:
I get an error after authentication has been done. It seems that
ee.Initialize always faces a refresh error and I am clueless what to do
next. ee.Authenticate() ee.Initialize()
Successfully saved authorization token.
TypeError Traceback (most recent call last)
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/_cloud_api_utils.py
in build_cloud_resource(api_base_url, api_key, credentials, timeout,
headers_supplier, response_inspector, http_transport, raw) 159 pass #
Handle fallback case outside except block, for cleaner stack traces. -->
160 if resource is None: 161 resource = build()
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/_cloud_api_utils.py
in build(**kwargs) 144 discoveryServiceUrl=discovery_service_url, --> 145
developerKey=api_key, 146 http=http_transport,
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/_helpers.py
in positional_wrapper(*args, **kwargs) 133 logger.warning(message) --> 134
return wrapped(*args, **kwargs) 135
TypeError: build() got an unexpected keyword argument 'static_discovery'
During handling of the above exception, another exception occurred:
RefreshError Traceback (most recent call last)
/tmp/ipykernel_3703159/3368897529.py in 1 ee.Authenticate() ----> 2
ee.Initialize()
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/
*init*.py in Initialize(credentials, opt_url, cloud_api_key,
http_transport, project) 121 opt_url: The base url for the EarthEngine REST
API to connect to. 122 cloud_api_key: An optional API key to use the Cloud
API. --> 123 http_transport: The http transport method to use when making
requests. 124 project: The client project ID or number to use when making
API calls. 125 """
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/data.py
in initialize(credentials, api_base_url, tile_base_url, cloud_api_base_url,
cloud_api_key, project, http_transport) 201 _install_cloud_api_resource()
202 --> 203 if project is not None: 204 _cloud_api_user_project = project
205 _cloud_api_utils.set_cloud_api_user_project(project)
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/data.py
in _install_cloud_api_resource() 260 _cloud_api_resource =
_cloud_api_utils.build_cloud_resource( 261 _cloud_api_base_url, --> 262
credentials=_credentials, 263 api_key=_cloud_api_key, 264 timeout=timeout,
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/_cloud_api_utils.py
in build_cloud_resource(api_base_url, api_key, credentials, timeout,
headers_supplier, response_inspector, http_transport, raw) 160 if resource
is None: 161 resource = build() --> 162 resource._baseUrl = api_base_url
163 return resource 164
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/ee/_cloud_api_utils.py
in build(**kwargs) 143 VERSION, 144
discoveryServiceUrl=discovery_service_url, --> 145 developerKey=api_key,
146 http=http_transport, 147 requestBuilder=request_builder,
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/_helpers.py
in positional_wrapper(*args, **kwargs) 132 elif
positional_parameters_enforcement == POSITIONAL_WARNING: 133
logger.warning(message) --> 134 return wrapped(*args, **kwargs) 135 136
return positional_wrapper
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/discovery.py
in build(serviceName, version, http, discoveryServiceUrl, developerKey,
model, requestBuilder, credentials, cache_discovery, cache, client_options,
adc_cert_path, adc_key_path, num_retries) 268 269 try: --> 270 content =
_retrieve_discovery_doc( 271 requested_url, 272 discovery_http,
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/discovery.py
in _retrieve_discovery_doc(url, http, cache_discovery, cache, developerKey,
num_retries) 374 # Note that it will already raise an error if we don't get
a 2xx response 375 req = HttpRequest(http, HttpRequest.null_postproc,
actual_url) --> 376 resp, content = req.execute(num_retries=num_retries)
377 378 try:
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/_helpers.py
in positional_wrapper(*args, **kwargs) 132 elif
positional_parameters_enforcement == POSITIONAL_WARNING: 133
logger.warning(message) --> 134 return wrapped(*args, **kwargs) 135 136
return positional_wrapper
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/http.py
in execute(self, http, num_retries) 898 899 # Handle retries for
server-side errors. --> 900 resp, content = _retry_request( 901 http, 902
num_retries,
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/googleapiclient/http.py
in _retry_request(http, num_retries, req_type, sleep, rand, uri, method,
*args, **kwargs) 175 try: 176 exception = None --> 177 resp, content =
http.request(uri, method, *args, **kwargs) 178 # Retry on SSL errors and
socket timeout errors. 179 except _ssl_SSLError as ssl_error:
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google_auth_httplib2.py
in request(self, uri, method, body, headers, redirections, connection_type,
**kwargs) 207 request_headers = headers.copy() if headers is not None else
{} 208 --> 209 self.credentials.before_request(self._request, method, uri,
request_headers) 210 211 # Check if the body is a file-like stream, and if
so, save the body
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google/auth/credentials.py
in before_request(self, request, method, url, headers) 131 # the http
request.) 132 if not self.valid: --> 133 self.refresh(request) 134
self.apply(headers) 135
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google/oauth2/credentials.py
in refresh(self, request) 291 grant_response, 292 rapt_token, --> 293 ) =
reauth.refresh_grant( 294 request, 295 self._token_uri,
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google/oauth2/reauth.py
in refresh_grant(request, token_uri, refresh_token, client_id,
client_secret, scopes, rapt_token) 336 337 if not response_status_ok: -->
338 _client._handle_error_response(response_data) 339 return
_client._handle_refresh_grant_response(response_data, refresh_token) + (
340 rapt_token,
/misc/zs1/students/Ritu/conda/envs/spyder-cnn-gee-mefe41/lib/python3.9/site-packages/google/oauth2/_client.py
in _handle_error_response(response_data) 58 error_details =
json.dumps(response_data) 59 ---> 60 raise
exceptions.RefreshError(error_details, response_data) 61 62
RefreshError: ('invalid_scope: Bad Request', {'error': 'invalid_scope',
'error_description': 'Bad Request'})
Hi, I have same error. I did not find a solution , would you find a
solution ? If you share the solution, I glad.
—
Reply to this email directly, view it on GitHub
<#1099 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZ6FRDGMCD5NNRZCIIW42QLVZ7RJLANCNFSM5YPNHHOQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Thanks and regards,
D.K. Ritushree
Research Assistant | Remote Sensing
GFZ German Research Center for Geosciences
Telegrafenberg Haus A17
14473 Potsdam, Germany
Alternate mail: ***@***.***
|
Beta Was this translation helpful? Give feedback.
-
Does anyone know how to fix the error below?i get this after authenticating |
Beta Was this translation helpful? Give feedback.
This is not a geemap issue. Try the following.