promptflow icon indicating copy to clipboard operation
promptflow copied to clipboard

[BUG] `get_flow_run_log_content` returns 400 when log file for run is in creation

Open slister1001 opened this issue 8 months ago • 2 comments

Describe the bug The bug occurs when running the pf.runs.create_or_update() function from the PromptFlow SDK. The error message "Value cannot be null. (Parameter 'bytes')" is returned, indicating that the log file name for the run is null.

How To Reproduce the bug Clone the repository microsoft/genaiops-promptflow-template. Run the pipeline in a freshly created public workspace. Observe the error message "Value cannot be null. (Parameter 'bytes')" during the first run.

Expected behavior The run should complete successfully without any errors, and the log file should be properly created.

Running Information Promptflow SDK: 1.17.2 Operating System: Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.35 Python Version: Python/3.11.4

Additional context The issue seems to be related to the logcontent endpoint in Azure Machine Learning, which intermittently returns an HTTP 400 error. The problem does not occur after the first run, suggesting it may be related to the initial creation process of the log file.

slister1001 avatar Apr 21 '25 20:04 slister1001

Same issue for me, it is happing in the pf.runs.stream command. The code has been running well for months, and all of a sudden it stopped working.

created_run = pf.runs.create_or_update(
     run,
     runtime=runtime,
)
# stream it until it's finished
pf.runs.stream(
    created_run,
    timeout=60 * 30,
)

I tried to update to all the latest packages and it did not fix the issue. It is happing both when I run it an an Azure ML pipeline step and when I run it locally.

It is returning 400 when it makes a GET call to: https://switzerlandnorth.api.azureml.ms/flow/api/subscriptions/<<hidden>>/resourceGroups/<<hidden>>/providers/Microsoft.MachineLearningServices/workspaces/<<hidden>>/BulkRuns/2025-04-25-10-32-50-batch-run-for-flow_chat_product_companion/logContent

---------- STACK TRACE ------------ Execution failed. User process 'python' exited with status code 1. Please check log file 'user_logs/std_log.txt' for error details. Error: return _run_code(code, main_globals, None, File "/azureml-envs/python-sdk-v2/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/mnt/azureml/cr/j/9d02a501613c44df85c4ae09b3a4b47d/exe/wd/step_run_bulk_test_of_chat_flow/run_bulk_test_of_chat_flow.py", line 190, in main( File "/mnt/azureml/cr/j/9d02a501613c44df85c4ae09b3a4b47d/exe/wd/step_run_bulk_test_of_chat_flow/run_bulk_test_of_chat_flow.py", line 159, in main pf.runs.stream( File "/azureml-envs/python-sdk-v2/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py", line 265, in wrapper return f(self, *args, **kwargs) File "/azureml-envs/python-sdk-v2/lib/python3.9/site-packages/promptflow/azure/operations/_run_operations.py", line 641, in stream available_logs = self._get_log(flow_run_id=run.name) File "/azureml-envs/python-sdk-v2/lib/python3.9/site-packages/promptflow/azure/operations/_run_operations.py", line 543, in _get_log return self._service_caller.caller.bulk_runs.get_flow_run_log_content( File "/azureml-envs/python-sdk-v2/lib/python3.9/site-packages/azure/core/tracing/decorator.py", line 119, in wrapper_use_tracer return func(*args, **kwargs) File "/azureml-envs/python-sdk-v2/lib/python3.9/site-packages/promptflow/azure/_restclient/flow/operations/_bulk_runs_operations.py", line 973, in get_flow_run_log_content raise HttpResponseError(response=response, model=error) azure.core.exceptions.HttpResponseError: (UserError) Value cannot be null. (Parameter 'bytes') Code: UserError Message: Value cannot be null. (Parameter 'bytes')

martinmoldrup avatar Apr 25 '25 10:04 martinmoldrup

These people have not fixed the code yet. Please find same issue https://github.com/microsoft/promptflow/issues/2025

ankitconfluentis avatar Apr 29 '25 12:04 ankitconfluentis

It seems like this project is no longer maintained. What do you all think? I really love the vscode integration but worry about investing more time in it since it seems to not be actively maintained.

zcasanova avatar May 07 '25 15:05 zcasanova

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 Jun 29 '25 21:06 github-actions[bot]