{"record":{"id":"b9827191f528b6c2","repo":"apache/pulsar","slug":"bundle-range-s-not-found","errorCode":null,"errorMessage":"Bundle range %s not found","messagePattern":"Bundle range (.+?) not found","errorType":"http","errorClass":"RestException","httpStatus":404,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java","lineNumber":1674,"sourceCode":"                                }\n                                return new TopicHashPositions(namespaceName.toString(), bundleRange,\n                                        topicHashPositions);\n                            });\n                });\n    }\n\n    private CompletableFuture<String> getBundleRangeAsync(String bundleName) {\n        CompletableFuture<NamespaceBundle> future;\n        if (BundleType.LARGEST.toString().equals(bundleName)) {\n            future = findLargestBundleWithTopicsAsync(namespaceName);\n        } else if (BundleType.HOT.toString().equals(bundleName)) {\n            future = findHotBundleAsync(namespaceName);\n        } else {\n            return CompletableFuture.completedFuture(bundleName);\n        }\n        return future.thenApply(nsBundle -> {\n            if (nsBundle == null) {\n                throw new RestException(Status.NOT_FOUND,\n                        String.format(\"Bundle range %s not found\", bundleName));\n            }\n            return nsBundle.getBundleRange();\n        });\n    }\n\n    private CompletableFuture<NamespaceBundle> findLargestBundleWithTopicsAsync(NamespaceName namespaceName) {\n        return pulsar().getNamespaceService().getNamespaceBundleFactory()\n                .getBundleWithHighestTopicsAsync(namespaceName);\n    }\n\n    private CompletableFuture<NamespaceBundle> findHotBundleAsync(NamespaceName namespaceName) {\n        return pulsar().getNamespaceService().getNamespaceBundleFactory()\n                .getBundleWithHighestThroughputAsync(namespaceName);\n    }\n\n    protected void internalSetPublishRate(PublishRate maxPublishMessageRate) {\n        validateSuperUserAccess();","sourceCodeStart":1656,"sourceCodeEnd":1692,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L1656-L1692","documentation":"This error is thrown by the namespace admin API when resolving a bundle for a namespace (e.g. via the 'get bundle range by name' / split/unload path). The broker searched for a bundle whose range matches the requested bundle name using findHotBundleAsync, got a null result, and translated that into an HTTP 404. It means no bundle with the given range is currently owned/configured for this namespace.","triggerScenarios":"Calling an admin endpoint that takes a bundle range (e.g. DELETE /namespaces/{ns}/{bundle} or unload/split endpoints) with a bundle range string like '0x00000000_0x08000000' that does not exist in the namespace's bundle data; the namespace's bundles were re-split or recreated so the old range is gone; or a typo/format mismatch in the bundle range parameter.","commonSituations":"Scripts that cached bundle ranges from a previous configuration and the namespace was later unbundled or re-split; clients of a different cluster where bundle assignment differs; passing a topic's bundle range from one namespace to another; using default bundle count (no splits) when the script assumes split bundles.","solutions":["List the namespace's current bundles (GET /namespaces/{ns}/bundles or namespaces properties) and use one of the returned bundleRange values","Re-check the bundle range string format: it must be like '0x00000000_0x08000000' matching the namespace boundaries","If bundles were changed recently, re-fetch boundaries instead of caching them","Ensure you are querying the same cluster/registry where the bundle exists"],"exampleFix":"// before\nString range = \"0x00000000_0x40000000\"; // stale cached range\nadmin.namespaces().deleteBundle(\"my-tenant/my-ns\", range);\n// after\nList<String> bundles = admin.namespaces().getBundles(\"my-tenant/my-ns\").getBoundaries();\nString range = bundles.get(0) + \"_\" + bundles.get(1); // derive from live data\nadmin.namespaces().deleteBundle(\"my-tenant/my-ns\", range);","handlingStrategy":"validation","validationCode":"String[] parts = bundleRange.split(\"_\");\nif (parts.length != 2 || !parts[0].startsWith(\"0x\") || !parts[1].startsWith(\"0x\")) {\n    throw new IllegalArgumentException(\"Invalid bundle range format: \" + bundleRange);\n}\nboolean exists = admin.namespaces().getBundles(ns).getBoundaries().contains(parts[0]);\nif (!exists) throw new IllegalArgumentException(\"Bundle not present in namespace: \" + bundleRange);","typeGuard":null,"tryCatchPattern":"try {\n    admin.namespaces().deleteBundle(ns, bundleRange);\n} catch (PulsarAdminException.NotFoundException e) {\n    log.warn(\"Bundle {} not found in {}, refreshing bundle list\", bundleRange, ns);\n    admin.namespaces().getBundles(ns); // re-sync and retry with a valid range\n}","preventionTips":["Always fetch current bundle boundaries before operating on a bundle","Never cache bundle ranges across configuration changes","Use the numBundles API instead of hand-built ranges when possible"],"tags":["http-404","admin-api","namespaces","bundle"],"backgroundTag":"bundle-range-not-found","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}