KB: Partition Rebalance via Admin API Returns 403 or Empty Reply
Summary
When attempting to trigger a partition rebalance using curl against the Redpanda Admin API (/v1/partitions/rebalance), users may encounter either an empty reply or a 403 Forbidden error. This article explains the causes and the correct approach.
Symptoms
curl -X POST http://localhost:9644/v1/partitions/rebalancereturns:curl: (52) Empty reply from servercurl -kv -X POST https://localhost:9644/v1/partitions/rebalancereturns:HTTP/1.1 403 Forbidden
Root Cause
Empty reply: The Admin API has TLS enabled. Sending an http:// request to a TLS-enabled endpoint results in an empty reply from the server. The correct scheme is https://.
403 Forbidden: The cluster has Basic Authentication enabled on the Admin API (admin_api_require_auth: true, http_authentication: [BASIC]). Requests made without credentials will be rejected with a 403.
Resolution
Use https:// and supply valid admin credentials with the -u flag:
curl -vk -u '<USER>:<PASS>' -X POST https://localhost:9644/v1/partitions/rebalanceA successful request will result in an HTTP 307 Temporary Redirect to the controller leader node, and the rebalance will be triggered. You can confirm success by checking the broker logs for the entry:
requesting on demand rebalance
Then monitor progress with:
rpk cluster partitions balancer-statusAlternative: Using rpk
If direct curl access is complex (e.g., due to TLS/auth configuration), rpk handles authentication automatically via its configuration:
rpk cluster partitions balanceA successful output will show:
Successfully triggered on-demand partition balancing.