{"record":{"id":"5325bc7b8957d876","repo":"apache/pulsar","slug":"loadmanagerclass-does-not-support-this-operatio","errorCode":null,"errorMessage":"${loadManagerClass} does not support this operation","messagePattern":"(.+?) does not support this operation","errorType":"http","errorClass":"RestException","httpStatus":409,"severity":"warning","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokerStatsBase.java","lineNumber":184,"sourceCode":"        validateSuperUserAccess();\n        try {\n            return (pulsar().getLoadManager().get()).generateLoadReport();\n        } catch (Exception e) {\n            log.error()\n                    .exception(e)\n                    .log(\"Failed to generate LoadReport for broker\");\n            throw new RestException(e);\n        }\n    }\n\n    protected Map<Long, Collection<ResourceUnit>> internalBrokerResourceAvailability(NamespaceName namespace) {\n        try {\n            validateSuperUserAccess();\n            LoadManager lm = pulsar().getLoadManager().get();\n            if (lm instanceof SimpleLoadManagerImpl) {\n                return ((SimpleLoadManagerImpl) lm).getResourceAvailabilityFor(namespace).asMap();\n            } else {\n                throw new RestException(Status.CONFLICT, lm.getClass().getName() + \" does not support this operation\");\n            }\n        } catch (Exception e) {\n            log.error().exception(e).log(\"Unable to get Resource Availability\");\n            throw new RestException(e);\n        }\n    }\n}\n","sourceCodeStart":166,"sourceCodeEnd":192,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokerStatsBase.java#L166-L192","documentation":"This HTTP 409 CONFLICT error is thrown by the broker-stats admin endpoint when the currently active LoadManager is not SimpleLoadManagerImpl. Only the legacy simple load manager exposes getResourceAvailabilityFor(namespace); other implementations (notably ModularLoadManagerImpl) do not implement this operation, so the admin API refuses rather than return meaningless data.","triggerScenarios":"Calling GET /admin/v2/broker-stats/available-resource-availability (internalBrokerResourceAvailability) as a superuser while the broker's loadManagerClassName is set to anything other than org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl, e.g. the default ModularLoadManagerImpl.","commonSituations":"Running a default/modern Pulsar configuration (ModularLoadManagerImpl is the default) and querying the legacy resource-availability endpoint; scripts or monitoring dashboards written against old Pulsar versions where SimpleLoadManagerImpl was the default; mixed-version clusters where a tool assumes the old load manager.","solutions":["Check the active load manager class (broker.conf loadManagerClassName, or GET /admin/v2/brokers/configuration) and switch to org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl if this endpoint is genuinely needed (requires broker restart and is not recommended).","Prefer the modern equivalent metrics instead of the endpoint: use GET /admin/v2/broker-stats/metrics or the load data endpoint /admin/v2/broker-stats/load-report, which work with ModularLoadManagerImpl.","Catch HTTP 409 on the client side and fall back to the supported load-data/metrics API for brokers running a non-simple load manager."],"exampleFix":"// before (client assumes old endpoint works)\nResourceAvailability ra = admin.brokerStats().getResourceAvailability(ns);\n// after\ntry {\n    ra = admin.brokerStats().getResourceAvailability(ns);\n} catch (PulsarAdminException.ConflictException e) {\n    // fall back to load report / metrics supported by ModularLoadManagerImpl\n    LoadReport lr = admin.brokerStats().getLoadReport();\n}","handlingStrategy":"fallback","validationCode":"// check active load manager before calling\nString lmClass = admin.brokers().getDynamicConfiguration(\"loadManagerClassName\");\nif (lmClass != null && !lmClass.contains(\"SimpleLoadManagerImpl\")) {\n    // use load-report/metrics endpoints instead\n}","typeGuard":null,"tryCatchPattern":"try {\n    return admin.brokerStats().getResourceAvailability(ns);\n} catch (PulsarAdminException.ConflictException e) {\n    return fallbackToLoadReport(admin);\n}","preventionTips":["Do not use the resource-availability endpoint with ModularLoadManagerImpl-based deployments.","Gate monitoring scripts on the broker's loadManagerClassName configuration.","Prefer broker-stats metrics/load-report endpoints, which are implementation-agnostic."],"tags":["pulsar","load-manager","admin-api","http-409"],"backgroundTag":"unsupported-operation-for-load-manager","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"}