{"record":{"id":"273203c3093c6d98","repo":"argoproj/argo-workflows","slug":"failed-to-parse-cronworkflow-w","errorCode":null,"errorMessage":"failed to parse CronWorkflow: %w","messagePattern":"failed to parse CronWorkflow: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/convert.go","lineNumber":103,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc convertDocument(data []byte, outputFormat string, isJSON bool) error {\n\t// First, determine the kind\n\tvar typeMeta metav1.TypeMeta\n\tif err := yaml.Unmarshal(data, &typeMeta); err != nil {\n\t\treturn fmt.Errorf(\"failed to parse TypeMeta: %w\", err)\n\t}\n\n\tvar converted any\n\n\t// Parse into legacy type and convert to current type\n\tswitch typeMeta.Kind {\n\tcase wf.CronWorkflowKind:\n\t\tvar legacy convert.LegacyCronWorkflow\n\t\tif err := yaml.Unmarshal(data, &legacy); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse CronWorkflow: %w\", err)\n\t\t}\n\t\tconverted = legacy.ToCurrent()\n\n\tcase wf.WorkflowKind:\n\t\tvar legacy convert.LegacyWorkflow\n\t\tif err := yaml.Unmarshal(data, &legacy); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse Workflow: %w\", err)\n\t\t}\n\t\tconverted = legacy.ToCurrent()\n\n\tcase wf.WorkflowTemplateKind:\n\t\tvar legacy convert.LegacyWorkflowTemplate\n\t\tif err := yaml.Unmarshal(data, &legacy); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse WorkflowTemplate: %w\", err)\n\t\t}\n\t\tconverted = legacy.ToCurrent()\n\n\tcase wf.ClusterWorkflowTemplateKind:","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/convert.go#L85-L121","documentation":"When the document's kind is CronWorkflow, convertDocument unmarshals the whole document into convert.LegacyCronWorkflow to migrate singular schedule/mutex/semaphore fields to their plural forms. If that typed unmarshal fails, this error wraps the YAML error (usually a type mismatch or strict field-type problem).","triggerScenarios":"`argo convert` on a CronWorkflow manifest where a field's type doesn't match the legacy struct — e.g. `schedule` as a list instead of string, `startingSeconds`/`concurrencyPolicy` with wrong types, or malformed nested schedules/mutexes structures.","commonSituations":"Hand-migrated CronWorkflows from other tools with divergent field types; YAML anchors/aliases resolving to unexpected types; partially migrated manifests mixing legacy and plural fields with incompatible shapes.","solutions":["Fix the field type named in the wrapped error (e.g. schedule must be a string for the legacy shape)","Validate the CronWorkflow with `argo lint` for schema-level detail","Run `argo convert` with `-o json` to inspect output after fixing, or re-generate the manifest from the current schema","If the doc already uses plural fields and is current, it may not need conversion — verify kind/apiVersion are exactly argoproj.io/v1alpha1 CronWorkflow"],"exampleFix":"// before\nschedule:\n  - \"0 0 * * *\"\n// after\nschedule: \"0 0 * * *\"","handlingStrategy":"validation","validationCode":"yq -e 'select(.kind == \"CronWorkflow\") | .spec.schedule | type == \"string\"' file.yaml \\\n  || echo 'schedule must be a string'","typeGuard":null,"tryCatchPattern":"if ! argo convert \"$f\" 2>err; then\n  grep 'failed to parse CronWorkflow' err && echo 'fix field types in CronWorkflow spec'\nfi","preventionTips":["Keep schedule as a single string; put extra schedules in the plural schedules field","Validate with `argo lint` before converting","Avoid YAML anchors that resolve to lists where scalars are expected","After upstream upgrades, re-lint legacy manifests before converting"],"tags":["cli","yaml","cronworkflow","argoproj"],"backgroundTag":"manifest-parse-failed","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}