{"record":{"id":"a61d7b271c581849","repo":"argoproj/argo-workflows","slug":"failed-to-find-any-artifact-repository-for-artifac","errorCode":null,"errorMessage":"failed to find any artifact repository for artifact repository ref \"%v\"","messagePattern":"failed to find any artifact repository for artifact repository ref \"(.+?)\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/artifactrepositories/artifactrepositories.go","lineNumber":62,"sourceCode":"\t\t}\n\t} else {\n\t\trefs = []*wfv1.ArtifactRepositoryRefStatus{\n\t\t\t{Namespace: workflowNamespace},\n\t\t\t{Default: true},\n\t\t}\n\t}\n\tfor _, r := range refs {\n\t\tresolvedRef, err := s.get(ctx, r)\n\t\tif err != nil && (apierr.IsNotFound(err) || strings.Contains(err.Error(), \"config map missing key\")) {\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(`error getting config map for artifact repository ref \"%v\": %w`, r, err)\n\t\t}\n\t\tlogging.RequireLoggerFromContext(ctx).WithField(\"artifactRepositoryRef\", r).Info(ctx, \"resolved artifact repository\")\n\t\treturn resolvedRef, nil\n\t}\n\treturn nil, fmt.Errorf(`failed to find any artifact repository for artifact repository ref \"%v\"`, ref)\n}\n\nfunc (s *artifactRepositories) Get(ctx context.Context, ref *wfv1.ArtifactRepositoryRefStatus) (*wfv1.ArtifactRepository, error) {\n\tref, err := s.get(ctx, ref)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ref.ArtifactRepository, nil\n}\n\nfunc (s *artifactRepositories) get(ctx context.Context, ref *wfv1.ArtifactRepositoryRefStatus) (*wfv1.ArtifactRepositoryRefStatus, error) {\n\tif ref.ArtifactRepository != nil {\n\t\treturn ref, nil\n\t}\n\tif ref.Default {\n\t\treturn &wfv1.ArtifactRepositoryRefStatus{\n\t\t\tArtifactRepositoryRef: ref.ArtifactRepositoryRef,\n\t\t\tNamespace:             ref.Namespace,","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifactrepositories/artifactrepositories.go#L44-L80","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Create/fix the artifact-repositories ConfigMap so it has an entry for the referenced key (YAML of an ArtifactRepository under that key)","If the workflow sets artifactRepositoryRef, ensure the ConfigMap+key exist in the workflow's namespace or the controller's namespace","Set the controller's configured default artifact repository (configmap artifactRepository section) so the Default fallback resolves","Verify the default-artifact-repository annotation on the ConfigMap names an existing key"],"exampleFix":"# before: no usable ref\n# after: add the key the ref expects\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: artifact-repositories\n  namespace: <workflow-namespace>\ndata:\n  s3-artifacts: |\n    s3:\n      bucket: my-bucket\n      endpoint: s3.amazonaws.com","handlingStrategy":"fallback","validationCode":"// check a usable ref exists before submitting a workflow that requires artifacts\nrefs := []struct{ ns, cm, key string }{{wfNamespace, \"artifact-repositories\", key}, {controllerNs, \"artifact-repositories\", key}}\nfor _, r := range refs {\n    if cm, err := kube.CoreV1().ConfigMaps(r.ns).Get(ctx, r.cm, metav1.GetOptions{}); err == nil {\n        if _, ok := cm.Data[r.key]; ok { return nil } // usable\n    }\n}\nreturn errors.New(\"no artifact repository ref will resolve; configure one first\")","typeGuard":null,"tryCatchPattern":"_, err := repos.Resolve(ctx, ref, wfNamespace)\nif err != nil && strings.Contains(err.Error(), \"failed to find any artifact repository\") {\n    return createDefaultArtifactRepositoryConfigMap(ctx, wfNamespace) // fallback: provision it\n}","preventionTips":["Deploy the artifact-repositories ConfigMap (with matching key) as part of namespace setup","Set the controller-level default artifact repository so the Default fallback always works","Keep the default-artifact-repository annotation pointing at an existing key","Validate artifactRepositoryRef in workflow lint/submit against existing ConfigMaps"],"tags":["kubernetes","configmap","artifact-repository","configuration"],"backgroundTag":"artifact-repository-not-configured","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"}