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

v3.2.6: retryStrategy.expression (conditional retry) not working -- wrong version used #7539

Closed
kennytrytek opened this issue Jan 11, 2022 · 5 comments
Labels
area/retryStrategy Template-level retryStrategy solution/invalid This is incorrect. Also can be used for spam type/support User support issue - likely not a bug

Comments

@kennytrytek
Copy link
Contributor

kennytrytek commented Jan 11, 2022

Summary

Submitting this example workflow results in an error.
https://github.com/argoproj/argo-workflows/blob/master/examples/retry-conditional.yaml

$ argo submit ./retries.yaml
Failed to parse workflow: error unmarshaling JSON: while decoding JSON: json: unknown field "expression"

What version is it broken in?
v3.2.6

What version was it working in?
v3.1.2

Diagnostics

Either a workflow that reproduces the bug, or paste you whole workflow YAML, including status, something like:

# Only retry if the retryStrategy.when condition is satisfied. In this example, retries will be made until a pod has
# exit code 2 or the limit of 10 is reached, whichever happens first.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: retry-script-
spec:
  entrypoint: main
  templates:
    - name: main
      steps:
        - - name: safe-to-retry
            template: safe-to-retry
        - - name: retry
            template: retry-script
            arguments:
              parameters:
                - name: safe-to-retry
                  value: "{{steps.safe-to-retry.outputs.result}}"

    - name: safe-to-retry
      script:
        image: python:alpine3.6
        command: ["python"]
        source: |
          print("true")

    - name: retry-script
      inputs:
        parameters:
            - name: safe-to-retry
      retryStrategy:
        limit: "3"
        # Only continue retrying if the last exit code is greater than 1 and the input parameter is true
        expression: "asInt(lastRetry.exitCode) > 1 && {{inputs.parameters.safe-to-retry}} == true"
      script:
        image: python:alpine3.6
        command: ["python"]
        # Exit 1 with 50% probability and 2 with 50%
        source: |
          import random;
          import sys;
          exit_code = random.choice([1, 2]);
          sys.exit(exit_code)

What Kubernetes provider are you using?
Docker Desktop

What executor are you running?
Emissary


Message from the maintainers:

Impacted by this regression? Give it a 👍. We prioritise the issues with the most 👍.

@alexec
Copy link
Contributor

alexec commented Jan 18, 2022

The workflow is invalid because your version does not support the "expression" field. Can you please retry with the latest version?

@kennytrytek
Copy link
Contributor Author

@alexec, I'm not sure how I could be out of date since 3.2.6 was the latest version at the time I submitted this. Regardless, I checked out refs/tags/v3.2.7, make clean, deleted the argo namespace, recreated everything and tried again locally:

$ argo submit https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/retry-conditional.yaml
2022/01/31 18:48:30 Failed to parse workflow: error unmarshaling JSON: while decoding JSON: json: unknown field "expression"

As far as I can tell, expression is broken in RetryStrategy.

@alexec alexec changed the title 'expression' in RetryStrategy (conditional retry) is Broken v3.2.6 'expression' in RetryStrategy (conditional retry) is Broken Feb 1, 2022
@alexec
Copy link
Contributor

alexec commented Feb 1, 2022

feat: Introduce when condition to retryStrategy (#6114)

@alexec
Copy link
Contributor

alexec commented Feb 1, 2022

Can you run argo version? Make sure it prints v3.2

@kennytrytek
Copy link
Contributor Author

I tried using ./dist/argo instead, and that actually used the newer version. Yes, this feature works. Closing issue.

@agilgur5 agilgur5 added solution/invalid This is incorrect. Also can be used for spam type/support User support issue - likely not a bug area/retryStrategy Template-level retryStrategy and removed type/bug type/regression Regression from previous behavior (a specific type of bug) labels Oct 22, 2024
@agilgur5 agilgur5 changed the title v3.2.6 'expression' in RetryStrategy (conditional retry) is Broken v3.2.6: retryStrategy.expression (conditional retry) not working -- wrong version used Oct 22, 2024
@argoproj argoproj locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/retryStrategy Template-level retryStrategy solution/invalid This is incorrect. Also can be used for spam type/support User support issue - likely not a bug
Projects
None yet
Development

No branches or pull requests

4 participants