Skip to content

feat(omnibus): add the migration from the multi-container Compose stack - #3179

Merged
Quick104 merged 9 commits into
mainfrom
silo/omnibus-migrator
Oct 28, 2026
Merged

Quick104 merged 9 commits into
mainfrom
silo/omnibus-migrator

Conversation

@Quick104

@Quick104 Quick104 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

Every existing Docker install runs the multi-container Compose stack: PostgreSQL in pgvector/pgvector:pg18, Redis, optional Meilisearch, and a root-run Silo, with data in SILO_DATA_ROOT/{postgres,redis,meilisearch,plugins,artwork,compat}. Moving one to the omnibus image means copying its database into /config/postgres, renaming its superuser and database, linking Silo's files into /config/silo, and not losing anything if it goes wrong. Done by hand, that is a long list of steps most users should not have to follow.

This PR adds the migration as a script in the image, used by nothing yet. The next PR switches docker-compose.yml to run it. Shipping the script first means the default Compose file can switch only once a published aio carries it.

Fourth in the stack: #3118, the artwork identity fix, node support, this, the default Compose switch.

Approach

/etc/silo-omnibus/migrate-compose-stack runs with SILO_DATA_ROOT mounted at /silo-data:

  • The cluster is copied to config/postgres/data. A temporary server on a private socket creates the silo superuser if POSTGRES_USER named another, renames POSTGRES_DB to silo, resets a search provider the admin UI pointed at the old Meilisearch service unless the bundled one is on, and refuses a server with enabled nodes unless node access is on. Silo's directories are hard-linked into config/silo, also when DATABASE_URL points at an external database.
  • The old directories keep their data, so the earlier Compose file still starts on them.
  • Everything is staged and moved into place at the end under a pending record; a run that finds the record without a completion marker sets aside what was moved and starts over, and one that finds both only removes the record. The file system is synced before the moves, before the completion marker, and after it, and the marker is written to a temporary file and renamed. It records the source's system identifier and checkpoint in root-owned /config, and any later use of the old cluster refuses the copy.
  • Every successful run also leaves /config/.compose-migration-checked. With REQUIRE_COMPOSE_MIGRATION set, which the next PR's Compose file sets, init-postgres creates no cluster until that marker exists, so docker compose up -d --no-deps silo on the first update stops with an explanation instead of starting an empty server. A cluster created before the migration ran beside an earlier install is refused rather than silently kept. While the pending record exists, init-postgres refuses to start at all, so Silo never writes to a half-moved cluster the next run would set aside. Cluster fingerprints are read with pg_controldata in the C locale, and an unreadable cluster stops the script instead of comparing as empty.
  • Before anything moves it refuses, with what to do: a pinned SILO_IMAGE without SILO_OMNIBUS_IMAGE; DATABASE_URL or REDIS_URL naming the old services; an .env from the old stack with none of its data at the default paths (named volumes, edited paths); a running or uncleanly stopped cluster, another major version, external WAL or tablespaces, a linked PG_VERSION; too little space for the copy and for rebuilding its largest text index; a Silo directory that is a symlink or not a directory; a directory on another file system that won't fit beside that room; SILO_SEARCH_PROVIDER=meilisearch without a URL while the bundled Meilisearch is off.
  • Files in the copy are replaced as postgres, never written through, since a cluster from another container can hold links.

init-adduser also warns when PUID cannot read the media root, since the old image ran Silo as root.

Validation

On amd64, with images built from this stack and the current Compose stack as the starting point, one install walked through every rule: pinned image, localhost DATABASE_URL, and an enabled node each refused before anything moved (the node refusal discarded its partial copy); back on the old stack and changed; then migrated, with the newer database and artwork, the stale directory from the failed attempt set aside, search reset to PostgreSQL, the artwork identity row unchanged, and Silo healthy; a second run silent; old stack used again, then refused. Separately: an interrupted promotion was set aside and redone, an external-database install moved only Silo's directories, an empty config with an old-stack .env was refused, and a new install with node access was accepted. make verify-shellcheck: pass.

After review, on arm64 against a cleanly stopped pgvector/pgvector:pg18 cluster: both markers present after a finished migration kept the data and the next run was silent; a symlinked artwork directory, an artwork file, and a padded SILO_SEARCH_PROVIDER=" MeiliSearch " were refused; artwork on a separate volume was copied, and refused when it would not fit. End to end through the next PR's Compose file, from an install of the current Compose stack with an admin account: up -d --no-deps silo was refused and created no cluster, then up -d migrated and the admin signed in; an omnibus cluster created before the migration was refused, then migrated after it was moved aside; a new install started, and a later --no-deps recreate started too. The fingerprint read was also checked against stubbed pg_controldata output: readable, permission denied, and missing fields. Not tested: a real power loss.

Evidence

No user-visible change. Test runs and results:

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3179/

Risks

  • The copy needs free space equal to the cluster plus room for the index rebuild; the script refuses rather than fill the disk, and a move option is left out because it would remove the rollback.
  • Not tested: Docker Desktop, rootless Docker or Podman, NFS with root squash, SELinux relabeling.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; OpenAI Codex CLI for adversarial review
  • Model(s): claude-opus-5-5; gpt-6-astra (review)
  • Involvement: AI-assisted
  • Adversarial review: two gpt-6-astra passes, read-only. The first found root writes through links in the copy, mixed generations after a failed retry, named-volume installs silently starting empty, stale connection URLs and nodes, admin-chosen Meilisearch, clock-based rollback detection, ignored image pins, and too little space for the index rebuild. The re-check found an interrupted promotion bypassing rollback detection, an empty config defeating the empty-install refusal, a linked PG_VERSION, index-size headroom, false refusals on installs with nothing to migrate, and external-database installs skipping Silo's directories. All are fixed above.

Note

Add migration path from multi-container Compose stack to the omnibus image

  • Adds migrate-compose-stack, which detects an earlier Compose installation, stages and copies the PostgreSQL cluster and Silo data directories, and commits them into the omnibus layout using pending and completion markers to recover from interrupted moves. It rejects running or incompatible clusters and external WAL or tablespace locations.
  • Extends init-config so non-integrated modes require external DATABASE_URL and REDIS_URL. ENABLE_NODE_ACCESS now requires POSTGRES_PASSWORD, and with bundled Redis requires a URL-safe REDIS_PASSWORD used for SCRAM authentication; svc-redis and init-postgres then bind to all interfaces.
  • Adds a node-access Compose overlay that publishes PostgreSQL and Redis on a configurable host, plus a standalone node Compose service using the omnibus image in transcode mode.
  • Warns at startup when the silo account cannot read the media root (init-adduser) and updates the omnibus image documentation.
  • Risk: init-postgres now exits with an error when .compose-migration-pending exists, and refuses to create an empty cluster when REQUIRE_COMPOSE_MIGRATION is set without the checked marker — run Compose without --no-deps on first start. Without the postgres.network marker, the silo role password is cleared and network listeners are removed.

Macroscope summarized 02230be.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request adds a script to migrate data from an earlier multi-container Compose installation into the omnibus layout. It adds PostgreSQL startup guards for migration state and a warning when silo cannot read paths under the configured media root.

Changes: Omnibus transition

Layer / File(s) Summary
Migration discovery and eligibility
omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack
The script detects earlier data and checks configuration and PostgreSQL cluster eligibility. It handles abandoned staging and interrupted migration state.
Database and Silo data staging
omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack
The script stages a PostgreSQL cluster and Silo directories. It prepares the database role, database name, provider setting, and authentication, and checks source state and available space.
Data promotion and startup checks
omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack, omnibus/rootfs/etc/s6-overlay/scripts/init-postgres, omnibus/rootfs/etc/s6-overlay/scripts/init-adduser
The script promotes staged data with migration markers and reports remaining or set-aside data. PostgreSQL startup stops when migration is pending or a required migration check is absent. The add-user script warns if silo cannot read paths at the media root or one level below it.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant MigrationScript as migrate-compose-stack
  participant SourceCluster as Source PostgreSQL cluster
  participant StagedCluster as Staged PostgreSQL cluster
  participant DataRoot as Omnibus data root
  MigrationScript->>SourceCluster: Check cluster state and fingerprint
  MigrationScript->>StagedCluster: Copy and prepare eligible cluster
  MigrationScript->>DataRoot: Stage Silo directories and write pending marker
  MigrationScript->>DataRoot: Promote staged data and record completion
Loading

Possibly related PRs

Merge Risk: Moderate · previous review 80b75

