Skip to content

fix(zeabur): 修复 Typesense 启动失败 - #223

Merged
ThaddeusJiang merged 5 commits into
mainfrom
fix/zeabur-typesense-startup
Jul 1, 2026
Merged

ThaddeusJiang merged 5 commits into
mainfrom
fix/zeabur-typesense-startup

Conversation

@ThaddeusJiang

@ThaddeusJiang ThaddeusJiang commented Jun 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • 为 release 阶段的 Typesense migration 增加有限重试,避免短暂 econnrefused 直接导致 Vmemo 容器退出。
  • 修复 Docker release build:runner stage 不再手写 pin nginx / nginx-common 的 Debian deb13uX security revision,避免 Debian security 仓库滚动后旧 revision 下架导致 build broken。
  • 为 runner apt 安装加入 --no-install-recommends,减少不必要包和维护面。
  • 更新 Zeabur template:固定 Vmemo RC 镜像、保留 /app/storage volume、暴露 Typesense host/port,并新增 Typelens 服务。
  • 新增 self-hosting operations 文档,覆盖环境变量调整、服务升级、Typesense store corruption 恢复步骤。
  • 记录本次 Zeabur Typesense /data store corruption 的 postmortem。

Why

  • Release (manual) run 28494701045 的 Docker job 在 apt-get install 层失败:Version '1.26.3-3+deb13u6' for 'nginx' was not found。
  • 失败根因是 Dockerfile pin 了 Debian security revision,但 apt-get update 使用当前 trixie/security 仓库索引;旧 revision 下架后,精确版本不可安装。
  • 改为不手写 Debian deb13uX revision 后,镜像仍使用当前 base image 的 Debian suite,并自动获得同一 suite 内的安全维护版本。
  • Zeabur 运行日志显示 Vmemo 在创建 ts_schema_migrations 时遇到 Req.TransportError{reason: :econnrefused} 后退出。
  • 后续 Typesense 日志显示 /data/db/*.ldb store corruption,说明 Vmemo 的连接失败是 Typesense 服务自身无法启动的症状。
  • Zeabur dependency 只能保证启动顺序,不能保证 Typesense HTTP endpoint ready;同时 Typesense volume recovery 需要明确文档,避免误删 PostgreSQL 或 Vmemo storage。

Validation

  1. mise exec -- mix format --check-formatted
  2. DATABASE_URL=postgres://postgres:postgres@localhost/vmemo_test TYPESENSE_URL=http://localhost:8108 mise exec -- mix compile --warnings-as-errors
  3. DATABASE_URL=postgres://postgres:postgres@localhost/vmemo_test TYPESENSE_URL=http://localhost:8108 mise exec -- mix test test/vmemo/release_test.exs
  4. ruby -ryaml -e 'doc = YAML.load_file("docs/guides/self-hosting/zeabur/vmemo.yml"); services = doc.fetch("spec").fetch("services"); raise "Vmemo missing" unless services.any? { |s| s["name"] == "Vmemo" }; raise "typesense missing" unless services.any? { |s| s["name"] == "typesense" }; raise "typelens missing" unless services.any? { |s| s["name"] == "typelens" }; vmemo = services.find { |s| s["name"] == "Vmemo" }; raise "bad storage volume" unless vmemo.fetch("spec").fetch("volumes").any? { |v| v["dir"] == "/app/storage" }; typesense = services.find { |s| s["name"] == "typesense" }; raise "bad typesense volume" unless typesense.fetch("spec").fetch("volumes").any? { |v| v["dir"] == "/data" }; puts services.map { |s| s["name"] }.join(",")'
  5. git diff --check
  6. docker run --rm --platform linux/amd64 elixir:1.19.5-otp-28 sh -lc 'apt-get update -y >/dev/null && apt-get install -y --no-install-recommends libstdc++6 openssl libncurses6 libtinfo6 locales ca-certificates imagemagick nginx >/tmp/apt-install.log && nginx -v'
  7. docker run --rm --platform linux/arm64 elixir:1.19.5-otp-28 sh -lc 'apt-get update -y >/dev/null && apt-get install -y --no-install-recommends libstdc++6 openssl libncurses6 libtinfo6 locales ca-certificates imagemagick nginx >/tmp/apt-install.log && nginx -v'

Related

Background (Screenshots)

  • 用户截图 1:Vmemo 容器在 Typesense migration 创建 ts_schema_migrations 时 econnrefused 并重启。
  • 用户截图 2:Typesense 容器启动时报 /data/db/*.ldb store corruption 并终止。

Notes

  • 2026.7.1-rc.1 release/tag 已经由失败 run 创建,并指向旧 commit ab8b88f。
  • 合并/使用当前修复后,建议发布新的 RC,例如 2026.7.1-rc.2,不要直接重跑旧 run。
  • 这个 PR 不会自动清理线上 Zeabur 的 Typesense volume;如果该部署是测试环境,可在 Zeabur UI 仅删除 Typesense 服务挂载到 /data 的 volume 后重启。
  • 如果已有生产数据,应优先恢复 Typesense /data volume 备份;清空 Typesense 后旧图片/笔记需要重新同步到搜索索引。
  • 合并后需要将 Zeabur template 的 Vmemo 镜像更新到新 RC tag。

@ThaddeusJiang ThaddeusJiang self-assigned this Jun 16, 2026
Comment thread docs/guides/self-hosting/zeabur/vmemo.yml Outdated
@ThaddeusJiang
ThaddeusJiang merged commit d5304c0 into main Jul 1, 2026
3 checks passed
@ThaddeusJiang
ThaddeusJiang deleted the fix/zeabur-typesense-startup branch July 1, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant