[GH-ISSUE #4318] [BUG]: PG image with wrong migrations #2748

Closed
opened 2026-02-22 18:31:04 -05:00 by yindo · 4 comments
Owner

Originally created by @raphaelkoester on GitHub (Aug 20, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4318

Originally assigned to: @timothycarambat on GitHub.

How are you running AnythingLLM?

Docker (local)

What happened?

the current pg img has this migration:

https://github.com/Mintplex-Labs/anything-llm/blob/pg/server/prisma/migrations/20250808171557_init/migration.sql

it is failing to apply to the postgres database due to AUTOINCREMENT:

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

4 migrations found in prisma/migrations

Applying migration 20250509192540_init
Applying migration 20250709230835_init
Applying migration 20250725194841_init
Error: P3018

A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve

Migration name: 20250725194841_init

Database error code: 42601

Database error:
ERROR: syntax error at or near "AUTOINCREMENT"

Position:
0
1 -- CreateTable
2 CREATE TABLE "desktop_mobile_devices" (
3 "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,

DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42601), message: "syntax error at or near "AUTOINCREMENT"", detail: None, hint: None, position: Some(Original(94)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("scan.l"), line: Some(1244), routine: Some("scanner_yyerror") }

Are there known steps to reproduce?

delete past images with pg tag, and pull the latest one. it will throw this error above

Originally created by @raphaelkoester on GitHub (Aug 20, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4318 Originally assigned to: @timothycarambat on GitHub. ### How are you running AnythingLLM? Docker (local) ### What happened? the current pg img has this migration: https://github.com/Mintplex-Labs/anything-llm/blob/pg/server/prisma/migrations/20250808171557_init/migration.sql it is failing to apply to the postgres database due to AUTOINCREMENT: Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Datasource "db": PostgreSQL database "anythingllm", schema "public" at "anythingllm-db:5432" 4 migrations found in prisma/migrations Applying migration `20250509192540_init` Applying migration `20250709230835_init` Applying migration `20250725194841_init` Error: P3018 A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve Migration name: 20250725194841_init Database error code: 42601 Database error: ERROR: syntax error at or near "AUTOINCREMENT" Position: 0 1 -- CreateTable 2 CREATE TABLE "desktop_mobile_devices" ( 3 "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42601), message: "syntax error at or near \"AUTOINCREMENT\"", detail: None, hint: None, position: Some(Original(94)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("scan.l"), line: Some(1244), routine: Some("scanner_yyerror") } ### Are there known steps to reproduce? delete past images with pg tag, and pull the latest one. it will throw this error above
yindo added the possible buginvestigating labels 2026-02-22 18:31:04 -05:00
yindo closed this issue 2026-02-22 18:31:04 -05:00
Author
Owner

@Vincent-AC commented on GitHub (Aug 21, 2025):

Just to add that I have the same bug with the image

@Vincent-AC commented on GitHub (Aug 21, 2025): Just to add that I have the same bug with the image
Author
Owner

@jsivu commented on GitHub (Aug 21, 2025):

Got the same bug

@jsivu commented on GitHub (Aug 21, 2025): Got the same bug
Author
Owner

@drahkrub commented on GitHub (Aug 22, 2025):

Me too. And I would like to ask:

Does the pg image also require AVX2 support? https://github.com/Mintplex-Labs/anything-llm/issues/3736 / https://github.com/Mintplex-Labs/anything-llm/issues/1331

I hope not, as I assume or hope that pgvector will be used instead of lancedb, if I understand correctly.

@drahkrub commented on GitHub (Aug 22, 2025): Me too. And I would like to ask: Does the `pg` image also require AVX2 support? https://github.com/Mintplex-Labs/anything-llm/issues/3736 / https://github.com/Mintplex-Labs/anything-llm/issues/1331 I hope not, as I assume or hope that pgvector will be used instead of lancedb, if I understand correctly.
Author
Owner

@timothycarambat commented on GitHub (Aug 22, 2025):

closed by 7331faaaa1

@drahkrub It should not, since lance existing in the image is not the problem; it only becomes an issue once invoked, since the error is thrown from the lance binary, not the wrapper code. From what i know, that is the only dependency that has this restriction which is why the resolution is to use another vectorDB provider before booting up.

@timothycarambat commented on GitHub (Aug 22, 2025): closed by 7331faaaa18e1c84ce711f40454b45b6b35a5774 @drahkrub It should not, since lance existing in the image is not the problem; it only becomes an issue once invoked, since the error is thrown from the lance binary, not the wrapper code. From what i know, that is the only dependency that has this restriction which is why the resolution is to use another vectorDB provider before booting up.
yindo changed title from [BUG]: PG image with wrong migrations to [GH-ISSUE #4318] [BUG]: PG image with wrong migrations 2026-06-05 14:48:19 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2748