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

Wrong podName in workflow.status #10124

Closed
2 of 3 tasks
ognjen-it opened this issue Nov 28, 2022 · 1 comment · Fixed by #10268
Closed
2 of 3 tasks

Wrong podName in workflow.status #10124

ognjen-it opened this issue Nov 28, 2022 · 1 comment · Fixed by #10268
Assignees
Labels
P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important type/bug

Comments

@ognjen-it
Copy link

ognjen-it commented Nov 28, 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?

workflow.status contains podName, but wrong. It doesn't include the template name in the middle of the name.
podName from workflow.status is: dev-test-jpx47-486552824
Real pod name in kubernetes is: dev-test-jpx47-test-template-486552824

Version

latest

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: Sensor
metadata:
  name: dev-test
  namespace: argo
spec:
  template:
    serviceAccountName: argo-events-sa
  dependencies:
    - name: webhook-dep
      eventSourceName: test-es
      eventName: test
  triggers:
    - template:
        name: webhook-workflow-trigger
        k8s:
          group: argoproj.io
          version: v1alpha1
          resource: workflows
          operation: create
          source:
            resource:
              apiVersion: argoproj.io/v1alpha1
              kind: Workflow
              metadata:
                generateName: dev-test-
                namespace: argo
              spec:
                entrypoint: dev-test-rp
                onExit: container-test-workflow-failures
                templates:
                # Slack notification
                - name: container-test-workflow-failures
                  container:
                    image: everpeace/curl-jq
                    command: ["/bin/bash"]
                    args:
                    - -c
                    - "if [ {{workflow.status}} == \"Failed\" ] || [ {{workflow.status}} == \"Error\" ];then 
                      export ERROR_DETAILS=$(echo -n {{workflow.failures}} | jq '[ .[] | select(.message | contains(\"Error\")) | {displayName, podName, finishedAt, message} ]' ) && \
                      echo $ERROR_DETAILS;fi"
                - name: dev-test-rp
                  dag:
                    tasks:
                    - name: seq
                      template: test-template
                - name: test-template
                  container:
                    image: everpeace/curl-jq
                    command: ["/bin/bash"]
                    args: 
                    - -c 
                    - exit 1

Logs from the workflow controller

I don't think it's relevant

Logs from in your workflow's wait container

