elegant-sandwich-48375
12/11/2025, 2:42 PMancient-wolf-19325
12/11/2025, 2:42 PMacoustic-parrot-22802
12/11/2025, 2:43 PMancient-wolf-19325
12/11/2025, 2:43 PMacoustic-parrot-22802
12/11/2025, 2:45 PMancient-wolf-19325
12/11/2025, 2:45 PMacoustic-parrot-22802
12/11/2025, 2:46 PMancient-wolf-19325
12/11/2025, 2:46 PMfrom flytekit import task, workflow
@task(retries=3)
def check_log_and_fail_if_missing(log_path: str) -> None:
with open(log_path, "r") as f:
logs = f.read()
if "current=3.00000" not in logs:
raise Exception("Required log entry not found: current=3.00000")
# Otherwise, task succeeds
@workflow
def my_workflow(log_path: str):
check_log_and_fail_if_missing(log_path=log_path)
You would need to ensure the log file is accessible to the primary container (e.g., via a shared volume). If the log entry is missing, the task fails and Flyte retries it up to 3 times as specified (source).
Would you like more detail on handling shared volumes or customizing the pod spec?
Sources:
- https://www.union.ai/docs/v2/flyte/user-guide/task-configuration/retries-and-timeouts/ π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/12/2025, 12:09 PMancient-wolf-19325
12/12/2025, 12:09 PMfrom flytekit import task, workflow
@task(retries=3)
def check_log_and_fail_if_missing(log_path: str) -> None:
with open(log_path, "r") as f:
logs = f.read()
if "current=3.00000" not in logs:
# Raise a standard Exception, which Flyte treats as a system error
raise Exception("SYSTEM ERROR: Required log entry not found: current=3.00000")
# Otherwise, task succeeds
@workflow
def my_workflow(log_path: str):
check_log_and_fail_if_missing(log_path=log_path)
My understanding is that raising Exception will be treated as a system error by Flyte, and system-level retries (if configured in the platform) will be triggered (source).
Would you like more detail on configuring system-level retries?
Sources:
- https://docs.flyte.org/en/latest/api/flytekit/design/authoring.html#exception-handling π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/12/2025, 12:19 PMancient-wolf-19325
12/12/2025, 12:19 PMancient-wolf-19325
12/12/2025, 7:04 PMretries=3 in your Flyte task but retries are not happening when the log check fails, the most likely reason is that Flyte only retries tasks for certain types of failures. Specifically, Flyte will only retry on:
- System errors (e.g., infrastructure/network issues)
- User errors that are explicitly marked as recoverable by raising FlyteRecoverableException in Python tasks
If your container's entrypoint script exits with a nonzero exit code (as in your script: exit $RESULT), Flyte treats this as a user error, but unless you are using a Python task and raise FlyteRecoverableException, it may not count toward the user retry budget. For container tasks, Flyte generally retries on system errors, not on all user-level failures (source, source).
Possible reasons for no retry:
- The failure is not classified as recoverable/system by Flyte.
- The platform/system retry budget is not configured or is exhausted.
- The container task type may not honor user retry settings for non-recoverable errors.
What you can do:
- Ensure your task type supports user retries for nonzero exit codes.
- For Python tasks, raise FlyteRecoverableException for retryable errors.
- For container tasks, check Flyte platform/system retry settings.
Would you like a step-by-step breakdown of how Flyte classifies errors and when retries are triggered?
Sources:
- Build indestructible pipelines with Flyte π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/12/2025, 7:05 PMancient-wolf-19325
12/12/2025, 7:05 PMignore-retry-cause: true in FlytePropeller config), which counts all failures (user and system) toward the retry budget (source).
- Alternatively, wrap your logic in a Python Flyte task and raise FlyteRecoverableException on failure, which will trigger retries as expected.
Would you like a code example for the Python approach or more detail on platform configuration?
Sources:
- Build indestructible pipelines with Flyte
- Simplify retry behaviour RFC π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/12/2025, 7:06 PMacoustic-parrot-22802
12/12/2025, 7:07 PMancient-wolf-19325
12/12/2025, 7:07 PMignore-retry-cause: true) or ensure the failure is classified as a system error (source, source).
Python task example:
from flytekit import task, workflow
from flytekit.exceptions.user import FlyteRecoverableException
@task(retries=3)
def check_log(log_path: str):
with open(log_path) as f:
if "6.000000" not in f.read():
raise FlyteRecoverableException("6.000000 not found, retrying...")
@workflow
def wf(log_path: str):
check_log(log_path=log_path)
Would you like a container task workaround or more detail on platform settings?
Sources:
- Build indestructible pipelines with Flyte
- https://github.com/flyteorg/flyte/blob/master/rfc/system/3902-simplify-retry-behaviour.md π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/12/2025, 7:19 PMancient-wolf-19325
12/12/2025, 7:19 PMfrom flytekit import task, workflow
from flytekit.exceptions.user import FlyteRecoverableException
@task(retries=3)
def check_log(log_path: str):
with open(log_path) as f:
if "6.000000" not in f.read():
raise FlyteRecoverableException("6.000000 not found, retrying...")
@workflow
def wf(log_path: str):
check_log(log_path=log_path)
As per flytekit.exceptions.user.py, FlyteRecoverableException must be imported from flytekit.exceptions.user.
Would you like more detail on exception handling in Flyte?
Sources:
- flytekit.exceptions.user.py π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/12/2025, 7:30 PMancient-wolf-19325
12/12/2025, 7:30 PMtry:
check_for_success()
except FlyteRecoverableException as e:
error_desc = str(e) # Not e.description
Would you like more detail on Flyte exception handling?
Sources:
- flytekit.exceptions.user.py π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/13/2025, 4:26 AMancient-wolf-19325
12/13/2025, 4:26 AMacoustic-parrot-22802
12/13/2025, 4:28 AMancient-wolf-19325
12/13/2025, 4:28 AMignore-retry-cause: true).
Would you like a step-by-step checklist to debug why retries are not happening in your case?
Sources:
- Build indestructible pipelines with Flyte π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/13/2025, 4:29 AMancient-wolf-19325
12/13/2025, 4:30 AMFlyteRecoverableException for retryable errors. Standard exceptions (like Exception) are not retried unless platform is configured for unified retry budgets (source).
2. Check Task Decorator:
- Confirm that you set retries=3 in your @task decorator.
3. Check Platform Retry Configuration:
- For container tasks, system retries are controlled by platform config (e.g., max-node-retries-system-failures). If not set, only user retries apply (source).
- If you want all failures to count toward the retry budget, ask your admin to set ignore-retry-cause: true in FlytePropeller config (source).
4. Check Task Exit Code (Container tasks):
- Ensure your primary container exits with a nonzero code on failure. Flyte only retries if the primary container fails.
5. Check Flyte Version and Logs:
- Some retry bugs have been fixed in recent Flyte versions. Check the Flyte UI or logs for error classification and retry attempts.
6. Check for Workflow/Task Overrides:
- Make sure there are no workflow-level or launch plan overrides that set retries to 0 or override your taskβs retry policy.
Would you like more detail on any of these steps?
Sources:
- Build indestructible pipelines with Flyte
- Simplify retry behaviour RFC π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/13/2025, 4:36 AMancient-wolf-19325
12/13/2025, 4:36 AM#!/bin/bash
log_path="/dev/shm/njest.log"
if ! grep -q "Current=6.00000" "$log_path"; then
echo "Current=6.00000 not found, failing for retry"
exit 1 # Nonzero exit code triggers Flyte retry
fi
# Continue with the rest of your logic if found
This ensures that Flyte detects the failure and, if retries are configured (e.g., retries=3), will rerun the task (source).
Would you like a full example of integrating this into your Flyte task or pod spec?
Sources:
- Build indestructible pipelines with Flyte π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/13/2025, 4:39 AMancient-wolf-19325
12/13/2025, 4:39 AMretries in your @task decorator (source, source).
Would you like a full Flyte task example using this function?
Sources:
- Build indestructible pipelines with Flyte π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/13/2025, 4:40 AMancient-wolf-19325
12/13/2025, 4:40 AMacoustic-parrot-22802
12/13/2025, 4:42 AMancient-wolf-19325
12/13/2025, 4:42 AMfrom flytekit import task, workflow
from flytekit.exceptions.user import FlyteRecoverableException
@task(retries=3)
def check_for_success():
log_path = "/dev/shm/njest.log"
with open(log_path, "r") as f:
logs = f.read()
if "Current=6.00000" not in logs:
raise FlyteRecoverableException("6.00000 not found, retrying...")
- This will trigger retries if the exception is raised (source).
2. If you are using a Flyte container task:
- Your task runs a shell script or command as the main entrypoint (not Python code).
- You must ensure the shell script exits with a nonzero code if the log check fails:
#!/bin/bash
log_path="/dev/shm/njest.log"
if ! grep -q "Current=6.00000" "$log_path"; then
echo "Current=6.00000 not found, failing for retry"
exit 1
fi
# Continue with the rest of your logic if found
- Flyte will only retry if the main process exits with a nonzero code (source).
How to check your task type:
- If your Flyte task is defined with @task and contains Python code, use the Python approach.
- If your Flyte task is configured with a Pod or Container and runs a shell command as entrypoint, use the shell script approach.
Would you like help identifying your task type in your Flyte project?
Sources:
- Build indestructible pipelines with Flyte π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/16/2025, 11:59 AMancient-wolf-19325
12/16/2025, 11:59 AMargs="-c 'echo hello'"
instead of:
args=["-c", "echo hello"]
Would you like more detail on how to structure your container spec?
Sources:
- https://github.com/flyteorg/flyte/issues/4985 π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/17/2025, 8:33 AMancient-wolf-19325
12/17/2025, 8:33 AMNJEST_COMMAND = """
cat <<EOF > /home/initial_value_test.yml
TestSteps:
1:
WaitFor:
Timeout: 200
Variables:
dwVehicleIOQMState.ignitionStatus_in: 3
2:
Wait: 1200
EOF
export TEST_SUITES="TestSuite:
- /home/initial_value_test.yml"
cd /home/julia/shared_memory_app/ && touch /dev/shm/api_started && MBTestCaseParser --testcase /home/initial_value_test.yml 2>&1 | tee -a /dev/shm/njest.log &
until [ -f /dev/shm/recompute_ended ]; do
sleep 1
done
exit
"""
# In your container spec:
args = f'-c \'{NJEST_COMMAND}\''
Or, if you are using a Kubernetes Python client object (like V1Container), set:
args = ["-c", NJEST_COMMAND]
only if the Flyte version and plugin support an array. Otherwise, use a single string as above.
If you still get the error, use:
args = "-c '<your full script here>'"
as a single string.
Would you like a full example for your Flyte pod/container spec?
Sources:
- https://github.com/flyteorg/flyte/blob/master/docs/user_guide/extending/container_interface.md
- https://www.union.ai/docs/v2/flyte/_static/public/llms-full.txt
Note: I wasnβt able to find highly relevant data sources, but above are a few potentially relevant links. π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/17/2025, 8:35 AMancient-wolf-19325
12/17/2025, 8:35 AMargs=TaskCommands.NJEST_COMMAND, and NJEST_COMMAND is a Python list (e.g., <https://github.com/flyteorg/flyte/issues/4985|"-c", "your_script_here"]), you may encounter the "json: cannot unmarshal array into Go struct field Container.containers.args of type string" error if the Flyte backend or your pod spec expects a string, not a list ([source>).
How to fix:
- Change NJEST_COMMAND to a single string, for example:
NJEST_COMMAND = "-c 'your full shell script here'"
and then use:
args=NJEST_COMMAND,
- Or, if your Flyte plugin supports a list, use:
args=["-c", "your full shell script here"]
but only if the backend expects an array.
If you are still seeing the error, use the single string approach.
Would you like a concrete example for your use case?
Sources:
- https://github.com/flyteorg/flyte/issues/4985 π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.acoustic-parrot-22802
12/17/2025, 8:53 AMancient-wolf-19325
12/17/2025, 8:53 AM<<EOF ... EOF) issues in shell scripts passed as Python multi-line strings to Kubernetes containers, but your error /bin/bash: line 20: warning: here-document at line 1 delimited by end-of-file (wanted 'EOF') means that the shell never saw the closing EOF marker, likely due to indentation or whitespace issues in your Python string. To help further, please ensure your here-document markers (EOF) are at the very start of the line with no leading spaces, and that the multi-line string is not indented in Python. If possible, paste your actual rendered script (as it appears in the container) to check for whitespace or encoding issues. If this doesn't help, please reach out to the Flyte support team for further assistance. π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.