Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When workflow level retry expression evaluated False, workflow message is always retryStrategy.expression evaluated to false regardless of actual failure #13058

Open
3 of 4 tasks
tczhao opened this issue May 16, 2024 · 2 comments
Labels
area/retryStrategy Template-level retryStrategy type/bug

Comments

@tczhao
Copy link
Member

tczhao commented May 16, 2024

Pre-requisites

  • I have double-checked my configuration
  • I have tested with the :latest image tag (i.e. quay.io/argoproj/workflow-controller:latest) and can confirm the issue still exists on :latest. If not, I have explained why, in detail, in my description below.
  • I have searched existing issues and could not find a match for this bug
  • I'd like to contribute the fix myself (see contributing guide)

What happened/what did you expect to happen?

When workflow level retryExpression is used.
regardless of workflow succeed or failure,
the message at workflow level is always retryStrategy.expression evaluated to false

when no expression is used

  • workflow succeed -> no workflow message
  • workflow fail -> no more retry left

when expression is used

  • workflow succeed -> retryStrategy.expression evaluated to false
  • workflow fail (expression evaluated False) -> retryStrategy.expression evaluated to false
  • workflow fail (expression evaluated True) -> no more retry left

This is problematic if one relies on the workflow message for metrc, analytics or debug.
We expect when expression is used, the workflow level message follows the same pattern as normal retry

Version

v3.5.2, latest (71f1d86)

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: dag-nested-
  namespace: argo
spec:
  templates:
    - name: echo
      outputs: {}
      metadata: {}
      container:
        name: ''
        image: alpine:3.7
        command:
          - exit
          - '1'
        resources: {}
    - name: nested-diamond
      outputs: {}
      metadata: {}
      dag:
        tasks:
          - name: A
            template: echo
          - name: B
            template: echo
            depends: A
          - name: C
            template: echo
            depends: A
          - name: D
            template: echo
            depends: B && C
  entrypoint: diamond
  arguments: {}
  retryStrategy:
    retryPolicy: OnError
    expression: >-
      lastRetry.status == 'Errored'

Logs from the workflow controller

kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded
@tczhao tczhao added type/bug area/retryStrategy Template-level retryStrategy labels May 16, 2024
@agilgur5 agilgur5 changed the title When workflow level retry expression evaluated False, workflow message is always "retryStrategy.expression evaluated to false" regardless of actual failure When workflow level retry expression evaluated False, workflow message is always retryStrategy.expression evaluated to false regardless of actual failure May 16, 2024
@agilgur5
Copy link
Member

v3.5.8

Did you mean v3.4.8? or v3.5.6? Because the version you wrote doesn't exist right now

@tczhao
Copy link
Member Author

tczhao commented May 17, 2024

Sorry, I was meant to add the commit hash for latest. Nothing to do with x.x.8
Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/retryStrategy Template-level retryStrategy type/bug
Projects
None yet
Development

No branches or pull requests

2 participants