argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
15.11k stars 3.21k forks source link

One invalid WorkflowTemplate make all WorkflowTemlate invisible #11278

Open toyamagu-2021 opened 1 year ago

toyamagu-2021 commented 1 year ago

Pre-requisites

What happened/what you expected to happen?

Version

latest(v3.4.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: good
  namespace: argo-workflows
spec:
  entrypoint: whalesay-template
  templates:
    - name: whalesay-template
      container:
        image: docker/whalesay
        command: [cowsay]
---
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: bad
  namespace: argo-workflows
spec:
  entrypoint: whalesay-template
  templates:
    - name: whalesay-template
      container:
        image: docker/whalesay
        command: this-is-invalid

-

Logs from the workflow controller

Logs from workflow server

argo-workflows-server-69ffff554c-7qskg argo-server time="2023-06-29T12:08:03.355Z" level=info duration=6.17825ms method=GET path=/api/v1/workflows/argo size=52 status=0
argo-workflows-server-69ffff554c-7qskg argo-server time="2023-06-29T12:08:17.239Z" level=error msg="finished unary call with code Internal" error="rpc error: code = Internal desc = json: cannot unmarshal string into Go struct field Container.items.spec.templates.container.command of type []string" grpc.code=Internal grpc.method=ListWorkflowTemplates grpc.service=workflowtemplate.WorkflowTemplateService grpc.start_time="2023-06-29T12:08:17Z" grpc.time_ms=2.287 span.kind=server system=grpc
argo-workflows-server-69ffff554c-7qskg argo-server time="2023-06-29T12:08:17.239Z" level=info duration=2.655417ms method=GET path=/api/v1/workflow-templates/argo-workflows size=140 status=500

Logs from in your workflow's wait container

N/A
terrytangyuan commented 1 year ago

This is an issue on Argo Server side. It's using the generated Argo client's list method. Not sure if there's anything we can customize though.

toyamagu-2021 commented 1 year ago

Thanks! Agree. I dug into the code but only knew it's not simple. We might change the list logic considerably...

terrytangyuan commented 1 year ago

Yes exactly

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

tooptoop4 commented 2 weeks ago

related to https://github.com/argoproj/argo-workflows/issues/10229 / https://github.com/argoproj/argo-workflows/issues/10264 / https://github.com/argoproj/argo-workflows/issues/9316