Fix: CouchDB Erlang cookie breaks vm.args (use hex) (#16361)

* CouchDB: generate an Erlang-safe (hex) cookie

ERLANG_COOKIE was generated with `openssl rand -base64 32`, whose output
contains +, / and = (e.g. "+w2dDazB/CrIZMsZu8edX4hn55QeRXOCi+hom25Lmm8=").
CouchDB writes the cookie into /opt/couchdb/etc/vm.args as
`-setcookie '<cookie>'`, and those characters break Erlang's vm.args
parsing, so couchdb.service fails to start on a fresh install (#16360).

Use `openssl rand -hex 32` instead: a 64-char hex string is alphanumeric,
needs no quoting, and is always a valid Erlang cookie. (Same 256-bit
entropy as the base64 of 32 bytes.)

Closes #16360

* Update install/apache-couchdb-install.sh

---------

Co-authored-by: Sam Heinz <sam@samheinz.com>
This commit is contained in:
fudian
2026-08-10 02:08:41 +08:00
committed by GitHub
parent 5264fc5897
commit 579c1b6b26
+1 -1
View File
@@ -14,7 +14,7 @@ network_check
update_os
msg_info "Installing Apache CouchDB"
ERLANG_COOKIE=$(openssl rand -base64 32)
ERLANG_COOKIE=$(openssl rand -hex 32)
ADMIN_PASS="$(openssl rand -base64 18 | cut -c1-13)"
debconf-set-selections <<<"couchdb couchdb/cookie string $ERLANG_COOKIE"
debconf-set-selections <<<"couchdb couchdb/mode select standalone"