{"record":{"id":"513f236111595c47","repo":"quarkusio/quarkus","slug":"type-name-not-found-plus-namespace-hint-or","errorCode":null,"errorMessage":"<type> '<name>' not found (plus namespace hint or ' in namespace <namespace>')","messagePattern":"<type> '<name>' not found \\(plus namespace hint or ' in namespace <namespace>'\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactory.java","lineNumber":174,"sourceCode":"            }\n            return result;\n        } catch (Exception e) {\n            throw new RuntimeException(\"Unable to obtain configuration for Secret objects from Kubernetes API Server at: \"\n                    + client.getConfiguration().getMasterUrl(), e);\n        }\n    }\n\n    private void logMissingOrFail(String name, String namespace, String type, boolean failOnMissingConfig) {\n        String message = type + \" '\" + name + \"' not found\";\n        if (namespace == null) {\n            message = message\n                    + \". No Kubernetes namespace was set (most likely because the application is running outside the Kubernetes cluster). Consider setting 'quarkus.kubernetes-client.namespace=my-namespace' to specify the namespace in which to look up the \"\n                    + type;\n        } else {\n            message = message + \" in namespace '\" + namespace + \"'\";\n        }\n        if (failOnMissingConfig) {\n            throw new RuntimeException(message);\n        } else {\n            log.info(message);\n        }\n    }\n}\n","sourceCodeStart":156,"sourceCodeEnd":180,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactory.java#L156-L180","documentation":"logMissingOrFail builds a message '<type> <name> not found' with a namespace hint, and when quarkus.kubernetes-config.fail-on-missing-config is true it throws a RuntimeException naming the missing ConfigMap or Secret. It is thrown deliberately for a resource the user asked for that simply does not exist in the looked-up namespace. When fail-on-missing is false it only logs at info level.","triggerScenarios":"A name listed in quarkus.kubernetes-config.config-maps or quarkus.kubernetes-config.secrets (or via programmatic registration) is not found in the namespace — either the object does not exist, the namespace is wrong, or (outside a cluster) no namespace is set so the lookup targets nothing.","commonSituations":"Typo in ConfigMap/Secret name; resource created in a different namespace than quarkus.kubernetes-config.namespaces; app running locally/outside cluster with no quarkus.kubernetes-client.namespace, so the default namespace is empty; resource deleted after deployment.","solutions":["Create the missing ConfigMap/Secret in the namespace indicated in the message (kubectl apply / kubectl create).","Check quarkus.kubernetes-config.namespaces for typos and ensure the resource exists there.","Set quarkus.kubernetes-client.namespace explicitly when running outside the cluster.","If absence is acceptable, set quarkus.kubernetes-config.fail-on-missing-config=false to downgrade to a log message.","Verify the name matches exactly (names are case-sensitive, no stray whitespace)."],"exampleFix":"// before: name/namespace mismatch\nquarkus.kubernetes-config.config-maps=app-cfg\n// after: resource exists in 'prod' namespace\nquarkus.kubernetes-config.config-maps=app-cfg\nquarkus.kubernetes-config.namespaces=prod\n# or tolerate absence:\n# quarkus.kubernetes-config.fail-on-missing-config=false","handlingStrategy":"validation","validationCode":"// Verify every configured resource exists before startup:\nString ns = \"my-namespace\";\nfor (String cm : List.of(\"app-cfg\")) {\n    if (client.configMaps().inNamespace(ns).withName(cm).get() == null) {\n        throw new IllegalStateException(\"Missing ConfigMap \" + cm + \" in \" + ns);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    app.start();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"not found\")) {\n        log.error(\"Config resource missing: {}\", e.getMessage()); // includes name + namespace hint\n    }\n}","preventionTips":["Keep ConfigMap/Secret manifests in the same repo/CD pipeline as the app so they deploy together.","Use exact, reviewed names in quarkus.kubernetes-config.* — no hand-typed strings in prod.","Set quarkus.kubernetes-client.namespace when running outside the cluster.","Use fail-on-missing-config=false only when absence is genuinely acceptable."],"tags":["kubernetes","config-source","missing-resource","namespace"],"backgroundTag":"missing-kubernetes-resource","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}