jina-ai / dev-gpt

Your Virtual Development Team

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: UnicodeEncodeError

MR-Alex42 opened this issue · comments

First version of the microservice generated. Start iterating on it to make the tests pass...
Debugging iteration 1
Trying to debug the microservice. Might take a while...
Traceback (most recent call last):
File "D:\Programme\Python310\lib\site-packages\hubble_init_.py", line 127, in show_hint
user = c.get_user_info(log_error=False).get('data', {})
File "D:\Programme\Python310\lib\site-packages\hubble\client\client.py", line 84, in get_user_info
resp = self.handle_request(
File "D:\Programme\Python310\lib\site-packages\hubble\client\base.py", line 106, in handle_request
raise e
File "D:\Programme\Python310\lib\site-packages\hubble\client\base.py", line 96, in handle_request
self._handle_error_request(resp)
File "D:\Programme\Python310\lib\site-packages\hubble\client\base.py", line 53, in _handle_error_request
raise ExceptionCls(response=resp, data=data, message=message, code=code)
hubble.excepts.AuthenticationRequiredError: 40103: AuthenticationRequiredWithBearerChallengeError: Token invalid or expired.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Programme\gptdeploy\gptdeploy.py", line 5, in
main()
File "D:\Programme\Python310\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "D:\Programme\Python310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "D:\Programme\Python310\lib\site-packages\click\core.py", line 1657, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File "D:\Programme\Python310\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "D:\Programme\Python310\lib\site-packages\click\core.py", line 760, in invoke
return callback(*args, **kwargs)
File "D:\Programme\gptdeploy\src\cli.py", line 38, in wrapper
return func(*args, **kwargs)
File "D:\Programme\gptdeploy\src\cli.py", line 74, in generate
generator.generate(path)
File "D:\Programme\gptdeploy\src\options\generate\generator.py", line 290, in generate
final_version_path = self.debug_microservice(
File "D:\Programme\gptdeploy\src\options\generate\generator.py", line 200, in debug_microservice
log_hubble = push_executor(previous_microservice_path)
File "D:\Programme\gptdeploy\src\apis\jina_cloud.py", line 80, in push_executor
headers = get_request_header()
File "D:\Programme\Python310\lib\site-packages\hubble\executor\helper.py", line 226, in get_request_header
auth_token = get_token()
File "D:\Programme\Python310\lib\site-packages\hubble_init
.py", line 109, in get_token
token = show_hint(interactive)
File "D:\Programme\Python310\lib\site-packages\hubble_init
.py", line 138, in show_hint
print(
File "D:\Programme\Python310\lib\site-packages\rich_init
.py", line 74, in print
return write_console.print(*objects, sep=sep, end=end)
File "D:\Programme\Python310\lib\site-packages\rich\console.py", line 1672, in print
with self:
File "D:\Programme\Python310\lib\site-packages\rich\console.py", line 864, in exit
self._exit_buffer()
File "D:\Programme\Python310\lib\site-packages\rich\console.py", line 822, in _exit_buffer
self._check_buffer()
File "D:\Programme\Python310\lib\site-packages\rich\console.py", line 2039, in _check_buffer
write(text)
File "D:\Programme\Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f510' in position 0: character maps to
*** You may need to add PYTHONIOENCODING=utf-8 to your environment ***

I did add that setting to my environement variables on Windows 10 but no luck. I guess that the issue is caused by something else as UTF-8 is already the default encoding for Python 3.

Thanks, interesting. Some token seems to be expired. I will check what is going on.

Does it sometimes work and sometimes not?
I introduced a retry in case it only sometimes fails:
#43

image

For me it is working, but I'm using mac. I will try now on a windows machine.

For me it never works on a Windows machine.

reopened since the issue still exists. But I know how to solve it. Hang on

The issue is now solved.
We updated the core.