Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Set Project due to UnicodeDecodeError #161

Open
EldonSamuelson opened this issue Nov 28, 2024 · 0 comments
Open

Cannot Set Project due to UnicodeDecodeError #161

EldonSamuelson opened this issue Nov 28, 2024 · 0 comments

Comments

@EldonSamuelson
Copy link

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

I haven't used EE-GQIS in a while since the Cloud Project Migration process, but since updating the Plugin the 'Set Project' window always throws up an error.

  • I already have a Cloud Project setup and configured which I mostly use for the EE JS IDE Platform, called 'EarthEngine' and a project ID of 'ee-seamus-noncomm'.
  • I already have successfully Signed In/Authenticated and logged in via the QGIS EE Plugin.
  • I have a credentials file in 'C:\Users[me].config' (can't share that obviously, but it was last modified today so I'm assuming it has been configured correctly to authenticate my login as it did before Cloud Projects were mandatory). It has a redirect_uri of 'localhost:[port#]', my refresh_token, and scopes of 'https://www.googleapis.com/auth/earthengine', 'https://www.googleapis.com/auth/cloud-platform', and 'https://www.googleapis.com/auth/devstorage.full_control'.

However when I'm asked to enter the Cloud Project Name, 'EarthEngine' or 'ee-seamus-noncomm', it brings up this Unicode error. I've also tried entering a new name thinking that maybe Set Project is only designed for creating a new GCP Project rather than assigning an exisiting one but that also brings this up;

Traceback (most recent call last):
File "C:\Users/seamu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_plugin.py", line 122, in run_cmd_set_cloud_project
ee_auth.select_project()
File "C:\Users/seamu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_auth.py", line 124, in select_project
ee_initialize_with_project(project, force=True)
File "C:\Users/seamu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_auth.py", line 92, in ee_initialize_with_project
ee.Initialize(project=project)
File "C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs\ee_utils.py", line 38, in wrapper
return func(*args, **kwargs)
File "C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs\ee_init_.py", line 154, in Initialize
credentials = data.get_persistent_credentials()
File "C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs\ee\data.py", line 279, in get_persistent_credentials
if oauth.is_valid_credentials(credentials):
File "C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs\ee\oauth.py", line 133, in is_valid_credentials
credentials.refresh(google.auth.transport.requests.Request())
File "C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs\google\oauth2\credentials.py", line 409, in refresh
) = reauth.refresh_grant(
File "C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs\google\oauth2\reauth.py", line 333, in refresh_grant
response_status_ok, response_data, retryable_error = _client._token_endpoint_request_no_throw(
File "C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs\google\oauth2_client.py", line 192, in _token_endpoint_request_no_throw
response = request(
File "C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs\google\auth\transport\requests.py", line 186, in call
response = self.session.request(
File "C:\OSGeo4W\apps\Python39\lib\site-packages\requests\sessions.py", line 516, in request
prep = self.prepare_request(req)
File "C:\OSGeo4W\apps\Python39\lib\site-packages\requests\sessions.py", line 446, in prepare_request
auth = get_netrc_auth(request.url)
File "C:\OSGeo4W\apps\Python39\lib\site-packages\requests\utils.py", line 204, in get_netrc_auth
_netrc = netrc(netrc_path).authenticators(host)
File "C:\OSGeo4W\apps\Python39\lib\netrc.py", line 30, in init
self._parse(file, fp, default_netrc)
File "C:\OSGeo4W\apps\Python39\lib\netrc.py", line 39, in _parse
toplevel = tt = lexer.get_token()
File "C:\OSGeo4W\apps\Python39\lib\shlex.py", line 109, in get_token
raw = self.read_token()
File "C:\OSGeo4W\apps\Python39\lib\shlex.py", line 140, in read_token
nextchar = self.instream.read(1)
File "C:\OSGeo4W\apps\Python39\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS version: 3.28.4-Firenze Firenze, fd0fb72ab3
GEE Plugin version: 0.0.7

Python Path:
C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\planet_explorer\extlibs
C:/OSGeo4W/apps/qgis-ltr/./python
C:/Users/seamu/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/seamu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis-ltr/./python/plugins
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:\OSGeo4W\apps\Python39\lib\site-packages\win32
C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin
C:/Users/seamu/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs
C:\Users\seamu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\mmqgis/forms

Searching online says the Unicode errors are usually related to the latin-1 encoding, but all my Windows files are in default UK English. It's an outside chance but I experience this sort of issue everywhere, could it be related to my name having an 'é' and an "O'Something" somewhere during authentication? Or is it a Credential problem that I need to reset?

Thanks for any help you can provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant