[GH-ISSUE #1402] [BUG]: Container cashing with docker run command provided in the documentation #893

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

Originally created by @clipod on GitHub (May 14, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1402

How are you running AnythingLLM?

Docker (local)

What happened?

I am trying to run anythingllm in local docker. My docker is installed on a Debian instance. I am running the command given in the documentation as root(unfortunately I dont have a choice).

export STORAGE_LOCATION=/tmp/anything-llm/docker && mkdir -p $STORAGE_LOCATION && touch "$STORAGE_LOCATION/.env" && docker run -d -p 3001:3001 --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

I am getting the below error,

Collector hot directory and tmp storage wiped!
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 197ms
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

Not sure what I am doing wrong here.

Are there known steps to reproduce?

No response

Originally created by @clipod on GitHub (May 14, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1402 ### How are you running AnythingLLM? Docker (local) ### What happened? I am trying to run anythingllm in local docker. My docker is installed on a Debian instance. I am running the command given in the documentation as root(unfortunately I dont have a choice). ``` export STORAGE_LOCATION=/tmp/anything-llm/docker && mkdir -p $STORAGE_LOCATION && touch "$STORAGE_LOCATION/.env" && docker run -d -p 3001:3001 --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 ``` I am getting the below error, ``` Collector hot directory and tmp storage wiped! 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 197ms 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 ``` Not sure what I am doing wrong here. ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:22:03 -05:00
yindo closed this issue 2026-02-22 18:22:03 -05:00
Author
Owner

@hmazomba commented on GitHub (May 15, 2024):

I also get the same error when running this command on Arch linux.

Command:
export STORAGE_LOCATION=$HOME/anythingllm &&
mkdir -p $STORAGE_LOCATION &&
touch "$STORAGE_LOCATION/.env" &&
docker run -d -p 3001:3001
--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

@hmazomba commented on GitHub (May 15, 2024): I also get the same error when running this command on Arch linux. Command: export STORAGE_LOCATION=$HOME/anythingllm && \ mkdir -p $STORAGE_LOCATION && \ touch "$STORAGE_LOCATION/.env" && \ docker run -d -p 3001:3001 \ --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
Author
Owner

@timothycarambat commented on GitHub (May 15, 2024):

/tmp/ is a non-writable directory by the docker user. This typically works better on *inx system when you either give the docker-user the permission to write at those top level folders or just run the container in the $HOME of the user running the container.

@timothycarambat commented on GitHub (May 15, 2024): `/tmp/` is a non-writable directory by the docker user. This typically works better on *inx system when you either give the docker-user the permission to write at those top level folders or just run the container in the $HOME of the user running the container.
Author
Owner

@hmazomba commented on GitHub (May 15, 2024):

Ok but bruv that doesn't help because I am using my $HOME. Literally ran it inside my $HOME directory, still getting an error about anythingllm.db

@hmazomba commented on GitHub (May 15, 2024): Ok but bruv that doesn't help because I am using my $HOME. Literally ran it inside my $HOME directory, still getting an error about anythingllm.db
Author
Owner

@timothycarambat commented on GitHub (May 15, 2024):

Sorry i didn't see the second comment for some reason, clearly you did that

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

Would indicate that there is no file anythingllm.db in $HOME/anythingllm - however, the container should create it automatically. If it is not, that would prevent docker from booting or is the file is non-readable/editable

-v ${STORAGE_LOCATION}:/app/server/storage

binds $HOME/anythingllm in host to /app/server/storage in the container. So we should expect to see anythingllm.db in there

@timothycarambat commented on GitHub (May 15, 2024): Sorry i didn't see the second comment for some reason, clearly you did that > unable to open database file: ../storage/anythingllm.db Would indicate that there is no file `anythingllm.db` in `$HOME/anythingllm` - however, the container should create it automatically. If it is not, that would prevent docker from booting or is the file is non-readable/editable >-v ${STORAGE_LOCATION}:/app/server/storage binds `$HOME/anythingllm` in host to `/app/server/storage` in the container. So we should expect to see `anythingllm.db` in there
Author
Owner

@clipod commented on GitHub (May 16, 2024):

Ok, now I got this error. Its the same error in the logs when I tried building using docker-compose too.

My command:

export STORAGE_LOCATION=$HOME/anythingllm && mkdir -p $STORAGE_LOCATION && touch "$STORAGE_LOCATION/anythingllm.db" &&touch "$STORAGE_LOCATION/.env" && docker run -d -p 3001:3001 --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

Logs:

Collector hot directory and tmp storage wiped!
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 196ms
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"
20 migrations found in prisma/migrations
Error: SQLite database error
attempt to write a readonly database
   0: sql_schema_connector::sql_migration_persistence::initialize
           with namespaces=None
             at schema-engine/connectors/sql-schema-connector/src/sql_migration_persistence.rs:14
   1: schema_core::state::ApplyMigrations
             at schema-engine/core/src/state.rs:201

Just to be sure I gave all permissions to that file.

root@pve:~/anythingllm# ls -lta
total 8
-rw-r--r--  1 root root    0 May 16 13:06 .env
-rwxrwxrwx  1 root root    0 May 16 12:59 anythingllm.db
drwxr-xr-x  2 root root 4096 May 16 12:59 .
drwx------ 23 root root 4096 May 16 12:57 ..
@clipod commented on GitHub (May 16, 2024): Ok, now I got this error. Its the same error in the logs when I tried building using docker-compose too. My command: ``` export STORAGE_LOCATION=$HOME/anythingllm && mkdir -p $STORAGE_LOCATION && touch "$STORAGE_LOCATION/anythingllm.db" &&touch "$STORAGE_LOCATION/.env" && docker run -d -p 3001:3001 --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 ``` Logs: ``` Collector hot directory and tmp storage wiped! 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 196ms 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" 20 migrations found in prisma/migrations Error: SQLite database error attempt to write a readonly database 0: sql_schema_connector::sql_migration_persistence::initialize with namespaces=None at schema-engine/connectors/sql-schema-connector/src/sql_migration_persistence.rs:14 1: schema_core::state::ApplyMigrations at schema-engine/core/src/state.rs:201 ``` Just to be sure I gave all permissions to that file. ``` root@pve:~/anythingllm# ls -lta total 8 -rw-r--r-- 1 root root 0 May 16 13:06 .env -rwxrwxrwx 1 root root 0 May 16 12:59 anythingllm.db drwxr-xr-x 2 root root 4096 May 16 12:59 . drwx------ 23 root root 4096 May 16 12:57 .. ```
Author
Owner

@timothycarambat commented on GitHub (May 16, 2024):

attempt to write a readonly database

So this is where my first comment is more relevant. The file is not writable by whatever user is running the docker container. You can chmod -R $HOME/anythingllm and it'll be writeable by the container now

@timothycarambat commented on GitHub (May 16, 2024): > attempt to write a readonly database So this is where my first comment is more relevant. The file is not writable by whatever user is running the docker container. You can `chmod -R $HOME/anythingllm` and it'll be writeable by the container now
Author
Owner

@clipod commented on GitHub (May 16, 2024):

Ah, I was giving write permissions to just the DB file. But once I gave it to the whole folder, the container stood up. Thanks.

@clipod commented on GitHub (May 16, 2024): Ah, I was giving write permissions to just the DB file. But once I gave it to the whole folder, the container stood up. Thanks.
Author
Owner

@JOduMonT commented on GitHub (Jun 5, 2024):

I'm using Docker 23.0.6 on latest LTS Ubuntu
even as root

  • the anythingllm.db is not created
export STORAGE_LOCATION=$HOME/anythingllm && \
mkdir -p $STORAGE_LOCATION && \
touch "$STORAGE_LOCATION/.env" && \
docker run -d -p 3001:3001 \
--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

@clipod did it work for you at the end ?

UPDATE

Nevermind I understood comment /tmp and the chmod .... thing by reading this comment

@JOduMonT commented on GitHub (Jun 5, 2024): I'm using Docker 23.0.6 on latest LTS Ubuntu even as root - **the anythingllm.db is not created** ````bash export STORAGE_LOCATION=$HOME/anythingllm && \ mkdir -p $STORAGE_LOCATION && \ touch "$STORAGE_LOCATION/.env" && \ docker run -d -p 3001:3001 \ --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 ```` @clipod did it work for you at the end ? ## UPDATE Nevermind I understood comment /tmp and the chmod .... thing by reading this [comment](https://github.com/Mintplex-Labs/anything-llm/issues/1185#issuecomment-2077339450)
yindo changed title from [BUG]: Container cashing with docker run command provided in the documentation to [GH-ISSUE #1402] [BUG]: Container cashing with docker run command provided in the documentation 2026-06-05 14:37:47 -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#893