Skip to content

v3.4.6+ Cannot access output global artifacts in exit handler after upgrade #11610

@ghulevishal

Description

@ghulevishal

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issues exists when I tested with :latest
  • I'd like to contribute the fix myself (see contributing guide)

What happened/what you expected to happen?

Whenever we are calling the global output artifact in the exithandler Its failing with the error:

Bad Request: templates.exit-handler.steps failed to resolve {{workflow.outputs.artifacts.output-result-car}}

This error was introduced after upgrading to the v3.4.6,. Also have tested with v3.4.7, v3.4.8, v3.4.9, v3.4.10 same issue persist.

After downgrading to v3.4.5 same workflow is working without any issue

Version

v3.4.6

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:
  name: exit-handler-with-artifacts
spec:
  onExit: exit-handler
  entrypoint: main
  arguments:
    parameters:
    - name: params
      value: |
        [
          { "variable": "car"},
          { "variable": "bike"}
        ]
  templates:
    - name: main
      steps:
        - - name: step-1
            template: output
            arguments:
              parameters:
                - name: variable
            	  value: "{{item.variable}}"
            withParam: "{{workflow.parameters.params}}" 

    - name: output
       inputs:
        parameters:
        - name: variable
      script:
        image: python:alpine3.6
        command: [sh, -c]
        args: ["echo $variable > /result.txt "]
      outputs:
        artifacts:
          - name: result-{{inputs.parameters.variable}}
            path: /result.txt
            globalName: output-result-{{inputs.parameters.variable}}

    - name: printer
      inputs:
        artifacts:
          - name: message-bike
            path: /tmp/message-bike
          - name: message-car
            path: /tmp/message-car
      container:
        image: python:alpine3.6
        command: [sh, -c]
        args: ["cat /tmp/message.*"]

    - name: exit-handler
      steps:
        - - name: printer
            template: printer
            arguments:
              artifacts:
              - name: message-car
                from: "{{workflow.outputs.artifacts.output-result-car}}"          
              - name: message-bike
                from: "{{workflow.outputs.artifacts.output-result-bike}}" 

Logs from the workflow controller

NA

Logs from in your workflow's wait container

NA

Metadata

Metadata

Assignees

Labels

P1High priority. All bugs with >=5 thumbs up that aren’t P0, plus: Any other bugs deemed high priorityarea/templatingTemplating with `{{...}}`type/bugtype/regressionRegression from previous behavior (a specific type of bug)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions