Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG] Upgrade from 2.x: compose pins postgres:15, but existing .nostr/data may be PG 16/17/18 (old unpinned postgres image)

未关闭
#928 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker-compose, postgresql, typescript
领域
databases, devops

调研方向

Read the release notes or upgrade documentation and the compose configuration for nostream-db; the report identifies .nostr/data/PG_VERSION as the way to check the existing cluster version. Start by confirming which PostgreSQL image major and Debian variant the upgrade instructions should use. Done means the upgrade guidance explains how operators can match the image to their existing data directory.

由索引模型根据 Issue 内容生成。

描述

Describe the bug
#393 (for #387) pinned nostream-db to postgres:15. Before that the compose file used the unpinned postgres image, so existing installs created .nostr/data with whatever major version was latest at the time — 16, 17 or 18. After upgrading such an install to 3.x, postgres:15 cannot open the data directory and the relay never starts. The bind mount ${PWD}/.nostr/data is still used, so the old data is picked up — just by the wrong major version.

To Reproduce

  1. Run nostream 2.x with the old compose (image: postgres) — e.g. our .nostr/data has PG_VERSION = 17 (image was 17.5).
  2. git checkout v3.4.1 && docker compose up -d.
  3. nostream-db cannot start, because PostgreSQL refuses a data directory initialized by a newer major ("database files are incompatible with server"), and nostream-migrate/nostream wait on its healthcheck. (We caught this before starting: .nostr/data/PG_VERSION said 17 while the compose file says 15, so we did not run 15 against the data.)

Expected behavior
Upgrading from 2.x either keeps working or stops with a clear message telling the operator which image to use.

System

  • OS: Ubuntu 22.04
  • Platform: docker compose v5.4
  • Version: 2.1.0 → 3.4.1, data dir PG 17

Workaround we use
docker-compose.override.yml next to the upstream file:

services:
  nostream-db:
    image: postgres:17.10-bookworm

Note the -bookworm suffix: the old postgres image was Debian 12 based, current postgres:17 is Debian 13 with a newer glibc. Our database uses the libc collation en_US.utf8, and switching glibc versions under an existing cluster can silently invalidate text indexes — so the variant should match the one that created the data.

Suggestion

  • an upgrade note in the release notes / docs: check cat .nostr/data/PG_VERSION and override the image to that major (same Debian variant) before docker compose up;
  • optionally, the CLI start command could read PG_VERSION and refuse to start with a clear message when it does not match the configured image major.
主要语言
TypeScript
星标
829
派生
234
平均合并
16 小时 13 分钟
30 天内合并 PR
74

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cameri/nostream 的其他 Issue

查看 cameri/nostream 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。