You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "weeix (via GitHub)" <gi...@apache.org> on 2025/12/30 09:37:41 UTC

[I] [ENHANCEMENT]: Surface "Illegal Hostname" error in _cluster_setup API response [couchdb]

weeix opened a new issue, #5835:
URL: https://github.com/apache/couchdb/issues/5835

   ### 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:
   
   ```json
   {
     "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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [ENHANCEMENT]: Surface "Illegal Hostname" error in _cluster_setup API response [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on issue #5835:
URL: https://github.com/apache/couchdb/issues/5835#issuecomment-3712205366

   Thank you for reaching out.
   
   That's a good idea to add add a format check and issue a more user friendly error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org