From d0ba6dbe285a0bd59c0ef081db62d66d6c90061d Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 7 Jun 2026 09:13:24 +0530 Subject: [PATCH] fix(obsidian-sync): remove mem_limit; add enable_cors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mem_limit: 768m causes the kernel cgroup OOM killer to fire before the Erlang VM writes its first log line on a swap-heavy host — manifests as exit code 1 / empty docker logs / OOMKilled:false (kernel kill, not Docker's own cgroup reporter). Removing the limit lets CouchDB start. Also adds enable_cors = true to [httpd] — required in CouchDB 3.x for the [cors] section to take effect (without it CORS headers are silently dropped). Co-Authored-By: Claude Sonnet 4.6 --- obsidian-sync/couchdb/local.ini | 2 ++ obsidian-sync/docker-compose.yml | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/obsidian-sync/couchdb/local.ini b/obsidian-sync/couchdb/local.ini index 88d3321..1daba8e 100644 --- a/obsidian-sync/couchdb/local.ini +++ b/obsidian-sync/couchdb/local.ini @@ -24,6 +24,8 @@ require_valid_user = true [httpd] WWW-Authenticate = Basic realm="couchdb" +# Required in CouchDB 3.x — without this the [cors] section below is ignored. +enable_cors = true # --- CORS ------------------------------------------------------------------- # LiveSync runs inside browsers with DIFFERENT origins: diff --git a/obsidian-sync/docker-compose.yml b/obsidian-sync/docker-compose.yml index 2521b2e..d49bc59 100644 --- a/obsidian-sync/docker-compose.yml +++ b/obsidian-sync/docker-compose.yml @@ -23,9 +23,9 @@ services: # top of CouchDB's defaults without us editing the base file. - ./couchdb/local.ini:/opt/couchdb/etc/local.d/10-livesync.ini:ro - # Guardrail on a RAM-tight box. CouchDB idles ~150-300MB; cap keeps a runaway - # query from eating your headroom. Swap still absorbs brief spikes. - mem_limit: 768m + # mem_limit intentionally omitted: on a swap-heavy box the cgroup OOM killer + # fires before the Erlang VM writes its first log line (kernel kills it, so + # docker inspect shows OOMKilled:false — misleading). Re-add once swap < 50%. healthcheck: # _up is CouchDB's lightweight liveness endpoint (no auth needed).