Migrating an earlier Compose install whose Silo data lives in the postgres database can fail if the OS collation library version differs from the one recorded in the old cluster. The migration stops, and the original data is not changed. Create the empty maintenance database from template0 before merging.

Architecture risk: Low · up to 80b75

The change affects 1 system.

Changed systems: omnibus

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — omnibus (service) was modified; 3 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in omnibus/rootfs/etc/s6-overlay/scripts/init-adduser: Adds a media-access check after account setup. If the configured media root exists as a directory, find runs as silo and checks the root and its immediate children for unreadable paths or directories that are not executable. A find failure identifies the media root as unreadable; any identified path triggers a warning naming the UID and advising that PUID and PGID be set to an account that can read the media.
  • observed — Modified behavior in omnibus/rootfs/etc/s6-overlay/scripts/init-postgres: Before the existing PostgreSQL checks, the script now detects /config/.compose-migration-pending; when present, it prints an interruption message instructing users to run docker compose up -d without --no-deps and exits with status 1.
  • observed — Modified behavior in omnibus/rootfs/etc/s6-overlay/scripts/init-postgres: In the no-existing-data-directory branch, the script now checks whether REQUIRE_COMPOSE_MIGRATION is truthy and /config/.compose-migration-checked is absent. When both conditions hold, it explains that the Compose PostgreSQL service must check for and move an earlier install, then exits with status 1.
  • observed — Modified behavior in omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack: Adds the Bash migration script’s setup, marker paths, error and checked-marker helpers, host-path and URL-host parsing, PostgreSQL fingerprinting, and set-aside handling. It rejects a missing data mount and a pinned SILO_IMAGE without a matching SILO_OMNIBUS_IMAGE.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding migration support from the multi-container Compose stack to the omnibus layout.
Description check Passed The description directly explains the migration script, PostgreSQL and Silo data handling, safety checks, retry markers, validation, and known risks.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T23:59:27.746778Z ed58b54 New commits
🔒 Security Review ✅ Completed 2026-10-29T00:02:16.308588Z ed58b54 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Oct 27, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026

Copy link
Copy Markdown

The migration changes the search provider from Meilisearch to PostgreSQL when bundled Meilisearch is disabled, which can change search results or their order. Please add before-and-after captures of the same search query and screen, identifying the surface and build or commit; the Evidence section currently provides none.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b5b23290a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@silo-triage silo-triage Bot added enhancement New feature or request priority: P2 Limited scope, workaround exists, or polish stacked Base is another open PR; merge in stack order named in the body labels Oct 27, 2026
@Quick104
Quick104 force-pushed the silo/omnibus-migrator branch from 0b5b232 to cffd9ad Compare October 27, 2026 19:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cffd9ad48a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b16027f7-60b7-4ee4-b3c4-9a04a5551b66
Commits

Reviewing files that changed from the base of the PR and between b25ffda and ff2f827.

Files selected for processing: 3
  • omnibus/rootfs/etc/s6-overlay/scripts/init-adduser
  • omnibus/rootfs/etc/s6-overlay/scripts/init-postgres
  • omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9a4cbec-e8ff-45f8-b90a-e7d74d4cf769
Commits

Reviewing files that changed from the base of the PR and between ff2f827 and 804ce85.

Files selected for processing: 3
  • omnibus/rootfs/etc/s6-overlay/scripts/init-adduser
  • omnibus/rootfs/etc/s6-overlay/scripts/init-postgres
  • omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack
Files skipped from review as they are similar to previous changes: 2
  • omnibus/rootfs/etc/s6-overlay/scripts/init-adduser
  • omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9bdc141e5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f5bebe8a-ab02-4f1c-8948-21e41189b292
Commits

Reviewing files that changed from the base of the PR and between 9bdc141 and 80b75a3.

Files selected for processing: 1
  • omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Base automatically changed from silo/omnibus-nodes to main October 28, 2026 23:55
@silo-triage silo-triage Bot added size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. and removed size/L 200–499 added + deleted lines (all files); change volume, not priority. labels Oct 28, 2026
@Quick104
Quick104 force-pushed the silo/omnibus-migrator branch from c9192b9 to 02230be Compare October 28, 2026 23:56
@silo-triage silo-triage Bot added size/XL 500–999 added + deleted lines (all files); change volume, not priority. and removed size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. labels Oct 28, 2026
@silo-kody

