promptflow icon indicating copy to clipboard operation
promptflow copied to clipboard

[BUG] UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 80: invalid start byte

Open JacquesGariepy opened this issue 1 year ago • 9 comments

In Window 10 Test new flow

new-empty-flow-created-at-2024-6-20 --user-agent "prompt-flow-extension/1.20.0 (win32; x64) VSCode/1.90.0" Starting prompt flow service... Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 160, in main() File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 156, in main
entry(command_args) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 137, in entry
cli_exception_and_telemetry_handler(run_command, activity_name)(args) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_utils.py", line 276, in wrapper
raise e File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_utils.py", line 264, in wrapper
return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 88, in run_command raise ex File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 62, in run_command dispatch_flow_commands(args) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf_flow.py", line 76, in dispatch_flow_commands test_flow(args) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf_flow.py", line 472, in test_flow _test_flow_standard(args, pf_client, inputs, environment_variables) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf_flow.py", line 554, in _test_flow_standard result = pf_client.flows.test( ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk_telemetry\activity.py", line 265, in wrapper return f(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk\operations_flow_operations.py", line 136, in test result = self._test( ^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk\operations_flow_operations.py", line 285, in _test with TestSubmitter(flow=flow, flow_context=flow.context, client=self._client).init( File "C:\Python312\Lib\contextlib.py", line 137, in enter return next(self.gen) ^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk_orchestrator\test_submitter.py", line 252, in init start_trace(session=session, _collection=collection_for_test, path=flow_path) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow\tracing_start_trace.py", line 94, in start_trace start_trace_with_devkit(collection=collection, **kwargs) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk_tracing.py", line 439, in start_trace_with_devkit pfs_port = _invoke_pf_svc() ^^^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk_tracing.py", line 194, in _invoke_pf_svc error_message = start_pfs.stderr.read().decode() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 80: invalid start byte

JacquesGariepy avatar Jun 21 '24 02:06 JacquesGariepy

Hi @JacquesGariepy ,

From the trace stack it looks like to be a pretty old version of prompt flow, could you please try to upgrade to the latest version 1.12.0 and try again?

0mza987 avatar Jun 21 '24 07:06 0mza987

HI @0mza987 I use a fresh version, I wanted to try the VSCode extension image

JacquesGariepy avatar Jun 21 '24 11:06 JacquesGariepy

Hi @JacquesGariepy, I have some questions:

  1. What's the repro steps of this error? Are you trying to create a new empty flow with vscode extension? I did the same operation and couldn't repro.

  2. Are you sure the stack trace in the main thread is from the promptflow version 1.12.0 you shared in your last reply? Because the stack trace does not look like from v1.12.0, could you paste the newsest error stack trace again?

  3. What's your local machine's system language? Is it English?

0mza987 avatar Jun 24 '24 07:06 0mza987

French Windows version.

JacquesGariepy avatar Jul 02 '24 11:07 JacquesGariepy

PS C:\Users\admlocal\Documents\POC\prompt_flow\new-empty-flow-created-at-2024-6-20> C:\Python312\python.exe -m promptflow._cli._pf.entry flow test --flow c:\Users\admlocal\Documents\POC\prompt_flow\new-empty-flow-created-at-2024-6-20 --user-agent "prompt-flow-extension/1.21.128270315 (win32; x64) VSCode/1.90.0" 1.90.0";110fc898-07b3-4229-b5e8-4c545246f722Starting prompt flow service... Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 160, in main() File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 156, in main entry(command_args) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 137, in entry cli_exception_and_telemetry_handler(run_command, activity_name)(args) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_utils.py", line 276, in wrapper raise e File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_utils.py", line 264, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 88, in run_command raise ex File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf\entry.py", line 62, in run_command dispatch_flow_commands(args) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf_flow.py", line 76, in dispatch_flow_commands test_flow(args) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf_flow.py", line 472, in test_flow _test_flow_standard(args, pf_client, inputs, environment_variables) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_cli_pf_flow.py", line 554, in _test_flow_standard result = pf_client.flows.test( ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk_telemetry\activity.py", line 265, in wrapper return f(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk\operations_flow_operations.py", line 136, in test result = self._test( ^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk\operations_flow_operations.py", line 285, in _test with TestSubmitter(flow=flow, flow_context=flow.context, client=self._client).init( File "C:\Python312\Lib\contextlib.py", line 137, in enter return next(self.gen) ^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk_orchestrator\test_submitter.py", line 252, in init start_trace(session=session, _collection=collection_for_test, path=flow_path) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow\tracing_start_trace.py", line 94, in start_trace start_trace_with_devkit(collection=collection, **kwargs) File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk_tracing.py", line 439, in start_trace_with_devkit pfs_port = _invoke_pf_svc() ^^^^^^^^^^^^^^^^ File "C:\Users\admlocal\AppData\Roaming\Python\Python312\site-packages\promptflow_sdk_tracing.py", line 194, in _invoke_pf_svc error_message = start_pfs.stderr.read().decode() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 80: invalid start byte

JacquesGariepy avatar Jul 02 '24 13:07 JacquesGariepy

Hi, @JacquesGariepy . It seems a error message decode issue and we will fix it.

But I'm not sure why starting promptflow service fails from the stack trace. Could you please share your pfs.log (The location is in C:\Users\admlocal.promptflow\pfs\Python312_***_pfs.log) to us to help us debug? Thanks!

One workaround to unblock you is that you can start promptflow service manually by running pf service start or pf service start --debug in the terminal in your python env "Python312".

YingChen1996 avatar Jul 09 '24 08:07 YingChen1996

BTW, Kindly reminder: If you have previously upgraded the prompt flow package , please double-confirm that you have run pf service stop to stop the prompt flow service before proceeding with the upgrade. Otherwise, you may encounter unexpected environmental issues when starting promptflow service or inconsistencies between the version of running prompt flow service and the local prompt flow version.

YingChen1996 avatar Jul 09 '24 08:07 YingChen1996

it's a clean install from scratch...

JacquesGariepy avatar Jul 13 '24 18:07 JacquesGariepy

Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!

github-actions[bot] avatar Aug 14 '24 21:08 github-actions[bot]