fix: force recreate postgres with pgvector before app startup in deploy pipeline
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 5s

This commit is contained in:
Antigravity
2026-05-12 07:46:07 +00:00
parent dc4244f2ad
commit bbe54cf656
2 changed files with 69 additions and 2 deletions

44
DEPLOY-ISSUES-2.md Normal file
View File

@@ -0,0 +1,44 @@
# Deployment Still Failing — 502 Error
## Date: 2026-05-12 (second attempt)
## Problem
After push of dc4244f, deploy relaunched BUT:
- postgres container was NOT recreated with new pgvector/pgvector:pg16 image
- Still running postgres:16-alpine — no pgvector — type "vector" does not exist
- docker compose pull postgres added in deploy.yaml is not enough — need docker compose up -d --force-recreate postgres
## Production logs (192.168.1.190)
- memento-web: Restarting loop
- memento-postgres: healthy but STILL on postgres:16-alpine
- Error: type "vector" does not exist
## Root cause
deploy.yaml does docker compose build then docker compose up -d BUT:
- postgres has no build: directive — uses image directly
- docker compose up -d does NOT recreate container if image didnt change locally
- Even with docker compose pull, existing container may not be recreated
## What must be fixed
### 1. deploy.yaml (.gitea/workflows/deploy.yaml)
Add BEFORE docker compose up -d:
- docker compose pull postgres
- docker compose up -d --force-recreate postgres
- Wait for postgres healthy before continuing
Or use: docker compose up -d --force-recreate --build
### 2. Verify docker-compose.yml has correct image
image: pgvector/pgvector:pg16
### 3. Prisma migration is stuck
Old migration 20260512120000_pgvector_and_fts_search marked as failed in _prisma_migrations.
Need to mark it resolved after pgvector is installed.
### 4. Correct deployment order
1. Pull + recreate postgres with pgvector
2. Wait postgres healthy
3. Create vector extension: CREATE EXTENSION IF NOT EXISTS vector
4. Resolve failed migration in _prisma_migrations
5. Start memento-web (will run migration)
6. Start mcp-server