New RunLLM response generated: >>>*# Question* Hi...
# runllm-flyte-trial
j
New RunLLM response generated: >>>*# Question* Hi 👋 I'm currently working with using a FlyteRemote connection to retrieve information about failed executions, so that we can assess failure reasons and relaunch executions in bulk. For this project, we would like to be able to programatically access some information (eg. logs) on why the execution failed. The
FlyteWorkflowExecution
objects returned by
remote.recent_executions()
have a
closure.error.message
property that allows us to get some information on the error logs - but this appears to be truncated to 100 characters:
Traceback (most recent call last):
File "/opt/conda/envs/orchestrator/lib/python3.11/site-pac
Is there any way to access the full error log from a failed execution using FlyteRemote? Or any alternative ways to get or set a failure reason? We can see the full error log in the Flyte UI, so I'm assuming this means it's accessible somewhere.... # Answer To access the full error log from a failed execution using
FlyteRemote
, you can inspect the
node_executions
of the
FlyteWorkflowExecution
object. Each
FlyteNodeExecution
object has an
error
property that provides detailed error information. Here's an example of how to retrieve the full error log:
Copy code
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config

# Initialize FlyteRemote
remote = FlyteRemote(
    config=Config.for_endpoint(endpoint="flyte.example.net"),
    default_project="flytesnacks",
    default_domain="development",
)

# Fetch the workflow execution
execution = remote.fetch_execution(name="fb22e306a0d91e1c6000", project="flytesnacks", domain="development")

# Sync the execution to get node executions
synced_execution = remote.sync(execution, sync_nodes=True)

# Iterate through node executions to get error details
for node_id, node_exec in synced_execution.node_executions.items():
    if node_exec.error:
        print(f"Node {node_id} failed with error: {node_exec.error.message}")
This approach ensures you get detailed error messages for each node execution within the workflow. Would you like more detail on this process? Sources: - FlyteWorkflowExecution Slack Link https://.slack.com/archives/CP2HDHKE1/p1728401937.768729 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.