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

JSON failed to resolve when use item in withParam #13532

Open
3 of 4 tasks
shuangkun opened this issue Aug 30, 2024 · 2 comments
Open
3 of 4 tasks

JSON failed to resolve when use item in withParam #13532

shuangkun opened this issue Aug 30, 2024 · 2 comments
Labels
area/looping `withParams`, `withItems`, and `withSequence` type/bug

Comments

@shuangkun
Copy link
Member

shuangkun commented Aug 30, 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?

Name:                parameter-aggregation-dag-2b7jx
Namespace:           argo
ServiceAccount:      unset (will run with the default ServiceAccount)
Status:              Error
Conditions:
 PodRunning          False
 Completed           True
Created:             Fri Aug 30 12:10:32 +0800 (19 minutes ago)
Started:             Fri Aug 30 12:10:32 +0800 (19 minutes ago)
Finished:            Fri Aug 30 12:10:38 +0800 (19 minutes ago)
Duration:            6 seconds
Progress:            2/2
ResourcesDuration:   0s*(1 cpu),4s*(100Mi memory)
Parameters:
  num:               [
  { "num": "1"},
  { "num": "2"}
]
STEP                                TEMPLATE               PODNAME                                                 DURATION  MESSAGE
 ⚠ parameter-aggregation-dag-2b7jx  parameter-aggregation
 ├─✔ odd-or-even(0:num:1)           odd-or-even            parameter-aggregation-dag-2b7jx-odd-or-even-3541553772  3s
 ├─✔ odd-or-even(1:num:2)           odd-or-even            parameter-aggregation-dag-2b7jx-odd-or-even-2811640102  3s
 └─⚠ print-message                  print-message                                                                            failed to resolve {{item.sample}}

Version(s)

latest

Paste a minimal 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: parameter-aggregation-dag-
spec:
  entrypoint: parameter-aggregation
  arguments:
    parameters:
      - name: num
        value: |
          [
            { "num": "1"},
            { "num": "2"}
          ]
  templates:
    - name: parameter-aggregation
      dag:
        tasks:
          - name: odd-or-even
            template: odd-or-even
            arguments:
              parameters:
                - name: num
                  value: "{{item.num}}"
            withParam: "{{workflow.parameters.num}}"
          - name: print-message
            depends: "odd-or-even"
            template: print-message
            arguments:
              parameters:
                - name: sample
                  value: "{{item.sample}}"
                - name: r1
                  value: "{{item.r1}}"
            withParam: "{{tasks.odd-or-even.outputs.parameters.qc-fastqs}}"

    - name: odd-or-even
      inputs:
        parameters:
          - name: num
      container:
        image: alpine:latest
        imagePullPolicy: IfNotPresent
        command: [sh, -c]
        args:
          - |
            echo '{"sample": "{{inputs.parameters.num}}","r1": "r1"}' > /tmp/test.json
      outputs:
        parameters:
          - name: qc-fastqs
            valueFrom:
              path: /tmp/test.json
    # print-message prints a number
    - name: print-message
      inputs:
        parameters:
          - name: sample
          - name: r1
      container:
        image: busybox
        imagePullPolicy: IfNotPresent
        command: [echo]
        args: ["{{inputs.parameters.sample}}"]

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
@Joibel
Copy link
Member

Joibel commented Aug 30, 2024

I imagine it's a similar kind of cause to #13510. #13513 won't fix this one though.

@agilgur5 agilgur5 added the area/looping `withParams`, `withItems`, and `withSequence` label Aug 30, 2024
@agilgur5 agilgur5 changed the title Json can‘t be resolved when use Item in withParam JSON failed to resolve when use item in withParam Aug 30, 2024
@tooptoop4
Copy link
Contributor

similar to #13535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/looping `withParams`, `withItems`, and `withSequence` type/bug
Projects
None yet
Development

No branches or pull requests

4 participants