{"record":{"id":"e3a5e194a300ec6d","repo":"apolloconfig/apollo","slug":"public-appnamespace-not-exists-namespacename-s","errorCode":null,"errorMessage":"Public appNamespace not exists. NamespaceName = %s","messagePattern":"Public appNamespace not exists\\. NamespaceName = (.+?)","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/NamespaceService.java","lineNumber":179,"sourceCode":"    // and default cluster's namespace exist and has published.\n    // return default cluster's namespace\n    Release defaultNamespaceLatestActiveRelease =\n        releaseService.findLatestActiveRelease(defaultNamespace);\n    if (defaultNamespaceLatestActiveRelease != null) {\n      return defaultNamespace;\n    }\n\n    // custom cluster's namespace exist but never published.\n    // and default cluster's namespace exist but never published.\n    // return custom cluster's namespace\n    return namespace;\n  }\n\n  public List<Namespace> findPublicAppNamespaceAllNamespaces(String namespaceName, Pageable page) {\n    AppNamespace publicAppNamespace = appNamespaceService.findPublicNamespaceByName(namespaceName);\n\n    if (publicAppNamespace == null) {\n      throw new BadRequestException(\n          String.format(\"Public appNamespace not exists. NamespaceName = %s\", namespaceName));\n    }\n\n    List<Namespace> namespaces = namespaceRepository.findByNamespaceName(namespaceName, page);\n\n    return filterChildNamespace(namespaces);\n  }\n\n  private List<Namespace> filterChildNamespace(List<Namespace> namespaces) {\n    List<Namespace> result = new LinkedList<>();\n\n    if (CollectionUtils.isEmpty(namespaces)) {\n      return result;\n    }\n\n    for (Namespace namespace : namespaces) {\n      if (!isChildNamespace(namespace)) {\n        result.add(namespace);","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/apolloconfig/apollo/blob/d95fc18d112589efc09ddcbe1507047584d55251/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/NamespaceService.java#L161-L197","documentation":"Thrown as BadRequestException (HTTP 400) by NamespaceService.findPublicAppNamespaceAllNamespaces when the supplied namespaceName is not registered as a PUBLIC AppNamespace (appNamespaceService.findPublicNamespaceByName returns null). Apollo only resolves 'all namespaces across apps' for namespaces explicitly marked public; private app namespaces cannot be queried this way.","triggerScenarios":"Calling findPublicAppNamespaceAllNamespaces(namespaceName, page) with a namespace name that is either misspelled, does not exist, or exists only as a private (non-public) AppNamespace.","commonSituations":"Listing which apps consume a shared namespace; querying a namespace that was created as private by default; typo or wrong casing in the namespace name.","solutions":["Verify the namespace is registered as public: check AppNamespace.isPublic=true for that namespaceName in the portal DB.","Correct the namespace name / casing to match the registered public AppNamespace.","If it must be public, convert/recreate it as a public AppNamespace before querying."],"exampleFix":"// before\nappNamespaceService.findPublicAppNamespaceAllNamespaces(\"myconfig\", page); // not public -> 400\n// after\nAppNamespace an = appNamespaceService.findByAppIdAndName(appId, \"myconfig\");\nif (an == null || !an.isPublic()) {\n  // register/convert as public first, or use a private lookup instead\n}","handlingStrategy":"validation","validationCode":"AppNamespace pub = appNamespaceService.findPublicNamespaceByName(namespaceName);\nif (pub == null) {\n  // not public/unknown — do not call findPublicAppNamespaceAllNamespaces\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cache/memoize the set of public AppNamespace names.","Validate namespaceName is registered public before any 'all namespaces' query.","Treat a null public AppNamespace as a hard precondition failure at the controller."],"tags":["namespace","public-namespace","bad-request","apollo-biz","validation"],"backgroundTag":null,"analyzedSha":"d95fc18d112589efc09ddcbe1507047584d55251","analyzedAt":"2026-08-14T04:00:05.477Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}