From 579c1b6b264f5fc63f9479ac10cb4b6597c90ceb Mon Sep 17 00:00:00 2001 From: fudian Date: Mon, 10 Aug 2026 02:08:41 +0800 Subject: [PATCH] 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 ''`, 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 --- install/apache-couchdb-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/apache-couchdb-install.sh b/install/apache-couchdb-install.sh index df11bc724..8ba55a802 100644 --- a/install/apache-couchdb-install.sh +++ b/install/apache-couchdb-install.sh @@ -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"