Mintplex-Labs / anything-llm

The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, and more.
https://anythingllm.com
MIT License
22.19k stars 2.25k forks source link

[BUG]: Cannot be deployed on a linux server docker #2077

Closed icewizardry closed 1 month ago

icewizardry commented 1 month ago

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

mmazurekgda commented 1 month ago

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

timothycarambat commented 1 month ago

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

icewizardry commented 1 month ago

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 1 month ago

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 1 month ago

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.

ZJL0111 commented 1 month ago

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