argoproj/argo-workflows · error

failed to find any artifact repository for artifact reposito

Error message

failed to find any artifact repository for artifact repository ref "%v"

What it means

Resolve exhausted all candidate artifact-repository refs (workflow namespace ref, then controller-namespace/default ref) without finding a usable repository. NotFound and missing-key errors are deliberately skipped while iterating; reaching the end means no candidate resolved, so workflow artifact handling cannot proceed.

Source

Thrown at workflow/artifactrepositories/artifactrepositories.go:62

		}
	} else {
		refs = []*wfv1.ArtifactRepositoryRefStatus{
			{Namespace: workflowNamespace},
			{Default: true},
		}
	}
	for _, r := range refs {
		resolvedRef, err := s.get(ctx, r)
		if err != nil && (apierr.IsNotFound(err) || strings.Contains(err.Error(), "config map missing key")) {
			continue
		}
		if err != nil {
			return nil, fmt.Errorf(`error getting config map for artifact repository ref "%v": %w`, r, err)
		}
		logging.RequireLoggerFromContext(ctx).WithField("artifactRepositoryRef", r).Info(ctx, "resolved artifact repository")
		return resolvedRef, nil
	}
	return nil, fmt.Errorf(`failed to find any artifact repository for artifact repository ref "%v"`, ref)
}

func (s *artifactRepositories) Get(ctx context.Context, ref *wfv1.ArtifactRepositoryRefStatus) (*wfv1.ArtifactRepository, error) {
	ref, err := s.get(ctx, ref)
	if err != nil {
		return nil, err
	}
	return ref.ArtifactRepository, nil
}

func (s *artifactRepositories) get(ctx context.Context, ref *wfv1.ArtifactRepositoryRefStatus) (*wfv1.ArtifactRepositoryRefStatus, error) {
	if ref.ArtifactRepository != nil {
		return ref, nil
	}
	if ref.Default {
		return &wfv1.ArtifactRepositoryRefStatus{
			ArtifactRepositoryRef: ref.ArtifactRepositoryRef,
			Namespace:             ref.Namespace,

View on GitHub (pinned to 35bff19146)

Solutions

  1. Create/fix the artifact-repositories ConfigMap so it has an entry for the referenced key (YAML of an ArtifactRepository under that key)
  2. If the workflow sets artifactRepositoryRef, ensure the ConfigMap+key exist in the workflow's namespace or the controller's namespace
  3. Set the controller's configured default artifact repository (configmap artifactRepository section) so the Default fallback resolves
  4. Verify the default-artifact-repository annotation on the ConfigMap names an existing key

Example fix

# before: no usable ref
# after: add the key the ref expects
apiVersion: v1
kind: ConfigMap
metadata:
  name: artifact-repositories
  namespace: <workflow-namespace>
data:
  s3-artifacts: |
    s3:
      bucket: my-bucket
      endpoint: s3.amazonaws.com
Defensive patterns

Strategy: fallback

Validate before calling

// check a usable ref exists before submitting a workflow that requires artifacts
refs := []struct{ ns, cm, key string }{{wfNamespace, "artifact-repositories", key}, {controllerNs, "artifact-repositories", key}}
for _, r := range refs {
    if cm, err := kube.CoreV1().ConfigMaps(r.ns).Get(ctx, r.cm, metav1.GetOptions{}); err == nil {
        if _, ok := cm.Data[r.key]; ok { return nil } // usable
    }
}
return errors.New("no artifact repository ref will resolve; configure one first")

Try / catch

_, err := repos.Resolve(ctx, ref, wfNamespace)
if err != nil && strings.Contains(err.Error(), "failed to find any artifact repository") {
    return createDefaultArtifactRepositoryConfigMap(ctx, wfNamespace) // fallback: provision it
}

Prevention

When it happens

Trigger: Calling Resolve when: the workflow's artifactRepositoryRef ConfigMap/key doesn't exist in the workflow namespace or controller namespace, and no default artifact repository is configured (no artifact-repositories ConfigMap with a matching key, and controller started without configured defaultArtifactRepository).

Common situations: Fresh install where the artifact-repositories ConfigMap was never created; workflow specifies artifactRepositoryRef with a key absent from the ConfigMap; annotation workflows.argoproj.io/default-artifact-repository points to a non-existent key; ref exists only in a namespace the controller doesn't fall back to.

Related errors


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