[GH-ISSUE #4140] [BUG]: Could not respond to message. No OpenAI API key was set. #2633

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

Originally created by @chalitbkb on GitHub (Jul 13, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4140

How are you running AnythingLLM?

Docker (pg) versions

What happened?

I have a question: I have already set the OpenAI key, and the system is running in production on an online server. After that, I tried conversing with the model normally. However, why after I restarted the server and started a new chat again, did I receive this error: "Could not respond to message. No OpenAI API key was set."

Which found that specifying the base URL has an env name called "DATABASE_URL", and I chose to use an online database service from "supabase". I have set it as postgresql://postgres.lvqfpyzgcpyaqwcksikb:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres

Which has already connected to the database, meaning that any setting data will be stored at postgres provided by supabase. Then I tried setting up in the settings page to test whether the data would be stored in the supabase database or not. I tried setting some things like "UI Preferences", "Add user", "System Prompt Variables", and "LLM Preference openai". After restarting the server, I found that all settings were stored in the supabase database, except for "LLM Preference openai" which was reset to "None selected".
The question is why all settings including chat , image history can be called and displayed well, but "LLM Preference key openai" is reset. Why isn't the key stored in the supabase database? In my opinion, it should be stored in supabase. It shouldn't store scattered data when the "DATABASE_URL" database is already specified; it should be in the same place. I don't want to store any data at STORAGE_DIR="/app/server/storage" because the "DATABASE_URL" database has already been specified. It doesn't make sense. Please consider this matter. Therefore, STORAGE_DIR will be ignored immediately if DATABASE_URL is specified, but now it seems like the system forces you to specify STORAGE_DIR. If STORAGE_DIR is not specified, the system won't continue working

Before restarting the server:

Image Image

After restarting the server:

Image Image

### I'm just curious, I don't understand why setting "STORAGE_DIR" still needs to store data, and since DATABASE_URL is set, why do we need to set STORAGE_DIR again? And why does the entire configuration, including chat history after resetting the server, work well but the "LLM Preference key openai" gets reset? Why isn't the key stored in the Supabase database?

Are there known steps to reproduce?

No response

Originally created by @chalitbkb on GitHub (Jul 13, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4140 ### How are you running AnythingLLM? Docker (pg) versions ### What happened? I have a question: I have already set the OpenAI key, and the system is running in production on an online server. After that, I tried conversing with the model normally. However, why after I restarted the server and started a new chat again, did I receive this error: "Could not respond to message. No OpenAI API key was set." * I have read the documentation here: "https://docs.anythingllm.com/installation-docker/quickstart#pg-image-startup-command" Which found that specifying the base URL has an env name called "DATABASE_URL", and I chose to use an online database service from "supabase". I have set it as postgresql://postgres.lvqfpyzgcpyaqwcksikb:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres Which has already connected to the database, meaning that any setting data will be stored at postgres provided by supabase. Then I tried setting up in the settings page to test whether the data would be stored in the supabase database or not. I tried setting some things like "UI Preferences", "Add user", "System Prompt Variables", and "LLM Preference openai". After restarting the server, I found that all settings were stored in the supabase database, except for "LLM Preference openai" which was reset to "None selected". The question is why all settings including chat , image history can be called and displayed well, but "LLM Preference key openai" is reset. Why isn't the key stored in the supabase database? In my opinion, it should be stored in supabase. It shouldn't store scattered data when the "DATABASE_URL" database is already specified; it should be in the same place. I don't want to store any data at STORAGE_DIR="/app/server/storage" because the "DATABASE_URL" database has already been specified. It doesn't make sense. Please consider this matter. Therefore, STORAGE_DIR will be ignored immediately if DATABASE_URL is specified, but now it seems like the system forces you to specify STORAGE_DIR. If STORAGE_DIR is not specified, the system won't continue working **Before restarting the server:** <img width="1047" height="406" alt="Image" src="https://github.com/user-attachments/assets/820d2784-ac47-4de7-bf1f-8c9b25dbc98b" /> <img width="781" height="564" alt="Image" src="https://github.com/user-attachments/assets/9e586517-ef86-429e-909d-7b4d37e64591" /> **After restarting the server:** <img width="468" height="612" alt="Image" src="https://github.com/user-attachments/assets/b9f8cb3d-7fde-46cd-b99a-b03be8187645" /> <img width="1239" height="393" alt="Image" src="https://github.com/user-attachments/assets/d4ce0de6-ad4e-4cc2-9f47-da5a8baf6cb4" /> _**### I'm just curious, I don't understand why setting "STORAGE_DIR" still needs to store data, and since DATABASE_URL is set, why do we need to set STORAGE_DIR again? And why does the entire configuration, including chat history after resetting the server, work well but the "LLM Preference key openai" gets reset? Why isn't the key stored in the Supabase database?**_ ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:30:32 -05:00
yindo closed this issue 2026-02-22 18:30:32 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jul 14, 2025):

Several keys/credentials are in a managed .env file binded to the volume of the instance. That is all. We dont push every credential to the db and we wont be doing that either. Use the official docker command so you can have persistent storage and this wont happen on container reboot.

I don't understand why setting "STORAGE_DIR" still needs to store data,

STORAGE_DIR is where documents, caches vectors, model downloads and ton of information live including the aforementioned env file. You cannot store these types of objects in a database

@timothycarambat commented on GitHub (Jul 14, 2025): Several keys/credentials are in a managed .env file binded to the volume of the instance. That is all. We dont push every credential to the db and we wont be doing that either. Use the [official docker command](https://docs.anythingllm.com/installation-docker/quickstart) so you can have persistent storage and this wont happen on container reboot. > I don't understand why setting "STORAGE_DIR" still needs to store data, STORAGE_DIR is where documents, caches vectors, model downloads and ton of information live including the aforementioned env file. You cannot store these types of objects in a database
yindo changed title from [BUG]: Could not respond to message. No OpenAI API key was set. to [GH-ISSUE #4140] [BUG]: Could not respond to message. No OpenAI API key was set. 2026-06-05 14:47:38 -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#2633