chore(release): staging to production - 2025.11.24 - #725
Merged
Conversation
… failures (#724) ## Problem Deployments have been failing since November 19, 2025 when Prisma 7.0.0 was released. The root cause was a version mismatch between the Prisma CLI used at runtime vs. the project's dependencies: - **Project uses:** Prisma 5.22.0 (locked in package.json and pnpm-lock.yaml) - **Docker runtime installed:** Prisma 7.0.0 (latest via `npm install -g prisma`) - **Breaking change in Prisma 7:** The `url` property in the datasource block is no longer supported ### Error Symptoms ``` Error: P1012: error: Error validating datasource `db`: the preview feature "postgresqlExtensions" is not known --> schema.prisma:15 | 14 | provider = "postgresql" 15 | url = env("DATABASE_URL") | Validation Error Count: 1 ``` This occurred because: 1. Dockerfile ran `npm install -g prisma` which installed 7.0.0 globally 2. At runtime, `entrypoint.sh` used the global `prisma` command (7.0.0) 3. Prisma 7.0.0 tried to read schema.prisma written for Prisma 5.22.0 4. Version incompatibility caused validation errors and deployment failures --- ## Solution **Use the project's Prisma version instead of a global install:** ### Changes Made 1. **Removed global Prisma installation** (`apps/web/Dockerfile`) - Deleted: `RUN npm install -g prisma` - Global installs always get the latest version, causing drift 2. **Copy node_modules to runtime stage** (`apps/web/Dockerfile`) - Added: `COPY --from=installer --chown=nextjs:nodejs /app/node_modules ./node_modules` - Ensures Prisma CLI 5.22.0 from project dependencies is available at runtime 3. **Use npx to invoke Prisma** (`apps/web/entrypoint.sh`) - Changed: `prisma migrate deploy` → `npx prisma migrate deploy` - npx uses the project's local Prisma version from node_modules ### Why This Works - **Version consistency:** Runtime uses the exact Prisma version specified in package.json - **No global installs:** Avoids "latest version" drift - **Explicit versioning:** npx resolves Prisma from ./node_modules, not global PATH - **Future-proof:** When we upgrade Prisma, both build and runtime use the same version --- ## Testing ### Verified Locally ```bash # Build Docker image docker build -t theanswer-web -f apps/web/Dockerfile . # Run with database docker run --rm -p 3000:3000 \ -e DATABASE_URL="postgresql://example_user:example_password@host.docker.internal:5432/example_db" \ theanswer-web # Observed successful output: # ✓ Running database migration... # ✓ Attempting database migration deployment... # ✓ Prisma Migrate applied the following migration(s): # ✓ 20241120000000_init # ✓ Starting Next.js server... ``` ### Test Plan for Deployment - [ ] Build succeeds without errors - [ ] Container starts successfully - [ ] Prisma migrations execute using 5.22.0 - [ ] No schema validation errors - [ ] Application serves traffic normally --- ## Impact **Scope:** Critical deployment fix **Affected Areas:** - Docker build process (Dockerfile) - Container runtime (entrypoint.sh) - Database migrations (Prisma CLI invocation) **Risk:** Low - Changes are isolated to Docker build and entrypoint script - No application code changes - Uses project's existing Prisma version (no upgrade) - Falls back to same behavior as before global install was added **Rollback:** Revert this PR if issues occur --- ## Related Issues - **AGENT-429:** Fix Docker Prisma version mismatch causing deployment failures - **Root cause:** Prisma 7.0.0 release on Nov 19, 2025 introduced breaking changes - **Timeline:** Deployments failing since Nov 19, 2025 --- ## Checklist - [x] Removed global Prisma installation from Dockerfile - [x] Added node_modules copy to runtime stage - [x] Updated entrypoint.sh to use `npx prisma` - [x] Tested Docker build locally - [x] Verified Prisma version consistency (5.22.0) - [x] Confirmed no schema validation errors - [x] Ready for staging deployment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
maxtechera
temporarily deployed
to
staging - aai-unified2-flowise-moonstruck
November 24, 2025 01:09 — with
Render
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Release: Staging to Production
Release Date: 2025-11-24
Changes in this release
This PR is automatically created/updated when commits are pushed to staging.
Merging this PR will trigger the release workflow to create a new GitHub release.