silo-kody Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Quick104 and others added 7 commits October 28, 2026 19:56
migrate-compose-stack copies an install of the earlier docker-compose.yml,
which ran PostgreSQL, Redis, and Meilisearch beside a root-run Silo, into the
omnibus layout under SILO_DATA_ROOT/config. It ships in the image ahead of the
Compose file that runs it, so the default file can switch only once a
published image carries it.

The PostgreSQL cluster is copied and Silo's plugins, artwork, and compat
directories are hard-linked, all under staging names moved into place at the
end, with the source cluster's identifier and checkpoint recorded last. The
old directories are never changed, so the earlier Compose file still starts
on them. A temporary server on a private socket creates the silo superuser,
renames POSTGRES_DB to silo, resets search to PostgreSQL when it pointed at the
old Meilisearch service and the bundled one stays off, and refuses a server
with enabled nodes unless node access is on. Files in the copy are replaced as
postgres, never written through.

Before changing anything it refuses a running or uncleanly stopped cluster,
another major version, WAL or tablespaces outside the data directory, too
little space for the copy and its index rebuild, an earlier install's files
without a cluster, an .env from the earlier stack with none of its data at
the default paths, DATABASE_URL or REDIS_URL naming the old services, a pinned
SILO_IMAGE without SILO_OMNIBUS_IMAGE, and an old cluster used again since its
copy. init-adduser warns when PUID cannot read the media root, since the old
image ran Silo as root.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vice

An .env following the earlier .env.example can set SILO_SEARCH_PROVIDER and
SILO_MEILISEARCH_URL=http://meilisearch:7700. Silo applies those on every
start, over the stored provider the migration resets, and the image keeps an
explicit URL even with its own Meilisearch on, so search would target the
removed container. The migration now refuses such a URL and says which
settings to remove.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A kill between writing the done marker and removing the pending record
left both behind, and the next run set the promoted cluster and Silo
directories aside before exiting on the done marker, so Silo started on
an empty database. With the done marker present, recovery now only
removes the pending record. The done marker is written to a temporary
file and renamed into place.

cp does not flush and PostgreSQL does not sync a cleanly stopped cluster
it starts on, so the migration syncs the file system after staging and
writing the pending record, after the moves, and after the done marker.

Also refuse a Silo directory in SILO_DATA_ROOT that is a symbolic link
or not a directory, which was skipped silently; check free space before
copying a directory that cannot be hard-linked, keeping the room the
database's first start needs; refuse SILO_SEARCH_PROVIDER=meilisearch
without a URL when the bundled Meilisearch is off; set aside a data
directory an unfinished initdb left; and list set-aside copies at the
end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Updating with `docker compose up -d --no-deps silo` skips the postgres
service that moves the multi-container stack's data. init-postgres then
created an empty cluster, Silo came up with no data, and the next full
`docker compose up -d` saw an omnibus database and exited without moving
the earlier install, leaving it orphaned.

migrate-compose-stack now refuses when an omnibus cluster exists, no
migration finished, and the earlier stack's cluster or Silo directories
are present, and says how to recover either way. It also leaves a
root-owned /config/.compose-migration-checked on every successful path.
With REQUIRE_COMPOSE_MIGRATION set, init-postgres refuses to create a
cluster until that marker exists and tells the operator to run
`docker compose up -d` once without --no-deps. Without the variable,
nothing changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
init-postgres now refuses to start while migrate-compose-stack's pending
record is present: a cluster found then may be half of an interrupted move
that the next run sets aside, which would leave Silo's writes behind.

control_fingerprint runs pg_controldata in the C locale and fails with its
error instead of printing nothing, so an unreadable cluster never compares
equal or reports a misleading concurrent-use error. init-adduser warns
when find cannot reach the media root at all.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
init-postgres exits early when the bundled PostgreSQL is off, but the
migration also moves Silo's directories when DATABASE_URL names another
database. Check the pending record before that exit so Silo never writes
to directories the next run would set aside.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 and others added 2 commits October 28, 2026 19:56
…silo

