{"record":{"id":"bfac6aa90ba50ffe","repo":"argoproj/argo-workflows","slug":"memoization-configmap-doesn-t-have-s-label-refus","errorCode":null,"errorMessage":"memoization configmap doesn't have %s label, refusing to use it","messagePattern":"memoization configmap doesn't have (.+?) label, refusing to use it","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/controller/cache/configmap_cache.go","lineNumber":60,"sourceCode":"\tlogger := logging.RequireLoggerFromContext(ctx)\n\tlogger.WithFields(logging.Fields{\"namespace\": c.namespace, \"name\": c.name}).WithFields(fields).WithError(err).Debug(ctx, message)\n}\n\nfunc (c *configMapCache) logInfo(ctx context.Context, fields logging.Fields, message string) {\n\tlogger := logging.RequireLoggerFromContext(ctx)\n\tlogger.WithFields(logging.Fields{\"namespace\": c.namespace, \"name\": c.name}).WithFields(fields).Info(ctx, message)\n}\n\nfunc (c *configMapCache) validateConfigmap(ctx context.Context, cm *apiv1.ConfigMap) error {\n\tlabel, foundLabel := cm.GetLabels()[common.LabelKeyConfigMapType]\n\terrString := \"\"\n\tif !foundLabel {\n\t\terrString = fmt.Sprintf(\"memoization configmap doesn't have %s label, refusing to use it\", common.LabelKeyConfigMapType)\n\t} else if label != common.LabelValueTypeConfigMapCache {\n\t\terrString = fmt.Sprintf(\"memoization configmap doesn't have label %s = %s, refusing to use it\", common.LabelKeyConfigMapType, common.LabelValueTypeConfigMapCache)\n\t}\n\tif errString != \"\" {\n\t\terr := errors.New(errString)\n\t\tc.logError(ctx, err, logging.Fields{}, errString)\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (c *configMapCache) Load(ctx context.Context, key string) (*Entry, error) {\n\tvar entry *Entry\n\terr := retry.OnError(kwait.Backoff{\n\t\tDuration: time.Second,\n\t\tFactor:   2,\n\t\tJitter:   0.1,\n\t\tSteps:    5,\n\t\tCap:      30 * time.Second,\n\t}, func(err error) bool {\n\t\treturn argoerr.IsTransientErr(ctx, err) || apierr.IsConflict(err)\n\t}, func() error {\n\t\tvar innerErr error","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/controller/cache/configmap_cache.go#L42-L78","documentation":"Memoization caches are stored in ConfigMaps that must carry the label `workflows.argoproj.io/configmap-type: Cache`. validateConfigMap refuses to use a ConfigMap missing the type label or having the wrong value, to prevent accidentally corrupting an arbitrary user ConfigMap with cache data.","triggerScenarios":"Calling load() or save() on a configMapCache whose referenced ConfigMap either lacks the `workflows.argoproj.io/configmap-type` label entirely, or has it set to something other than `Cache`.","commonSituations":"User created the ConfigMap by hand and forgot the label; label value typo'd (e.g. `cache` lowercase instead of `Cache`); copied a ConfigMap from another memoization setup with a different label scheme; kubectl apply dropped labels during an update.","solutions":["Label the ConfigMap: `kubectl label configmap my-cache workflows.argoproj.io/configmap-type=Cache`.","Check the label value exactly matches `Cache` (case-sensitive).","Re-apply the ConfigMap manifest including the label; verify with `kubectl get cm my-cache --show-labels`."],"exampleFix":"# before\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: my-cache\n# after\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: my-cache\n  labels:\n    workflows.argoproj.io/configmap-type: Cache","handlingStrategy":"validation","validationCode":"cm, err := clientset.CoreV1().ConfigMaps(ns).Get(ctx, name, metav1.GetOptions{})\nif err != nil { return err }\nl, ok := cm.Labels[\"workflows.argoproj.io/configmap-type\"]\nif !ok || l != \"Cache\" {\n    return fmt.Errorf(\"configmap %s must have label workflows.argoproj.io/configmap-type=Cache\", name)\n}","typeGuard":null,"tryCatchPattern":"if err := cache.Save(...); err != nil && strings.Contains(err.Error(), \"refusing to use it\") {\n    // fix the ConfigMap labels, then retry\n}","preventionTips":["Create memoization ConfigMaps from a templated manifest that always includes the type label","Check labels after every kubectl apply/edit (edits can drop labels)","Use `kubectl get cm <name> --show-labels` as a pre-flight check"],"tags":["memoization","configmap","config","kubernetes"],"backgroundTag":"configmap-missing-required-label","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}