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

Cannot read properties of undefined (reading 'map') on /cron-workflows/ #14047

Open
4 tasks done
lucasfcnunes opened this issue Jan 2, 2025 · 4 comments
Open
4 tasks done

Comments

@lucasfcnunes
Copy link

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?

Cannot read properties of undefined (reading 'map')

Stack Trace
TypeError: Cannot read properties of undefined (reading 'map')
    at https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1319767
    at Array.map (<anonymous>)
    at Du (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1318919)
    at gi (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:568406)
    at Os (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:582444)
    at _l (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:628214)
    at vc (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:616599)
    at bc (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:616527)
    at gc (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:616390)
    at ac (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:613225)
Component Stack

    at Du (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1316183)
    at t (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1138926)
    at t (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1136727)
    at component (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1321087)
    at t (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1138926)
    at t (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1136727)
    at Ap (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1389676)
    at div
    at div
    at Kt (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1132853)
    at t (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1136727)
    at t (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1134386)
    at py (https://argo-workflows.*/main.0de823e421cfaf8764f0.js:2:1508210)
    at hy

Screenshot

2025-01-02_190050

Version(s)

v3.6.2

Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflow that uses private images.

Goto https://argo-workflows.*/cron-workflows/

Logs from the workflow controller

N/A (frontend issue)

Logs from in your workflow's wait container

N/A (frontend issue)
@MasonM
Copy link
Contributor

MasonM commented Jan 4, 2025

I can't reproduce this, but I inspected the JS from that release, and it looks like the error is on this line: https://github.com/argoproj/argo-workflows/blob/v3.6.2/ui/src/cron-workflows/cron-workflow-list.tsx#L174

which should only happen if you have a CronWorkflow that doesn't define either schedule or schedules. I'm not sure how that can happen, but it's theoretically possible. Can you run this command to check?

kubectl get cronworkflow  -o json | jq -r '.items[] | select(.spec | has("schedule") or has("schedules") | not)'

@MasonM
Copy link
Contributor

MasonM commented Jan 4, 2025

This might be the same issue as #14009

@MasonM MasonM added the problem/more information needed Not enough information has been provide to diagnose this issue. label Jan 11, 2025
@lucasfcnunes
Copy link
Author

I have migrated all my CronWorkflows from spec.schedule to spec.schedules and set the ones missing a the key to an empty array (spec.schedules: []).

Sadly, UI still breaks.

@MasonM
Copy link
Contributor

MasonM commented Jan 17, 2025

@lucasfcnunes

set the ones missing a the key to an empty array (spec.schedules: []).

Specifying an empty array for schedules and nothing for schedule isn't valid, but I was able to reproduce the UI error when I manually created a CronWorkflow with that:

apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
  name: testschedules
spec:
  schedules: []
  workflowSpec:
    entrypoint: main
    templates:
      - name: main
        container:
          image: argoproj/argosay:v2

Fixing the UI to handle that wouldn't be hard, but that leaves the question of how this happened. Were these invalid CronWorkflows created manually, or were they corrupted somehow? Also, I'm not sure if we used to allow omitting the schedule field. If so, how exactly did those CronWorkflows behave?

@MasonM MasonM removed the problem/more information needed Not enough information has been provide to diagnose this issue. label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants