anything-llm icon indicating copy to clipboard operation
anything-llm copied to clipboard

Docker deployment fails, apparently not reading ENV correctly

Open hillct opened this issue 1 year ago • 1 comments

When launching within a docker container via docker-compose, the environment is (seemingly) not being handled correctly. The 'System Settings' modal displays each field in red with the text "Need setup in .env file." even though the proper environment was confirmed as follows:

@dev anything-llm]$ docker exec -it --workdir=/app/collector anything-llm /bin/sh
$ env
HOSTNAME=10db28434b74
VECTOR_DB=chroma
HOME=/app
OPEN_MODEL_PREF=gpt-3.5-turbo
TERM=xterm
PATH=/app/collector/v-env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GID=1000
OPEN_AI_KEY=sk-TrusMeMyKeyIsHere
UID=1000
CACHE_VECTORS=true
PWD=/app/collector
CHROMA_ENDPOINT=http://ip_of_chroma_host_here:8000
STORAGE_DIR=./server/storage
SERVER_PORT=3001
NODE_ENV=production

A review of the server code indicates no other expected ENV variables (other than GOOGLE_API_KEY) presumably for Youuge transcript ingestion.

There's one other symptom in that when we name a workspace to create it we get Error: Failed to fetch which I presume is related to the failure to process the environment, bu it may b indicative of a separate issue

hillct avatar Jun 20 '23 21:06 hillct

I'm experiencing similar issue. When using the UI and viewing the env configuration, all env variables show an error in red and read something similar to: OpenAI API Key OpenAI API Key Need setup in .env file.

The env values in the container seem to have the proper configuration. (base) xxx@aibench:~/projects/anything-llm/docker$ docker exec -it --workdir=/app/collector anything-llm /bin/sh $ env HOSTNAME=f659ss5f76d7s GOOGLE_APIS_KEY= VECTOR_DB=lancedb HOME=/app OPEN_MODEL_PREF=gpt-3.5-turbo TERM=xterm PATH=/app/collector/v-env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GID=1000 OPEN_AI_KEY=API_KEY UID=1000 CACHE_VECTORS=true PWD=/app/collector STORAGE_DIR=./server/storage SERVER_PORT=3001 NODE_ENV=production

iguy0 avatar Jun 21 '23 03:06 iguy0

"Need setup in .env file."

Me too. For grins I tried it in Debian bookworm, Rocky 9 and ubuntu 20.04 all with the same result. I got an env similar to my .env when I ran docker exec -it --workdir=/app/collector anything-llm /bin/sh I cloned the repo today. June 24, 2023

jhalbrecht avatar Jun 24 '23 18:06 jhalbrecht

@timothycarambat I don't see a solution to this issue, either as a comment explaining the workaround, or a referenced commit addressing the issue. Can you please clarify?

hillct avatar Jun 26 '23 01:06 hillct

@timothycarambat I don't see a solution to this issue, either as a comment explaining the workaround, or a referenced commit addressing the issue. Can you please clarify?

In discord Tim said it's a duplicate, and that he is working on the problem. See; https://discord.com/channels/1114740394715004990/1114740395159597068/1122726007355473982

jhalbrecht avatar Jun 26 '23 04:06 jhalbrecht

@timothycarambat I don't see a solution to this issue, either as a comment explaining the workaround, or a referenced commit addressing the issue. Can you please clarify?

In discord Tim said it's a duplicate, and that he is working on the problem. See; https://discord.com/channels/1114740394715004990/1114740395159597068/1122726007355473982

In that case we need to see i marked as a duplicate, with an indication of which is being treated as the controlling ticket on this issue. The point here is, under no circumstances should it be marked as completed unless it is in fact completed.

hillct avatar Jun 26 '23 04:06 hillct