Visual-Regression-Tracker / Visual-Regression-Tracker/backend

following setup from readme fails at `npx prisma migrate deploy`

Open
#341 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15
Forks
18
Avg merge
15h 50m
Merged PRs (30d)
2

Description

I follow the readme to locally develop on backend. When I follow the steps, it works up until I run npx prisma migrate deploy. That command fails with the following error:

Error: P3005

The database schema is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline

I'm on Windows, running everything in WSL. This is the command I use:

{
    git clone https://github.com/Visual-Regression-Tracker/backend &&
    cd backend &&
    node -v &&
    docker compose up postgres -d &&
    sleep 5 &&
    npm i &&
    npm run test &&
    npx prisma db push &&
    npx prisma migrate deploy &&
    npm run test:e2e
} 2>&1 | tee log.txt
Full log
Cloning into 'backend'...
v18.20.8
time="2026-02-12T17:45:25+01:00" level=warning msg="The \"ELASTIC_URL\" variable is not set. Defaulting to a blank string."
time="2026-02-12T17:45:25+01:00" level=warning msg="No services to build"
 Network backend_default Creating 
 Network backend_default Created 
 Volume backend_postgres Creating 
 Volume backend_postgres Created 
 Container postgres Creating 
 Container postgres Created 
 Container postgres Starting 
 Container postgres Started 
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'vrt-backend@1.1.0',
npm warn EBADENGINE   required: { node: '>=20' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'glob@11.0.3',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'jackspeak@4.1.1',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'lru-cache@11.2.2',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'minimatch@10.1.1',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'path-scurry@2.0.0',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@google/genai@1.34.0',
npm warn EBADENGINE   required: { node: '>=20.0.0' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@isaacs/balanced-match@4.0.1',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@isaacs/brace-expansion@5.0.0',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@nestjs/cli@11.0.10',
npm warn EBADENGINE   required: { node: '>= 20.11' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'glob@11.0.3',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'jackspeak@4.1.1',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'lru-cache@11.2.2',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'minimatch@10.1.1',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'path-scurry@2.0.0',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@nestjs/core@11.1.8',
npm warn EBADENGINE   required: { node: '>= 20' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'file-type@21.0.0',
npm warn EBADENGINE   required: { node: '>=20' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead

> vrt-backend@1.1.0 postinstall
> prisma generate

warn The configuration property `package.json#prisma` is deprecated and will be removed in Prisma 7. Please migrate to a Prisma config file (e.g., `prisma.config.ts`).
For more information, see: https://pris.ly/prisma-config

Environment variables loaded from .env
Environment variables loaded from prisma/.env
Prisma schema loaded from prisma/schema.prisma
┌─────────────────────────────────────────────────────────┐
│  Update available 6.18.0 -> 7.4.0                       │
│                                                         │
│  This is a major update - please follow the guide at    │
│  https://pris.ly/d/major-version-upgrade                │
│                                                         │
│  Run the following to update                            │
│    npm i --save-dev prisma@latest                       │
│    npm i @prisma/client@latest                          │
└─────────────────────────────────────────────────────────┘

✔ Generated Prisma Client (v6.18.0) to ./node_modules/@prisma/client in 106ms

Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)

Tip: Interested in query caching in just a few lines of code? Try Accelerate today! https://pris.ly/tip-3-accelerate


added 1150 packages, and audited 1151 packages in 27s

216 packages are looking for funding
  run `npm fund` for details

35 vulnerabilities (2 low, 5 moderate, 28 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> vrt-backend@1.1.0 test
> jest --projects src

[Nest] 13113  - 02/12/2026, 5:46:32 PM   ERROR [OllamaService] Ollama generate request failed: Connection refused
PASS Unit Tests src/compare/libs/vlm/ollama.service.spec.ts (32.451 s)
[Nest] 13113  - 02/12/2026, 5:46:32 PM   ERROR [OllamaService] Failed to list models: Service Unavailable
PASS Unit Tests src/users/users.service.spec.ts (35.959 s)
[Nest] 13103  - 02/12/2026, 5:46:35 PM   ERROR [PixelmatchService] Cannot parse config, fallback to default one SyntaxError: Unexpected end of JSON input
[Nest] 13103  - 02/12/2026, 5:46:36 PM   ERROR [PixelmatchService] Cannot parse config, fallback to default one SyntaxError: Unexpected token i in JSON at position 0
[Nest] 13101  - 02/12/2026, 5:46:36 PM   ERROR [OdiffService] Cannot parse config, fallback to default one SyntaxError: Unexpected end of JSON input
[Nest] 13101  - 02/12/2026, 5:46:36 PM   ERROR [OdiffService] Cannot parse config, fallback to default one SyntaxError: Unexpected token i in JSON at position 0
PASS Unit Tests src/compare/libs/odiff/odiff.service.spec.ts (36.281 s)
PASS Unit Tests src/compare/libs/pixelmatch/pixelmatch.service.spec.ts (36.565 s)
PASS Unit Tests src/users/ldap/ldapusers.service.spec.ts (37.738 s)
[Nest] 13136  - 02/12/2026, 5:46:38 PM   ERROR [OllamaService] Ollama generate request failed: Connection refused
[Nest] 13136  - 02/12/2026, 5:46:38 PM   ERROR [OllamaService] Failed to list models: Service Unavailable
PASS Unit Tests src/compare/libs/vlm/providers/ollama/ollama.service.spec.ts (38.399 s)
PASS Unit Tests src/builds/dto/build.dto.spec.ts
[Nest] 13095  - 02/12/2026, 5:46:38 PM   ERROR [VlmService] VLM comparison failed: Unexpected token I in JSON at position 0
SyntaxError: Unexpected token I in JSON at position 0
    at JSON.parse (<anonymous>)
    at VlmService.parseVlmResponse (/home/adabru/backend/src/compare/libs/vlm/vlm.service.ts:135:25)
    at VlmService.compareImagesWithVLM (/home/adabru/backend/src/compare/libs/vlm/vlm.service.ts:154:17)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at VlmService.getDiff (/home/adabru/backend/src/compare/libs/vlm/vlm.service.ts:85:37)
    at /home/adabru/backend/src/compare/libs/vlm/vlm.service.spec.ts:159:20
[Nest] 13095  - 02/12/2026, 5:46:38 PM   ERROR [VlmService] VLM comparison failed: Connection refused
Error: Connection refused
    at /home/adabru/backend/src/compare/libs/vlm/vlm.service.spec.ts:156:37
    at Object.<anonymous> (/home/adabru/backend/node_modules/jest-each/build/bind.js:81:13)
    at Promise.then.completed (/home/adabru/backend/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/adabru/backend/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/home/adabru/backend/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/adabru/backend/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/home/adabru/backend/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/home/adabru/backend/node_modules/jest-circus/build/run.js:121:9)
    at run (/home/adabru/backend/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/home/adabru/backend/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/adabru/backend/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/adabru/backend/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/adabru/backend/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/adabru/backend/node_modules/jest-runner/build/testWorker.js:106:12)
[Nest] 13095  - 02/12/2026, 5:46:38 PM   ERROR [VlmService] Cannot parse config, fallback to default one SyntaxError: Unexpected end of JSON input
[Nest] 13095  - 02/12/2026, 5:46:38 PM   ERROR [VlmService] Cannot parse config, fallback to default one SyntaxError: Unexpected token i in JSON at position 0
[Nest] 13129  - 02/12/2026, 5:46:38 PM   ERROR [LookSameService] Cannot parse config, fallback to default one SyntaxError: Unexpected end of JSON input
[Nest] 13095  - 02/12/2026, 5:46:38 PM   ERROR [VlmService] VLM comparison failed: Cannot read properties of undefined (reading 'content')
TypeError: Cannot read properties of undefined (reading 'content')
    at VlmService.extractResponseContent (/home/adabru/backend/src/compare/libs/vlm/vlm.service.ts:122:73)
    at VlmService.compareImagesWithVLM (/home/adabru/backend/src/compare/libs/vlm/vlm.service.ts:153:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at VlmService.getDiff (/home/adabru/backend/src/compare/libs/vlm/vlm.service.ts:85:37)
    at Object.<anonymous> (/home/adabru/backend/src/compare/libs/vlm/vlm.service.spec.ts:290:22)
[Nest] 13129  - 02/12/2026, 5:46:38 PM   ERROR [LookSameService] Cannot parse config, fallback to default one SyntaxError: Unexpected token i in JSON at position 0
PASS Unit Tests src/compare/libs/vlm/vlm.service.spec.ts (38.711 s)
PASS Unit Tests src/compare/libs/looks-same/looks-same.service.spec.ts (38.938 s)
PASS Unit Tests src/test-variations/test-variations.service.spec.ts (39.541 s)
PASS Unit Tests src/test-runs/test-runs.service.spec.ts (40.415 s)
[Nest] 13143  - 02/12/2026, 5:46:41 PM   ERROR [GeminiService] Gemini generate request failed: API Error
Error: API Error
    at /home/adabru/backend/src/compare/libs/vlm/providers/gemini/gemini.service.spec.ts:118:47
    at Object.<anonymous> (/home/adabru/backend/node_modules/jest-each/build/bind.js:81:13)
    at Promise.then.completed (/home/adabru/backend/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/adabru/backend/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/home/adabru/backend/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/adabru/backend/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/home/adabru/backend/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/home/adabru/backend/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (/home/adabru/backend/node_modules/jest-circus/build/run.js:121:9)
    at run (/home/adabru/backend/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/home/adabru/backend/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/adabru/backend/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/adabru/backend/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/adabru/backend/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/adabru/backend/node_modules/jest-runner/build/testWorker.js:106:12)
PASS Unit Tests src/compare/libs/vlm/providers/gemini/gemini.service.spec.ts (5.696 s)
PASS Unit Tests src/users/users.factory.spec.ts
PASS Unit Tests src/static/static.factory.spec.ts
PASS Unit Tests src/compare/compare.service.spec.ts (7.061 s)
PASS Unit Tests src/static/static.service.spec.ts
PASS Unit Tests src/health/health.controller.spec.ts
PASS Unit Tests src/shared/tasks/tasks.service.spec.ts (7.923 s)
PASS Unit Tests src/builds/builds.controller.spec.ts (10.338 s)
PASS Unit Tests src/compare/utils/index.spec.ts
PASS Unit Tests src/app.service.spec.ts
PASS Unit Tests src/projects/projects.service.spec.ts (8.318 s)
PASS Unit Tests src/auth/auth.service.spec.ts
PASS Unit Tests src/projects/projects.controller.spec.ts (6.132 s)
PASS Unit Tests src/test-variations/test-variations.controller.spec.ts (7.559 s)
PASS Unit Tests src/builds/builds.service.spec.ts (48.151 s)
PASS Unit Tests src/users/users.controller.spec.ts
PASS Unit Tests src/test-runs/test-runs.controller.spec.ts (8.406 s)
PASS Unit Tests src/prisma/prisma.service.spec.ts
PASS Unit Tests src/test-runs/dto/testRun.dto.spec.ts (6.642 s)

Test Suites: 30 passed, 30 total
Tests:       157 passed, 157 total
Snapshots:   4 passed, 4 total
Time:        50.027 s
Ran all test suites.
warn The configuration property `package.json#prisma` is deprecated and will be removed in Prisma 7. Please migrate to a Prisma config file (e.g., `prisma.config.ts`).
For more information, see: https://pris.ly/prisma-config

Environment variables loaded from .env
Environment variables loaded from prisma/.env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "vrt_db_dev", schema "public" at "localhost:5432"

🚀  Your database is now in sync with your Prisma schema. Done in 430ms

Running generate... (Use --skip-generate to skip the generators)
Running generate... - Prisma Client
✔ Generated Prisma Client (v6.18.0) to ./node_modules/@prisma/client in 295ms

warn The configuration property `package.json#prisma` is deprecated and will be removed in Prisma 7. Please migrate to a Prisma config file (e.g., `prisma.config.ts`).
For more information, see: https://pris.ly/prisma-config

Environment variables loaded from .env
Environment variables loaded from prisma/.env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "vrt_db_dev", schema "public" at "localhost:5432"

2 migrations found in prisma/migrations

Error: P3005

The database schema is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README setup sequence and the npx prisma migrate deploy step, then inspect prisma/schema.prisma and the migration-related configuration shown in the log. Re-run the setup with the documented Node version and PostgreSQL container to determine whether the failure is reproducible. Done means a fresh local setup can complete the migration step and continue to the end-to-end tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, node.js, postgresql, typescript
Domain
backend, databases, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.