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

WorkflowTemplate withParam causes "template not found" #1868

Closed
crenshaw-dev opened this issue Dec 17, 2019 · 3 comments · Fixed by #1920
Closed

WorkflowTemplate withParam causes "template not found" #1868

crenshaw-dev opened this issue Dec 17, 2019 · 3 comments · Fixed by #1920
Assignees
Labels

Comments

@crenshaw-dev
Copy link
Member

What happened:

A Workflow relying on a WorkflowTemplate using withParam fails with template [template-name] not found. The individual steps based on [template-name] succeed, but the Workflow as a whole fails.

What you expected to happen:

I expected the Workflow to finish successfully.

How to reproduce it (as minimally and precisely as possible):

WorkflowTemplate:

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: test-template
spec:
  templates:
    - name: main
      steps:
        - - name: print-string
            template: print-string
            arguments:
              parameters:
               - name: letter
                 value: '{{item}}'
            withParam: '["x", "y", "z"]'
    - name: print-string
      inputs:
        parameters:
         - name: letter
      container:
        image: alpine:3.6
        command: [sh, -c]
        args: ["echo {{inputs.parameters.letter}}"]

Workflow:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: test-
spec:
  entrypoint: main
  templates:
    - name: main
      templateRef:
        name: test-template
        template: main

Anything else we need to know?:

This appears to be a regression in 2.4.3. I can't reproduce the issue in 2.4.2.

Environment:

  • Argo version: 2.4.3
  • Kubernetes version: 1.16.4

Other debugging information (if applicable):

  • workflow result:
Name:                test-c6rc9
Namespace:           default
ServiceAccount:      default
Status:              Error
Message:             template print-string not found
Created:             Tue Dec 17 11:08:35 -0500 (1 minute ago)
Started:             Tue Dec 17 11:08:35 -0500 (1 minute ago)
Finished:            Tue Dec 17 11:08:40 -0500 (1 minute ago)
Duration:            5 seconds

STEP                                     PODNAME                DURATION  MESSAGE
 ⚠ test-c6rc9 (main)                                                      template print-string not found
 └-·-✔ print-string(0:x) (print-string)  test-c6rc9-49408079    2s
   ├-✔ print-string(1:y) (print-string)  test-c6rc9-2133394499  2s
   └-✔ print-string(2:z) (print-string)  test-c6rc9-166185159   2s
  • executor logs:
    N/A - no pods failed
  • workflow-controller logs:
time="2019-12-17T16:08:26Z" level=warning msg="ConfigMap 'workflow-controller-configmap' does not have key 'config'"
time="2019-12-17T16:08:26Z" level=info msg="Workflow Controller (version: v2.4.3) starting"
time="2019-12-17T16:08:26Z" level=info msg="Workers: workflow: 8, pod: 8"
time="2019-12-17T16:08:26Z" level=info msg="Watch Workflow controller config map updates"
time="2019-12-17T16:08:26Z" level=info msg="Starting workflow TTL controller (resync 20m0s)"
time="2019-12-17T16:08:26Z" level=info msg="Detected ConfigMap update. Updating the controller config."
time="2019-12-17T16:08:26Z" level=warning msg="ConfigMap 'workflow-controller-configmap' does not have key 'config'"
time="2019-12-17T16:08:27Z" level=info msg="Started workflow TTL worker"
time="2019-12-17T16:08:35Z" level=info msg="Processing workflow" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Updated phase  -> Running" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Steps node test-c6rc9 (test-c6rc9) initialized Pending" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="node test-c6rc9 (test-c6rc9) phase Pending -> Running" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="StepGroup node test-c6rc9[0] (test-c6rc9-1012822101) initialized Running" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Pod node test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079) initialized Pending" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Created pod: test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079)" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Pod node test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499) initialized Pending" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Created pod: test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499)" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Pod node test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159) initialized Pending" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Created pod: test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159)" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Workflow step group node test-c6rc9[0] (test-c6rc9-1012822101) not yet completed" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:35Z" level=info msg="Workflow update successful" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:36Z" level=info msg="Processing workflow" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:36Z" level=info msg="Updating node test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079) message: ContainerCreating"
time="2019-12-17T16:08:36Z" level=info msg="Updating node test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159) message: ContainerCreating"
time="2019-12-17T16:08:36Z" level=info msg="Updating node test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499) message: ContainerCreating"
time="2019-12-17T16:08:36Z" level=info msg="Skipped pod test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:36Z" level=info msg="Skipped pod test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:36Z" level=info msg="Skipped pod test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:36Z" level=info msg="Workflow step group node test-c6rc9[0] (test-c6rc9-1012822101) not yet completed" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:36Z" level=info msg="Workflow update successful" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Processing workflow" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Skipped pod test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Skipped pod test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Skipped pod test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Workflow step group node test-c6rc9[0] (test-c6rc9-1012822101) not yet completed" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Processing workflow" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Updating node test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499) status Pending -> Running"
time="2019-12-17T16:08:37Z" level=info msg="Skipped pod test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Skipped pod test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Skipped pod test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Workflow step group node test-c6rc9[0] (test-c6rc9-1012822101) not yet completed" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:37Z" level=info msg="Workflow update successful" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:38Z" level=info msg="Processing workflow" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:38Z" level=info msg="Updating node test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079) status Pending -> Running"
time="2019-12-17T16:08:38Z" level=info msg="Updating node test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159) status Pending -> Running"
time="2019-12-17T16:08:38Z" level=info msg="Skipped pod test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:38Z" level=info msg="Skipped pod test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:38Z" level=info msg="Skipped pod test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159) creation: already exists" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:38Z" level=info msg="Workflow step group node test-c6rc9[0] (test-c6rc9-1012822101) not yet completed" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:38Z" level=info msg="Workflow update successful" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=info msg="Processing workflow" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=info msg="Updating node test-c6rc9[0].print-string(0:x) (test-c6rc9-49408079) status Running -> Succeeded"
time="2019-12-17T16:08:39Z" level=info msg="Updating node test-c6rc9[0].print-string(2:z) (test-c6rc9-166185159) status Running -> Succeeded"
time="2019-12-17T16:08:39Z" level=info msg="Updating node test-c6rc9[0].print-string(1:y) (test-c6rc9-2133394499) status Running -> Succeeded"
time="2019-12-17T16:08:39Z" level=info msg="Step group node test-c6rc9[0] (test-c6rc9-1012822101) successful" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=info msg="node test-c6rc9[0] (test-c6rc9-1012822101) phase Running -> Succeeded" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=info msg="node test-c6rc9[0] (test-c6rc9-1012822101) finished: 2019-12-17 16:08:39.961871107 +0000 UTC" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=error msg="Mark error node test-c6rc9: template print-string not found\ngh.neting.cc/argoproj/argo/errors.New\n\t/go/src/github.com/argoproj/argo/errors/errors.go:49\ngh.neting.cc/argoproj/argo/errors.Errorf\n\t/go/src/github.com/argoproj/argo/errors/errors.go:55\ngh.neting.cc/argoproj/argo/workflow/templateresolution.(*Context).GetTemplateByName\n\t/go/src/github.com/argoproj/argo/workflow/templateresolution/context.go:76\ngh.neting.cc/argoproj/argo/workflow/templateresolution.(*Context).GetTemplate\n\t/go/src/github.com/argoproj/argo/workflow/templateresolution/context.go:108\ngh.neting.cc/argoproj/argo/workflow/templateresolution.(*Context).resolveTemplateImpl\n\t/go/src/github.com/argoproj/argo/workflow/templateresolution/context.go:157\ngh.neting.cc/argoproj/argo/workflow/templateresolution.(*Context).ResolveTemplate\n\t/go/src/github.com/argoproj/argo/workflow/templateresolution/context.go:128\ngh.neting.cc/argoproj/argo/workflow/controller.(*wfOperationCtx).executeSteps\n\t/go/src/github.com/argoproj/argo/workflow/controller/steps.go:107\ngh.neting.cc/argoproj/argo/workflow/controller.(*wfOperationCtx).executeTemplate\n\t/go/src/github.com/argoproj/argo/workflow/controller/operator.go:1195\ngh.neting.cc/argoproj/argo/workflow/controller.(*wfOperationCtx).operate\n\t/go/src/github.com/argoproj/argo/workflow/controller/operator.go:216\ngh.neting.cc/argoproj/argo/workflow/controller.(*WorkflowController).processNextItem\n\t/go/src/github.com/argoproj/argo/workflow/controller/controller.go:304\ngh.neting.cc/argoproj/argo/workflow/controller.(*WorkflowController).runWorker\n\t/go/src/github.com/argoproj/argo/workflow/controller/controller.go:230\ngh.neting.cc/argoproj/argo/workflow/controller.(*WorkflowController).runWorker-fm\n\t/go/src/github.com/argoproj/argo/workflow/controller/controller.go:171\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/go/src/k8s.io/apimachinery/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/go/src/k8s.io/apimachinery/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/go/src/k8s.io/apimachinery/pkg/util/wait/wait.go:88\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1333" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=info msg="node test-c6rc9 (test-c6rc9) phase Running -> Error" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=info msg="node test-c6rc9 (test-c6rc9) message: template print-string not found" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=info msg="node test-c6rc9 (test-c6rc9) finished: 2019-12-17 16:08:39.96214338 +0000 UTC" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=error msg="test-c6rc9 error in entry template execution: template print-string not found\ngh.neting.cc/argoproj/argo/errors.New\n\t/go/src/github.com/argoproj/argo/errors/errors.go:49\ngh.neting.cc/argoproj/argo/errors.Errorf\n\t/go/src/github.com/argoproj/argo/errors/errors.go:55\ngh.neting.cc/argoproj/argo/workflow/templateresolution.(*Context).GetTemplateByName\n\t/go/src/github.com/argoproj/argo/workflow/templateresolution/context.go:76\ngh.neting.cc/argoproj/argo/workflow/templateresolution.(*Context).GetTemplate\n\t/go/src/github.com/argoproj/argo/workflow/templateresolution/context.go:108\ngh.neting.cc/argoproj/argo/workflow/templateresolution.(*Context).resolveTemplateImpl\n\t/go/src/github.com/argoproj/argo/workflow/templateresolution/context.go:157\ngh.neting.cc/argoproj/argo/workflow/templateresolution.(*Context).ResolveTemplate\n\t/go/src/github.com/argoproj/argo/workflow/templateresolution/context.go:128\ngh.neting.cc/argoproj/argo/workflow/controller.(*wfOperationCtx).executeSteps\n\t/go/src/github.com/argoproj/argo/workflow/controller/steps.go:107\ngh.neting.cc/argoproj/argo/workflow/controller.(*wfOperationCtx).executeTemplate\n\t/go/src/github.com/argoproj/argo/workflow/controller/operator.go:1195\ngh.neting.cc/argoproj/argo/workflow/controller.(*wfOperationCtx).operate\n\t/go/src/github.com/argoproj/argo/workflow/controller/operator.go:216\ngh.neting.cc/argoproj/argo/workflow/controller.(*WorkflowController).processNextItem\n\t/go/src/github.com/argoproj/argo/workflow/controller/controller.go:304\ngh.neting.cc/argoproj/argo/workflow/controller.(*WorkflowController).runWorker\n\t/go/src/github.com/argoproj/argo/workflow/controller/controller.go:230\ngh.neting.cc/argoproj/argo/workflow/controller.(*WorkflowController).runWorker-fm\n\t/go/src/github.com/argoproj/argo/workflow/controller/controller.go:171\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/go/src/k8s.io/apimachinery/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/go/src/k8s.io/apimachinery/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/go/src/k8s.io/apimachinery/pkg/util/wait/wait.go:88\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1333" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:39Z" level=info msg="Workflow update successful" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:40Z" level=info msg="Processing workflow" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:40Z" level=info msg="Updated phase Running -> Error" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:40Z" level=info msg="Updated message  -> template print-string not found" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:40Z" level=info msg="Marking workflow completed" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:40Z" level=info msg="Checking daemoned children of " namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:40Z" level=info msg="Labeled pod default/test-c6rc9-2133394499 completed"
time="2019-12-17T16:08:41Z" level=info msg="Workflow update successful" namespace=default workflow=test-c6rc9
time="2019-12-17T16:08:41Z" level=info msg="Labeled pod default/test-c6rc9-49408079 completed"
time="2019-12-17T16:08:41Z" level=info msg="Labeled pod default/test-c6rc9-166185159 completed"
time="2019-12-17T16:08:42Z" level=info msg="Labeled pod default/test-c6rc9-166185159 completed"
time="2019-12-17T16:08:42Z" level=info msg="Labeled pod default/test-c6rc9-2133394499 completed"
time="2019-12-17T16:08:42Z" level=info msg="Labeled pod default/test-c6rc9-49408079 completed"
@simster7
Copy link
Member

@dtaniwaki Could you take a look at this?

@crenshaw-dev
Copy link
Member Author

@dtaniwaki I don't know Go, but if you point me in a general direction, I might be able to figure things out.

@dtaniwaki
Copy link
Member

@mac9416 Sorry for the late reply. I'll check the issue and fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants