argoproj/argo-workflows · error

no valid source is used for data template

Error message

no valid source is used for data template

What it means

A Data template declared a source that the controller cannot process: only source.artifactPaths is supported, and it was nil/absent. processSource falls through to its default branch and returns this error, meaning the data source configuration itself is invalid rather than a storage failure.

Source

Thrown at workflow/data/data.go:34

	}
	transformedData, err := processTransformation(sourcedData, &data.Transformation)
	if err != nil {
		return nil, fmt.Errorf("unable to process data transformation: %w", err)
	}
	return transformedData, nil
}

func processSource(ctx context.Context, source wfv1.DataSource, processor wfv1.DataSourceProcessor) (any, error) {
	var data any
	var err error
	switch {
	case source.ArtifactPaths != nil:
		data, err = processor.ProcessArtifactPaths(ctx, source.ArtifactPaths)
		if err != nil {
			return nil, fmt.Errorf("unable to source artifact paths: %w", err)
		}
	default:
		return nil, fmt.Errorf("no valid source is used for data template")
	}

	return data, nil
}

func processTransformation(data any, transformation *wfv1.Transformation) (any, error) {
	if transformation == nil {
		return data, nil
	}

	var err error
	for i, step := range *transformation {
		if step.Expression != "" {
			data, err = processExpression(step.Expression, data)
		}
		if err != nil {
			return nil, fmt.Errorf("error processing data step %d: %w", i, err)
		}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Ensure spec.data.source.artifactPaths is populated with a valid artifact repository source
  2. Check YAML indentation — artifactPaths must be directly under source
  3. Run argo lint on the workflow to catch malformed data sources before submit
  4. If you intended another source type, verify your Argo version supports it (only artifactPaths is implemented)

Example fix

// before
source:
  git:
    repo: https://github.com/x/y   # unsupported source
// after
source:
  artifactPaths:
    s3:
      bucket: my-bucket
      key: artifacts/*.tgz
Defensive patterns

Strategy: validation

Validate before calling

// Validate Data template shape before submit
if wfTmpl.Data == nil || wfTmpl.Data.Source.ArtifactPaths == nil {
    return fmt.Errorf("template %q: data.source.artifactPaths is required", wfTmpl.Name)
}

Prevention

When it happens

Trigger: spec.data.source is empty, or set to a non-artifactPaths source (unsupported/misspelled field), so the switch finds no case and hits default.

Common situations: YAML indentation putting artifactPaths at the wrong level, using a source type from another tool or a future Argo version, or a typo like artifactPath(singular).

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/19c6cdc01b4527e0. Report an issue: GitHub.