Spaces:
Paused
Paused
Commit History
-
fix: bake LLM/embedder config into Dockerfile ENV β no DB neededβ
Config sebelumnya hanya tersimpan di DB (Settings.config_overrides) sehingga hilang kalau Postgres belum siap saat initialize_state() dipanggil. Solusi: baca config dari env var (MEM0_LLM_*, MEM0_EMBEDDER_*) yang di-set langsung di Dockerfile. DEFAULT_CONFIG sudah benar dari image build time tanpa perlu DB. DB override tetap bekerja untuk perubahan dinamis via /api/configure.0b25cc0 -
fix: retry DB load on startup β wait up to 60s for Postgres crash recoveryβ
HF FUSE needs ~90s for Postgres crash recovery. initialize_state() was called at module import time and _load_overrides() silently returned {} if DB wasn't ready yet, dropping all saved config overrides. Now retries every 5s up to 12x (60s), stopping early once DB confirms reachable but no overrides stored.d9cf3d7 -
fix: keepalive loop β re-assert FUSE dirs every 5s during postgres runtimeβ
FUSE drops empty dirs not only at startup but also during runtime (seen at 00:56:12+10min: checkpoint ERROR pg_logical/snapshots). One-shot repair at start is not enough. Add background loop that checks and recreates missing dirs every 5s while postgres is running. Trap EXIT to clean up loop PID.e8f054f
-
fix: chown dirs created by root wrapper so postgres (mem0) can read themβ
pg_subtrans/0000 existed but was owned by root β wrapper runs as root, creates dir, then gosu mem0 postgres tries to open it -> Permission denied. Fix: chown all recreated dirs to mem0:mem0 before exec gosu.bf79b7b -
fix: pg_subtrans/pg_snapshots FUSE drop + mem0-api HOME=/root permission errorβ
- postgres-fuse-wrap: add pg_subtrans, pg_xact, pg_multixact/members/offsets to mkdir-only list (contents written by Postgres, must not be deleted). Add pg_snapshots + pg_logical/snapshots/mappings to fully-empty list. Remove .gitkeep from pg_logical dirs β Postgres rejects non-pg files there. - supervisord: add HOME=/opt/data to mem0-api environment so mem0 library does not try os.makedirs('/root/.mem0') and fail with PermissionError.8aef3cf -
fix: postgres wrapper β re-run FUSE dir repair on every postgres startβ
- Add postgres-fuse-wrap script: recreates FUSE-volatile dirs (pg_replslot, pg_twophase, pg_dynshmem, pg_notify, pg_tblspc) immediately before each postgres invocation. Fixes FATAL that occurred ~80s into crash-recovery when FUSE dropped empty dirs between entrypoint Stage-1 and Postgres reading them. - supervisord: postgresql program uses postgres-fuse-wrap, user=root (drops to mem0 via gosu inside wrapper). Global user changed rootβroot so per-program user= directives take effect. - entrypoint: remove redundant FUSE repair from Stage 1; add repair before Stage-2 pg_ctl start (fresh-init path). Drop 'gosu mem0 supervisord' since supervisord now runs as root intentionally. - Dockerfile: COPY + chmod postgres-fuse-wrap.f8a7f2f -
feat: affine-style persistence β PGDATA directly on /data, drop sync/backup loopβ
- No restore-rsync, no pg_basebackup loop (both hammered FUSE until it died) - Per-boot FUSE repair: purge .git/ from object-store dirs, recreate empty runtime dirs, pg_tblspc symlink to tmpfs - First-boot DB setup gated behind FRESH_INIT flag36f3df7 -
fix: restore path β chown mem0 + chmod 700 pgdata after rsync (postgres requires 0700)
8ce5c60 -
feat: periodic backup loop β pg_basebackup + history rsync to /data
0497dac -
fix: set API_INTERNAL_URL for dashboard refresh route β was empty on HF, causing 500 + login redirect loop
1c738cb -
fix: drop per-program tail wrapper β global tail already streams logsβ
mem0-api output appeared twice in HF logs (inner tail + entrypoint's global tail -F). Plain uvicorn command is enough.d9f6df7 -
fix: supervisord EACCES β revert to file logs + global tail to stdoutβ
/dev/fd/1 as stdout_logfile made supervisord fail with 'unknown error making dispatchers ... EACCES' for every program on HF (it tries to reopen the fd; inherited stdout cannot be reopened there). - Restore per-program file logs (proven working) - entrypoint: tail -F all supervisor logs to real stdout so tracebacks are visible in HF logs - Drop useless 30s pg_isready wait (PG is intentionally stopped before supervisord starts; supervisord launches it again)1e6332d -
fix: dashboard exec-bit regression + PG/API race + visible logsβ
- Revert wip 'COPY ./ /app': it overwrote /app after chmod, stripping the exec bit from /app/entrypoint.sh (dashboard FATAL) and would have baked .env/llm-config.json into the public image - Add .dockerignore (secrets never enter build context) - supervisord: log all programs to stdout so tracebacks show in HF logs; drop invalid depends_on options - entrypoint: wait for pg_isready before supervisord (uvicorn raced PG)6d2d3c8 -
wip
aa67c5a -
fix: fresh-deploy crash β placeholder API key + alembic on bootβ
- main.py: OPENAI_API_KEY falls back to placeholder so Memory.from_config doesn't raise OpenAIError at import when no key is configured yet (root cause of mem0-api FATAL loop on fresh HF Space) - entrypoint.sh: run alembic upgrade head after init-db.sh while PG is up, so mem0_app tables exist before uvicorn starts407d645 -
refactor: README.md
3c59c25 -
mem0 self-hosted: full deployment (auth fix, nginx routing, 9router LLM config)
5ec8557
-
initial commit
Verified signaturead75abf