[GH-ISSUE #2991] [BUG]: Migration Error When Mounting GCS Bucket as Volume #1914

Closed
opened 2026-02-22 18:27:12 -05:00 by yindo · 1 comment
Owner

Originally created by @i-zaykov on GitHub (Jan 20, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2991

How are you running AnythingLLM?

Docker (remote machine)

What happened?

Issue running AnythingLLM on GCP Cloud Run with GCS bucket mount

I'm trying to run AnythingLLM on GCP Cloud Run and everything works fine as long as I don't mount a GCS bucket as volume.

My Dockerfile that I'm using to build the image looks like this:

FROM mintplexlabs/anythingllm:latest
WORKDIR /app

RUN mkdir -p /app/server/storage
ENV STORAGE_DIR="/app/server/storage"
EXPOSE 3001
CMD ["node", "server/index.js"]

In Cloud Run, I'm mounting the volume to /app/server/storage and getting the following error:

2025-01-20 12:44:50.202 CET [36m[collector][0m [32minfo[39m: Collector hot directory and tmp storage wiped!
2025-01-20 12:44:50.202 CET [36m[collector][0m [32minfo[39m: Document processor app listening on port 8888
2025-01-20 12:44:51.603 CET Environment variables loaded from .env
2025-01-20 12:44:51.604 CET Prisma schema loaded from prisma/schema.prisma
2025-01-20 12:44:52.822 CET ✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 379ms
2025-01-20 12:44:52.822 CET Start using Prisma Client in Node.js (See: https://pris.ly/d/client)
2025-01-20 12:44:52.822 CET
2025-01-20 12:44:52.822 CET import { PrismaClient } from '@prisma/client'
2025-01-20 12:44:52.822 CET const prisma = new PrismaClient()
2025-01-20 12:44:52.822 CET
2025-01-20 12:44:52.822 CET or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)
2025-01-20 12:44:52.822 CET
2025-01-20 12:44:52.822 CET import { PrismaClient } from '@prisma/client/edge'
2025-01-20 12:44:52.822 CET const prisma = new PrismaClient()
2025-01-20 12:44:52.822 CET
2025-01-20 12:44:52.822 CET See other ways of importing Prisma Client: http://pris.ly/d/importing-client
2025-01-20 12:44:54.348 CET Environment variables loaded from .env
2025-01-20 12:44:54.349 CET Prisma schema loaded from prisma/schema.prisma
2025-01-20 12:44:54.357 CET Datasource "db": SQLite database "anythingllm.db" at "file:../storage/anythingllm.db"
2025-01-20 12:44:54.474 CET 27 migrations found in prisma/migrations
2025-01-20 12:44:54.676 CET Error: P3009
2025-01-20 12:44:54.676 CET migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
2025-01-20 12:44:54.676 CET The `20240412183346_init` migration started at 2025-01-20 10:30:50.976 UTC failed
2025-01-20 12:44:54.716 CET Container called exit(1).
2025-01-20 12:44:56.240 CET Default STARTUP TCP probe failed 1 time consecutively for container "anything-llm-1" on port 3001. The instance was not started.

Any ideas what might be causing this?

Are there known steps to reproduce?

No response

Originally created by @i-zaykov on GitHub (Jan 20, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2991 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? ### Issue running AnythingLLM on GCP Cloud Run with GCS bucket mount I'm trying to run AnythingLLM on GCP Cloud Run and everything works fine as long as I don't mount a GCS bucket as volume. My Dockerfile that I'm using to build the image looks like this: ```dockerfile FROM mintplexlabs/anythingllm:latest WORKDIR /app RUN mkdir -p /app/server/storage ENV STORAGE_DIR="/app/server/storage" EXPOSE 3001 CMD ["node", "server/index.js"] ``` In Cloud Run, I'm mounting the volume to `/app/server/storage` and getting the following error: ``` 2025-01-20 12:44:50.202 CET [36m[collector][0m [32minfo[39m: Collector hot directory and tmp storage wiped! 2025-01-20 12:44:50.202 CET [36m[collector][0m [32minfo[39m: Document processor app listening on port 8888 2025-01-20 12:44:51.603 CET Environment variables loaded from .env 2025-01-20 12:44:51.604 CET Prisma schema loaded from prisma/schema.prisma 2025-01-20 12:44:52.822 CET ✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 379ms 2025-01-20 12:44:52.822 CET Start using Prisma Client in Node.js (See: https://pris.ly/d/client) 2025-01-20 12:44:52.822 CET 2025-01-20 12:44:52.822 CET import { PrismaClient } from '@prisma/client' 2025-01-20 12:44:52.822 CET const prisma = new PrismaClient() 2025-01-20 12:44:52.822 CET 2025-01-20 12:44:52.822 CET or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate) 2025-01-20 12:44:52.822 CET 2025-01-20 12:44:52.822 CET import { PrismaClient } from '@prisma/client/edge' 2025-01-20 12:44:52.822 CET const prisma = new PrismaClient() 2025-01-20 12:44:52.822 CET 2025-01-20 12:44:52.822 CET See other ways of importing Prisma Client: http://pris.ly/d/importing-client 2025-01-20 12:44:54.348 CET Environment variables loaded from .env 2025-01-20 12:44:54.349 CET Prisma schema loaded from prisma/schema.prisma 2025-01-20 12:44:54.357 CET Datasource "db": SQLite database "anythingllm.db" at "file:../storage/anythingllm.db" 2025-01-20 12:44:54.474 CET 27 migrations found in prisma/migrations 2025-01-20 12:44:54.676 CET Error: P3009 2025-01-20 12:44:54.676 CET migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve 2025-01-20 12:44:54.676 CET The `20240412183346_init` migration started at 2025-01-20 10:30:50.976 UTC failed 2025-01-20 12:44:54.716 CET Container called exit(1). 2025-01-20 12:44:56.240 CET Default STARTUP TCP probe failed 1 time consecutively for container "anything-llm-1" on port 3001. The instance was not started. ``` Any ideas what might be causing this? ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:27:12 -05:00
yindo closed this issue 2026-02-22 18:27:12 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jan 20, 2025):

We have people that run the container on GCS with a persistent storage, so this is certainly possible but I dont have access to their configs - I just know that is how they run it.

I do know that the config does involve this step:
https://cloud.google.com/run/docs/configuring/services/cloud-storage-volume-mounts#mount-volume

Then on the bootup they are using these commands for mounting

 export STORAGE_LOCATION="/storage/mount/anythingllm" && \
 mkdir -p $STORAGE_LOCATION && \
 touch "$STORAGE_LOCATION/.env" && \
 docker run -d -p 3001:3001 \ # expose on port 3001 (can be any host port)
 --cap-add SYS_ADMIN \
 -v ${STORAGE_LOCATION}:/app/server/storage \
 -v ${STORAGE_LOCATION}/.env:/app/server/.env \
 -e STORAGE_DIR="/app/server/storage" \
 mintplexlabs/anythingllm:master

I know that when it comes to google you may have to make sure the perms are correct, but it is possible and if I had to guess it is either permissions or the mount is not persistent/found on boot.

@timothycarambat commented on GitHub (Jan 20, 2025): We have people that run the container on GCS with a persistent storage, so this is certainly possible but I dont have access to their configs - I just know that is how they run it. I do know that the config does involve this step: https://cloud.google.com/run/docs/configuring/services/cloud-storage-volume-mounts#mount-volume Then on the bootup they are using these commands for mounting ``` export STORAGE_LOCATION="/storage/mount/anythingllm" && \ mkdir -p $STORAGE_LOCATION && \ touch "$STORAGE_LOCATION/.env" && \ docker run -d -p 3001:3001 \ # expose on port 3001 (can be any host port) --cap-add SYS_ADMIN \ -v ${STORAGE_LOCATION}:/app/server/storage \ -v ${STORAGE_LOCATION}/.env:/app/server/.env \ -e STORAGE_DIR="/app/server/storage" \ mintplexlabs/anythingllm:master ``` I know that when it comes to google you may have to make sure the perms are correct, but it is possible and if I had to guess it is either permissions or the mount is not persistent/found on boot.
yindo changed title from [BUG]: Migration Error When Mounting GCS Bucket as Volume to [GH-ISSUE #2991] [BUG]: Migration Error When Mounting GCS Bucket as Volume 2026-06-05 14:43:26 -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#1914