An earlier stack run with POSTGRES_DB=postgres kept Silo's data in the
postgres database, and renaming it to silo left the cluster without one.
init-postgres-db connects there, so the first start failed. Create the
empty postgres database initdb makes after the rename.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A copied cluster's template1 records the earlier glibc collation version
until init-postgres-db refreshes it, and PostgreSQL refuses to copy a
template with a mismatched version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104
Quick104 force-pushed the silo/omnibus-migrator branch from 02230be to ed58b54 Compare October 28, 2026 23:57
@silo-triage silo-triage Bot added size/L 200–499 added + deleted lines (all files); change volume, not priority. and removed size/XL 500–999 added + deleted lines (all files); change volume, not priority. labels Oct 28, 2026
@Quick104
Quick104 merged commit 96b340e into main Oct 28, 2026
22 checks passed
@Quick104
Quick104 deleted the silo/omnibus-migrator branch October 28, 2026 23:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed58b547ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +357 to +360
if [[ "${provider,,}" == meilisearch && "$(url_host "$meili_url")" == meilisearch ]] && ! truthy "${ENABLE_MEILISEARCH:-false}"; then
stage_psql -d silo -c "UPDATE server_settings SET value = 'postgres' WHERE key = 'catalog.search.provider'"
log "search used the earlier stack's Meilisearch and now uses PostgreSQL. Set ENABLE_MEILISEARCH=true in .env to use the bundled Meilisearch; Silo builds a new index"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require Redis when retaining an external Meilisearch provider

For an installation that selected an external Meilisearch server through the admin UI, with no search environment overrides, this condition preserves the Meilisearch provider but migration silently drops its Redis dependency. The earlier docker-compose.yml always supplied Redis, whereas init-config enables it only through environment settings such as ENABLE_REDIS, ENABLE_MEILISEARCH, or SILO_SEARCH_PROVIDER; it does not inspect the stored provider. With those settings unset, the migrated installation therefore cannot serve cursor-paged search: searchSessionStore.put in internal/catalog/search_session.go returns ErrSearchContinuationUnavailable without a Redis client. When retaining this provider, refuse migration with instructions to set ENABLE_REDIS=true or provide an external REDIS_URL, rather than reporting success with broken search.

Useful? React with 👍 / 👎.

Comment on lines +4 to +5
# under SILO_DATA_ROOT/config. docker-compose.yml runs this as its postgres
# service before Silo starts, with SILO_DATA_ROOT mounted at /silo-data.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug high

Unintended database initialization occurs when switching an existing installation to docker-compose.omnibus.yml because neither shipped Compose deployment invokes the migration entry point: docker-compose.yml still starts pgvector and the regular Silo image, while docker-compose.omnibus.yml starts only Silo with /config mounted, creating a new database beside the old data instead of migrating it. Wire this script into a prerequisite service with SILO_DATA_ROOT mounted at /silo-data, and gate Silo startup on its successful completion.

Prompt for LLM

File omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack:

Line 4 to 5:

Unintended database initialization occurs when switching an existing installation to docker-compose.omnibus.yml because neither shipped Compose deployment invokes the migration entry point: docker-compose.yml still starts pgvector and the regular Silo image, while docker-compose.omnibus.yml starts only Silo with /config mounted, creating a new database beside the old data instead of migrating it. Wire this script into a prerequisite service with SILO_DATA_ROOT mounted at /silo-data, and gate Silo startup on its successful completion.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Comment on lines +276 to +277
s6-setuidgid postgres pg_ctl -D "$pg_stage" -s -w -t 600 -l "$pglog" \
-o "-c listen_addresses='' -c unix_socket_directories='$sock' -c shared_buffers=128MB -c archive_mode=off" start

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Security high

Credential exposure occurs because pg_ctl launches the temporary PostgreSQL server with the migration process's full environment, without the filtering used by svc-postgres, allowing a database superuser executing programs during migration to read SECRET_KEY and unrelated deployment credentials. Launch pg_ctl and its server with an explicitly allowlisted environment.

Prompt for LLM

File omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack:

Line 276 to 277:

Credential exposure occurs because pg_ctl launches the temporary PostgreSQL server with the migration process's full environment, without the filtering used by svc-postgres, allowing a database superuser executing programs during migration to read SECRET_KEY and unrelated deployment credentials. Launch pg_ctl and its server with an explicitly allowlisted environment.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: P2 Limited scope, workaround exists, or polish size/L 200–499 added + deleted lines (all files); change volume, not priority. stacked Base is another open PR; merge in stack order named in the body

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant