[GH-ISSUE #2077] [BUG]: Cannot be deployed on a linux server docker #1351

Closed
opened 2026-02-22 18:24:23 -05:00 by yindo · 8 comments
Owner

Originally created by @icewizardry on GitHub (Aug 8, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2077

How are you running AnythingLLM?

Docker (remote machine)

What happened?

The following is the log in the docker container:

(base) root@ovinfo-1127:/data/sites/AnythingLLM# ./docker-run.sh
f4c411653961a5cb9fe0bce583c793eaacbffc0b60921572007b961913859652
(base) root@ovinfo-1127:/data/sites/AnythingLLM# docker logs -f --tail=100 anythingllm
[collector] info: Collector hot directory and tmp storage wiped!
[collector] info: Document processor app listening on port 8888
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma

✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 134ms

Start using Prisma Client in Node.js (See: https://pris.ly/d/client)

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)

import { PrismaClient } from '@prisma/client/edge'
const prisma = new PrismaClient()

See other ways of importing Prisma Client: http://pris.ly/d/importing-client

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "anythingllm.db" at "file:../storage/anythingllm.db"

Error: Schema engine error:
SQLite database error
unable to open database file: ../storage/anythingllm.db

Are there known steps to reproduce?

Run the docker-run.sh file. The following is the content of the file.

#!/bin/bash
export STORAGE_LOCATION=/data/sites/AnythingLLM &&
touch "$STORAGE_LOCATION/.env" &&
docker run -d --name=anythingllm -p 2235:3001
--cap-add SYS_ADMIN
-v ${STORAGE_LOCATION}:/app/server/storage
-v ${STORAGE_LOCATION}/.env:/app/server/.env
-e STORAGE_DIR="/app/server/storage"
--log-opt max-size=10m --log-opt max-file=3
mintplexlabs/anythingllm:1.1.1

Originally created by @icewizardry on GitHub (Aug 8, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2077 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? The following is the log in the docker container: (base) root@ovinfo-1127:/data/sites/AnythingLLM# ./docker-run.sh f4c411653961a5cb9fe0bce583c793eaacbffc0b60921572007b961913859652 (base) root@ovinfo-1127:/data/sites/AnythingLLM# docker logs -f --tail=100 anythingllm [collector] info: Collector hot directory and tmp storage wiped! [collector] info: Document processor app listening on port 8888 Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma ✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 134ms Start using Prisma Client in Node.js (See: https://pris.ly/d/client) ``` import { PrismaClient } from '@prisma/client' const prisma = new PrismaClient() ``` or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate) ``` import { PrismaClient } from '@prisma/client/edge' const prisma = new PrismaClient() ``` See other ways of importing Prisma Client: http://pris.ly/d/importing-client Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Datasource "db": SQLite database "anythingllm.db" at "file:../storage/anythingllm.db" Error: Schema engine error: SQLite database error unable to open database file: ../storage/anythingllm.db ### Are there known steps to reproduce? Run the docker-run.sh file. The following is the content of the file. #!/bin/bash export STORAGE_LOCATION=/data/sites/AnythingLLM && \ touch "$STORAGE_LOCATION/.env" && \ docker run -d --name=anythingllm -p 2235:3001 \ --cap-add SYS_ADMIN \ -v ${STORAGE_LOCATION}:/app/server/storage \ -v ${STORAGE_LOCATION}/.env:/app/server/.env \ -e STORAGE_DIR="/app/server/storage" \ --log-opt max-size=10m --log-opt max-file=3 \ mintplexlabs/anythingllm:1.1.1
yindo added the possible bug label 2026-02-22 18:24:23 -05:00
yindo closed this issue 2026-02-22 18:24:23 -05:00
Author
Owner

@mmazurekgda commented on GitHub (Aug 9, 2024):

I've encountered the same error. Running with sudo helped

@mmazurekgda commented on GitHub (Aug 9, 2024): I've encountered the same error. Running with sudo helped
Author
Owner

@timothycarambat commented on GitHub (Aug 9, 2024):

unable to open database file: ../storage/anythingllm.db

chmod the storage location. This is because you cannot write to it. /data/sites/AnythingLLM is a root mounted directory which are always write-restricted by users unless granted access.

You can move storage into userspace or chmod the directory. sudo running is not advised

@timothycarambat commented on GitHub (Aug 9, 2024): > unable to open database file: ../storage/anythingllm.db `chmod` the storage location. This is because you cannot write to it. `/data/sites/AnythingLLM` is a root mounted directory which are always write-restricted by users unless granted access. You can move storage into userspace or chmod the directory. `sudo` running is not advised
Author
Owner

@icewizardry commented on GitHub (Aug 10, 2024):

unable to open database file: ../storage/anythingllm.db

chmod the storage location. This is because you cannot write to it. /data/sites/AnythingLLM is a root mounted directory which are always write-restricted by users unless granted access.

You can move storage into userspace or chmod the directory. sudo running is not advised

I use the command "chmod 755 /data/sites/AnythingLLM"
But there is no effect, still no permission to access. I have been using this method to start various mirrored containers, but this one is the only one that has this problem. Since the disk is mounted in the /data directory, you can't restrict users to publishing using userspace.

@icewizardry commented on GitHub (Aug 10, 2024): > > unable to open database file: ../storage/anythingllm.db > > `chmod` the storage location. This is because you cannot write to it. `/data/sites/AnythingLLM` is a root mounted directory which are always write-restricted by users unless granted access. > > You can move storage into userspace or chmod the directory. `sudo` running is not advised I use the command "chmod 755 /data/sites/AnythingLLM" But there is no effect, still no permission to access. I have been using this method to start various mirrored containers, but this one is the only one that has this problem. Since the disk is mounted in the /data directory, you can't restrict users to publishing using userspace.
Author
Owner

@icewizardry commented on GitHub (Aug 10, 2024):

unable to open database file: ../storage/anythingllm.db

chmod the storage location. This is because you cannot write to it. /data/sites/AnythingLLM is a root mounted directory which are always write-restricted by users unless granted access.

You can move storage into userspace or chmod the directory. sudo running is not advised

I mounted into the path "/ home/XXX/data/sites/AnythingLLM" still doesn't work.
I have always used the root account and should not have this kind of problem.

@icewizardry commented on GitHub (Aug 10, 2024): > > unable to open database file: ../storage/anythingllm.db > > `chmod` the storage location. This is because you cannot write to it. `/data/sites/AnythingLLM` is a root mounted directory which are always write-restricted by users unless granted access. > > You can move storage into userspace or chmod the directory. `sudo` running is not advised I mounted into the path "/ home/XXX/data/sites/AnythingLLM" still doesn't work. I have always used the root account and should not have this kind of problem.
Author
Owner

@icewizardry commented on GitHub (Aug 10, 2024):

unable to open database file: ../storage/anythingllm.db

chmod the storage location. This is because you cannot write to it. /data/sites/AnythingLLM is a root mounted directory which are always write-restricted by users unless granted access.

You can move storage into userspace or chmod the directory. sudo running is not advised

I am using the root account, so there is no sudo command to execute.

@icewizardry commented on GitHub (Aug 10, 2024): > > unable to open database file: ../storage/anythingllm.db > > `chmod` the storage location. This is because you cannot write to it. `/data/sites/AnythingLLM` is a root mounted directory which are always write-restricted by users unless granted access. > > You can move storage into userspace or chmod the directory. `sudo` running is not advised I am using the root account, so there is no sudo command to execute.
Author
Owner

@ZJL0111 commented on GitHub (Aug 12, 2024):

unable to open database file: ../storage/anythingllm.db

chmod the storage location. This is because you cannot write to it. /data/sites/AnythingLLM is a root mounted directory which are always write-restricted by users unless granted access.

You can move storage into userspace or chmod the directory. sudo running is not advised

thanks! your solution solved my problem

@ZJL0111 commented on GitHub (Aug 12, 2024): > > unable to open database file: ../storage/anythingllm.db > > `chmod` the storage location. This is because you cannot write to it. `/data/sites/AnythingLLM` is a root mounted directory which are always write-restricted by users unless granted access. > > You can move storage into userspace or chmod the directory. `sudo` running is not advised thanks! your solution solved my problem
Author
Owner

@norm2k commented on GitHub (Oct 24, 2024):

It's all in the docs.

The UID and GID are set to 1000 by default. This is the default user in the Docker container and on most host operating systems.
If there is a mismatch between your host user UID and GID and what is set in the .env file, you may experience permission issues.

So something like chown -R 1000:1000 /data/sites/AnythingLLM would work.

@norm2k commented on GitHub (Oct 24, 2024): It's all in the docs. > The UID and GID are set to 1000 by default. This is the default user in the Docker container and on most host operating systems. If there is a mismatch between your host user UID and GID and what is set in the .env file, you may experience permission issues. So something like `chown -R 1000:1000 /data/sites/AnythingLLM` would work.
Author
Owner

@lucianthorr commented on GitHub (Apr 16, 2025):

Noting here for anyone else that might run into this trouble. I had no luck setting the UID/GID via the .env file but the solution above from @norm2k worked.

@lucianthorr commented on GitHub (Apr 16, 2025): Noting here for anyone else that might run into this trouble. I had no luck setting the UID/GID via the .env file but the solution above from @norm2k worked.
yindo changed title from [BUG]: Cannot be deployed on a linux server docker to [GH-ISSUE #2077] [BUG]: Cannot be deployed on a linux server docker 2026-06-05 14:40:18 -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#1351