-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Provide a brief overview of what the new feature is all about
Provide a descriptive error message in the http://<server-IP|FQDN>:5984/_cluster_setup API when a hostname is rejected by the Erlang VM (e.g., "Hostname is illegal").
Tell us how the new feature should work. Be specific
When a user attempts to add a node to a cluster via the http://<server-IP|FQDN>:5984/_cluster_setup API, the system should validate if the hostname is acceptable by Erlang's distribution rules (especially in long-name mode).
If the hostname is invalid (for example, using couchdb2 instead of couchdb2.local when the node is configured with a fully qualified domain name), the API should return a 400 Bad Request with a clear error reason like:
{
"error": "bad_request",
"reason": "Hostname couchdb2 is illegal. Nodes in long-name mode require a Fully Qualified Hostname (FQDN) containing at least one dot."
}
Not required. Suggest how to implement the addition or change
No response
Additional Context
This request stems from a difficult troubleshooting experience while testing a 3-node CouchDB cluster using Docker Compose.
The setup appeared to be "finished" but the nodes were not communicating. It took several hours of debugging to realize that because the nodes were using NODENAME in long-name mode, Erlang rejected the Docker service name couchdb2 due to the lack of a dot (.).
If the API had surfaced the "Illegal Hostname" error directly, the issue would have been resolved in minutes instead of hours. Providing better feedback at the API level aligns with making CouchDB more operator-friendly in containerized environments.