Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
rag-of-all-trades-openwebui-api-1 ghcr.io/wikiteq/rag-of-all-trades:latest "sh -c 'alembic upgr…" api 4 minutes ago Up 4 minutes (healthy) 8000/tcp
rag-of-all-trades-openwebui-openwebui-1 ghcr.io/open-webui/open-webui:0.6.5 "/custom-entrypoint.…" openwebui 4 minutes ago Up 4 minutes (healthy) 0.0.0.0:3000->8080/tcp, [::]:3000->8080/tcp
rag-of-all-trades-openwebui-postgres-1 ankane/pgvector:v0.5.1 "docker-entrypoint.s…" postgres 4 minutes ago Up 4 minutes (healthy) 5432/tcp
rag-of-all-trades-openwebui-postgres-1 pgvector/pgvector:0.8.2-pg18-trixie "docker-entrypoint.s…" postgres 4 minutes ago Up 4 minutes (healthy) 5432/tcp
rag-of-all-trades-openwebui-redis-1 redis:7 "docker-entrypoint.s…" redis 4 minutes ago Up 4 minutes (healthy) 6379/tcp
```

Expand Down Expand Up @@ -402,6 +402,42 @@ vector_store:
The `openwebui` service depends on the `api` service healthiness and will remain pending until the API service
is online. Check the `api` container for any errors, review the `config.yaml` and `.env.rag` for typos.

## Upgrading

### Migrating from `ankane/pgvector` to `pgvector/pgvector` (PostgreSQL 18)

The `ankane/pgvector` image is deprecated. The replacement is `pgvector/pgvector`, which also changes
the PostgreSQL major version (15 → 18). Because PostgreSQL data directories are version-specific,
an in-place upgrade is not possible — you must dump and restore.

> **Note:** PostgreSQL 18+ changed the expected volume mount point from
> `/var/lib/postgresql/data` to `/var/lib/postgresql`. This is already reflected in `compose.yaml`.

**If you have existing data to preserve:**

```bash
# 1. While the old container is still running, dump all data
docker compose exec postgres pg_dumpall -U ${POSTGRES_USER} > pgdump_pg15.sql

# 2. Stop all services and remove the old volume
docker compose down -v

# 3. Start the new postgres container
docker compose up postgres -d

# 4. Wait for it to be healthy, then restore
docker compose exec -T postgres psql -U ${POSTGRES_USER} < pgdump_pg15.sql

Comment on lines +420 to +430
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Commands in README that expand POSTGRES_USER on host:"
rg -n 'docker compose exec.*\$\{POSTGRES_USER\}' README.md

echo
echo "POSTGRES_USER declarations in env files (if present):"
fd -HI '^\.env(\.rag(\.example)?)?$' -x sh -c 'echo "--- {}"; rg -n "^POSTGRES_USER=" "{}" || true'

echo
echo "Current host-shell value:"
printf 'POSTGRES_USER=%s\n' "${POSTGRES_USER-<unset>}"

Repository: WikiTeq/mAItion

Length of output: 425


Use container-side variable expansion for database migration commands.

Lines 420 and 429 expand ${POSTGRES_USER} on the host shell, but this variable is defined only in .env.rag for the container environment, not on the host. The commands will fail because the variable expands to empty string before reaching the container.

Apply the following fixes to defer variable expansion to the container:

Recommended changes
- docker compose exec postgres pg_dumpall -U ${POSTGRES_USER} > pgdump_pg15.sql
+ docker compose exec -T postgres sh -lc 'pg_dumpall -U "$POSTGRES_USER"' > pgdump_pg15.sql
...
- docker compose exec -T postgres psql -U ${POSTGRES_USER} < pgdump_pg15.sql
+ docker compose exec -T postgres sh -lc 'psql -U "$POSTGRES_USER" -d postgres' < pgdump_pg15.sql
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 420 - 430, Replace the host-side variable expansion
in the two docker commands so ${POSTGRES_USER} is expanded inside the container:
run the container command via a shell with the $ escaped or quoted, e.g. wrap
the postgres commands with sh -c and use single quotes so the container performs
expansion (replace the original lines that call "docker compose exec postgres
pg_dumpall -U ${POSTGRES_USER} > pgdump_pg15.sql" and "docker compose exec -T
postgres psql -U ${POSTGRES_USER} < pgdump_pg15.sql" with invocations like
docker compose exec postgres sh -c 'pg_dumpall -U "$POSTGRES_USER"' >
pgdump_pg15.sql and docker compose exec -T postgres sh -c 'psql -U
"$POSTGRES_USER"' < pgdump_pg15.sql so the ${POSTGRES_USER} comes from the
container environment).

# 5. Start everything else
docker compose up -d
```

**If you have no data to preserve (fresh / dev environment):**

```bash
docker compose down -v && docker compose up -d
```

### HuggingFace connection timeout

```
Expand Down
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ services:

# database
postgres:
image: ankane/pgvector:v0.5.1
image: pgvector/pgvector:0.8.2-pg18-trixie
env_file:
- .env.rag
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_data:/var/lib/postgresql
- ./helpers/01-openwebui-init.sql:/docker-entrypoint-initdb.d/01-openwebui-init.sql
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB} || exit 1" ]
Expand Down