time="2022-11-28T09:53:25.972Z" level=info msg="Starting Workflow Executor" version=untagged
time="2022-11-28T09:53:25.975Z" level=info msg="Using executor retry strategy" Duration=1s Factor=1.6 Jitter=0.5 Steps=5
time="2022-11-28T09:53:25.975Z" level=info msg="Executor initialized" deadline="0001-01-01 00:00:00 +0000 UTC" includeScriptOutput=false namespace=argo-common-ns podName=dev-test-jpx47-container-test-workflow-failures-1910154348 template="{\"name\":\"container-test-workflow-failures\",\"inputs\":{},\"outputs\":{},\"metadata\":{},\"container\":{\"name\":\"\",\"image\":\"everpeace/curl-jq\",\"command\":[\"/bin/bash\"],\"args\":[\"-c\",\"if [ Failed == \\\"Failed\\\" ] || [ Failed == \\\"Error\\\" ];then export ERROR_DETAILS=$(echo -n \\\"[{\\\\\\\"displayName\\\\\\\":\\\\\\\"dev-test-jpx47\\\\\\\",\\\\\\\"message\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"templateName\\\\\\\":\\\\\\\"dev-test-rp\\\\\\\",\\\\\\\"phase\\\\\\\":\\\\\\\"Failed\\\\\\\",\\\\\\\"podName\\\\\\\":\\\\\\\"dev-test-jpx47\\\\\\\",\\\\\\\"finishedAt\\\\\\\":\\\\\\\"2022-11-28T09:53:21Z\\\\\\\"},{\\\\\\\"displayName\\\\\\\":\\\\\\\"seq\\\\\\\",\\\\\\\"message\\\\\\\":\\\\\\\"Error (exit code 1)\\\\\\\",\\\\\\\"templateName\\\\\\\":\\\\\\\"test-template\\\\\\\",\\\\\\\"phase\\\\\\\":\\\\\\\"Failed\\\\\\\",\\\\\\\"podName\\\\\\\":\\\\\\\"dev-test-jpx47-486552824\\\\\\\",\\\\\\\"finishedAt\\\\\\\":\\\\\\\"2022-11-28T09:53:08Z\\\\\\\"}]\\\" | jq '[ .[] | select(.message | contains(\\\"Error\\\")) | {displayName, podName, finishedAt, message} ]' ) \\u0026\\u0026 echo $ERROR_DETAILS;fi\"],\"envFrom\":[{\"secretRef\":{\"name\":\"thingsolver-slack-token\"}}],\"resources\":{}}}" version="&Version{Version:untagged,BuildDate:2022-11-18T17:11:48Z,GitCommit:74766d566c41752dcd64eb690cd06abecdf8e79c,GitTag:untagged,GitTreeState:clean,GoVersion:go1.18.8,Compiler:gc,Platform:linux/amd64,}"
time="2022-11-28T09:53:25.975Z" level=info msg="Starting deadline monitor"
time="2022-11-28T09:53:28.977Z" level=info msg="Main container completed" error="<nil>"
time="2022-11-28T09:53:28.977Z" level=info msg="No Script output reference in workflow. Capturing script output ignored"
time="2022-11-28T09:53:28.977Z" level=info msg="No output parameters"
time="2022-11-28T09:53:28.977Z" level=info msg="No output artifacts"
time="2022-11-28T09:53:28.977Z" level=info msg="Alloc=6293 TotalAlloc=12049 Sys=18642 NumGC=4 Goroutines=7"
time="2022-11-28T09:53:05.476Z" level=info msg="Using executor retry strategy" Duration=1s Factor=1.6 Jitter=0.5 Steps=5
time="2022-11-28T09:53:05.476Z" level=info msg="Executor initialized" deadline="0001-01-01 00:00:00 +0000 UTC" includeScriptOutput=false namespace=argo-common-ns podName=dev-test-jpx47-test-template-486552824 template="{\"name\":\"test-template\",\"inputs\":{},\"outputs\":{},\"metadata\":{},\"container\":{\"name\":\"\",\"image\":\"everpeace/curl-jq\",\"command\":[\"/bin/bash\"],\"args\":[\"-c\",\"exit 1\"],\"resources\":{}}}" version="&Version{Version:untagged,BuildDate:2022-11-18T17:11:48Z,GitCommit:74766d566c41752dcd64eb690cd06abecdf8e79c,GitTag:untagged,GitTreeState:clean,GoVersion:go1.18.8,Compiler:gc,Platform:linux/amd64,}"
time="2022-11-28T09:53:05.476Z" level=info msg="Starting deadline monitor"
time="2022-11-28T09:53:08.477Z" level=info msg="Main container completed" error="<nil>"
time="2022-11-28T09:53:08.478Z" level=info msg="No Script output reference in workflow. Capturing script output ignored"
time="2022-11-28T09:53:08.478Z" level=info msg="No output parameters"
time="2022-11-28T09:53:08.478Z" level=info msg="No output artifacts"
time="2022-11-28T09:53:08.478Z" level=info msg="stopping progress monitor (context done)" error="context canceled"
time="2022-11-28T09:53:08.478Z" level=info msg="Deadline monitor stopped"
time="2022-11-28T09:53:08.478Z" level=info msg="Alloc=6405 TotalAlloc=12268 Sys=18642 NumGC=4 Goroutines=6"
@sarabala1979 sarabala1979 added the P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important label Nov 28, 2022
alexec pushed a commit that referenced this issue Jan 5, 2023
Signed-off-by: Isitha Subasinghe <isitha@pipekit.io>
reddymh pushed a commit to reddymh/argo-workflows that referenced this issue Jan 31, 2023
… (argoproj#10268)

Signed-off-by: Isitha Subasinghe <isitha@pipekit.io>
Signed-off-by: Rajshekar Reddy <reddymh@gmail.com>
@or-shachar
Copy link
Contributor

or-shachar commented Apr 27, 2023

@alexec - Is it possible that the UI is still having this issue sometimes ?
I'm using Argo v3.4.5 and for some of the running children (still haven't figured out when) the UI shows the pod name as equals to the ID of the children and not the actual pod name. In those cases - the UI fails to stream logs from a running pod. After the pod completes - it updates everything well and I can see the logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants