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

Log Viewer Container list broken for workflows using templateRef #9938

Open
2 of 3 tasks
jccarte opened this issue Nov 1, 2022 · 1 comment · May be fixed by #12973
Open
2 of 3 tasks

Log Viewer Container list broken for workflows using templateRef #9938

jccarte opened this issue Nov 1, 2022 · 1 comment · May be fixed by #12973
Assignees
Labels
area/ui area/workflow-templates P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important solution/suggested A solution to the bug has been suggested. Someone needs to implement it. type/bug

Comments

@jccarte
Copy link

jccarte commented Nov 1, 2022

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?

Workflows that reference templates with "templateRef" rather than being defined in the same workflow fail to properly list containers in the log viewer UI.

I have validated this with our own custom workflows as well as https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-template/hello-world.yaml

I think is caused here: https://github.com/argoproj/argo-workflows/blob/master/ui/src/app/workflows/components/workflow-logs-viewer/workflow-logs-viewer.tsx#L87

Code permalink:
https://github.com/argoproj/argo-workflows/blob/v3.4.3/ui/src/app/workflows/components/workflow-logs-viewer/workflow-logs-viewer.tsx#L87

Version

v3.4.3, v3.3.8

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: WorkflowTemplate
metadata:
  name: workflow-template-whalesay-template
spec:
  entrypoint: whalesay-template
  templates:
  - name: whalesay-template
    inputs:
      parameters:
      - name: message
    container:
      image: docker/whalesay
      command: [cowsay]
      args: ["{{inputs.parameters.message}}"]
---
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: workflow-template-hello-world-
spec:
  entrypoint: whalesay
  templates:
  - name: whalesay
    steps:
      - - name: call-whalesay-template
          templateRef:
            name: workflow-template-whalesay-template
            template: whalesay-template
          arguments:
            parameters:
            - name: message
              value: "hello world"

Logs from the workflow controller

time="2022-11-01T18:09:38.511Z" level=info msg="Processing workflow" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.611Z" level=info msg="Updated phase  -> Running" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.611Z" level=info msg="Steps node workflow-template-hello-world-wvw2x initialized Running" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.611Z" level=info msg="StepGroup node workflow-template-hello-world-wvw2x-1392490810 initialized Running" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.613Z" level=info msg="Pod node workflow-template-hello-world-wvw2x-2570399360 initialized Pending" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.746Z" level=info msg="Created pod: workflow-template-hello-world-wvw2x[0].call-whalesay-template (workflow-template-hello-world-wvw2x-whalesay-template-2570399360)" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.746Z" level=info msg="Workflow step group node workflow-template-hello-world-wvw2x-1392490810 not yet completed" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.746Z" level=info msg="TaskSet Reconciliation" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.746Z" level=info msg=reconcileAgentPod namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:38.775Z" level=info msg="Workflow update successful" namespace=argo-workflows phase=Running resourceVersion=4226961899 workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.755Z" level=info msg="Processing workflow" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.756Z" level=info msg="Task-result reconciliation" namespace=argo-workflows numObjs=0 workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.756Z" level=warning msg="workflow uses legacy/insecure pod patch, see https://argoproj.github.io/argo-workflows/workflow-rbac/" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.756Z" level=info msg="node changed" namespace=argo-workflows new.message= new.phase=Succeeded new.progress=0/1 nodeID=workflow-template-hello-world-wvw2x-2570399360 old.message= old.phase=Pending old.progress=0/1 workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="Step group node workflow-template-hello-world-wvw2x-1392490810 successful" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="node workflow-template-hello-world-wvw2x-1392490810 phase Running -> Succeeded" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="node workflow-template-hello-world-wvw2x-1392490810 finished: 2022-11-01 18:09:48.758518001 +0000 UTC" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="Outbound nodes of workflow-template-hello-world-wvw2x-2570399360 is [workflow-template-hello-world-wvw2x-2570399360]" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="Outbound nodes of workflow-template-hello-world-wvw2x is [workflow-template-hello-world-wvw2x-2570399360]" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="node workflow-template-hello-world-wvw2x phase Running -> Succeeded" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="node workflow-template-hello-world-wvw2x finished: 2022-11-01 18:09:48.758889979 +0000 UTC" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="Checking daemoned children of workflow-template-hello-world-wvw2x" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="TaskSet Reconciliation" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg=reconcileAgentPod namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="Updated phase Running -> Succeeded" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.758Z" level=info msg="Marking workflow completed" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.759Z" level=info msg="Marking workflow as pending archiving" namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.760Z" level=info msg="Checking daemoned children of " namespace=argo-workflows workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.765Z" level=info msg="cleaning up pod" action=deletePod key=argo-workflows/workflow-template-hello-world-wvw2x-1340600742-agent/deletePod
time="2022-11-01T18:09:48.788Z" level=info msg="Workflow update successful" namespace=argo-workflows phase=Succeeded resourceVersion=4226962660 workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.803Z" level=info msg="archiving workflow" namespace=argo-workflows uid=cac4aad2-ff5d-418b-8230-407af6abf299 workflow=workflow-template-hello-world-wvw2x
time="2022-11-01T18:09:48.871Z" level=info msg="Queueing Succeeded workflow argo-workflows/workflow-template-hello-world-wvw2x for delete in 24h0m0s due to TTL"
time="2022-11-01T18:09:53.802Z" level=info msg="cleaning up pod" action=deletePod key=argo-workflows/workflow-template-hello-world-wvw2x-whalesay-template-2570399360/deletePod

Logs from in your workflow's wait container

The workflow itself works fine.

@agilgur5 agilgur5 added type/bug P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important solution/suggested A solution to the bug has been suggested. Someone needs to implement it. and removed type/feature Feature request labels Apr 20, 2024
@agilgur5
Copy link
Member

agilgur5 commented Apr 23, 2024

I think is caused here

Code permalink:
https://github.com/argoproj/argo-workflows/blob/v3.4.3/ui/src/app/workflows/components/workflow-logs-viewer/workflow-logs-viewer.tsx#L87

Yea that sounds like an accurate analysis, this probably should use getTemplateNameFromNode instead of node.templateName to properly handle templateRefs

@agilgur5 agilgur5 self-assigned this Apr 23, 2024
@agilgur5 agilgur5 added this to the v3.5.x patches milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui area/workflow-templates P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important solution/suggested A solution to the bug has been suggested. Someone needs to implement it. type/bug
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants