[GH-ISSUE #2877] [BUG]: Could not validate login (again) #1829

Closed
opened 2026-02-22 18:26:42 -05:00 by yindo · 12 comments
Owner

Originally created by @xoconoch on GitHub (Dec 18, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2877

How are you running AnythingLLM?

Docker (remote machine)

What happened?

So, this is a reappearance of a bug I had previously reported and somehow fixed, to cut to the chase, it happened again after updating my instance to 1.7.1 and the steps that had previously fixed it didn't work this time.

Are there known steps to reproduce?

  1. Have a CasaOS instance
  2. Install AnythingLLM latest release from the CasaOS App Store
  3. On the main menu, change the "Tag" setting of the AnythingLLM app to stable (which is set to latest, so nothing will really change, this is only to trigger a re-composing of the docker container).
  4. Click "Save" and wait for it to finish re-composing
  5. Once it's done, valid credentials submitted in the login form will trigger the error Could not validate login.

I think it is good to note that invalid credentials are indeed detected. Once the error starts appearing, if I try submitting credentials that were not previously created this message appears: Error: [001] Invalid login credentials.

Originally created by @xoconoch on GitHub (Dec 18, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2877 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? So, this is a reappearance of a bug I had previously reported and somehow [fixed](https://github.com/Mintplex-Labs/anything-llm/issues/2814#issuecomment-2540265856), to cut to the chase, it happened again after updating my instance to 1.7.1 and the steps that had previously fixed it didn't work this time. ### Are there known steps to reproduce? 0. Have a CasaOS instance 1. Install AnythingLLM latest release from the CasaOS App Store 2. On the main menu, change the "Tag" setting of the AnythingLLM app to stable (which is set to latest, so nothing will really change, this is only to trigger a re-composing of the docker container). 3. Click "Save" and wait for it to finish re-composing 4. Once it's done, valid credentials submitted in the login form will trigger the error `Could not validate login.` I think it is good to note that invalid credentials are indeed detected. Once the error starts appearing, if I try submitting credentials that were not previously created this message appears: `Error: [001] Invalid login credentials.`
yindo added the possible bug label 2026-02-22 18:26:42 -05:00
yindo closed this issue 2026-02-22 18:26:42 -05:00
Author
Owner

@timothycarambat commented on GitHub (Dec 20, 2024):

This is not a config issue, it is for certain how the program is being set up and installed. Distribution via the Casa OS store is not an officially support distribution, so we cannot support it (more than we have in that previous thread).

In general, what is happening is that something in your persistent storage (.env, anythingllm.db, etc) is being wiped between restarts instead of persisting. This is likely leading to the JWT_SECRET being rotated between restarts, thus credentials being invalidated.

I dont have CasaOS, nor a way to test, so debugging if difficult.

Our official docker 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

These two lines are critical to maintain persistence between restarts

-v ${STORAGE_LOCATION}:/app/server/storage \
-v ${STORAGE_LOCATION}/.env:/app/server/.env \

So that is the root cause. How to fix that in the app store listing, I have no idea, as we do not maintain it or are the creators.

@timothycarambat commented on GitHub (Dec 20, 2024): This is not a config issue, it is for certain how the program is being set up and installed. Distribution via the Casa OS store is not an officially support distribution, so we cannot support it (more than we have in that previous thread). In general, what is happening is that something in your persistent storage (.env, anythingllm.db, etc) is being wiped between restarts instead of persisting. This is likely leading to the JWT_SECRET being rotated between restarts, thus credentials being invalidated. I dont have CasaOS, nor a way to test, so debugging if difficult. Our official docker 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 ``` These two lines are critical to maintain persistence between restarts ``` -v ${STORAGE_LOCATION}:/app/server/storage \ -v ${STORAGE_LOCATION}/.env:/app/server/.env \ ``` So that is the root cause. How to fix that in the app store listing, I have no idea, as we do not maintain it or are the creators.
Author
Owner

@RobDiek commented on GitHub (Jan 22, 2025):

Getting the same error. Not able to login on CasaOS NOR on "Easypanel.io". Im sorry for asking this but cant you somehow just remove that the line is mandatory? I think this might be some CSRF thing which is interfering here?

I now "killed" two instances of AnythingLLM because it cant survive a stupid container restart.

I know, I know, its not your responsibility to fix other peoples issue - but maybe just make the issue so easy to appear.

Error log is regarding jwt token
[backend] info: [TELEMETRY SENT] {"event":"login_event","distinctId":"aa2f341f-ed29-4537-84a3-5605f347cd1c::1","properties":{"multiUserMode":false,"runtime":"docker"}}
[backend] info: [Event Logged] - login_event
[backend] error: Cannot create JWT as JWT_SECRET is unset. Error: Cannot create JWT as JWT_SECRET is unset.
at makeJWT (/app/server/utils/http/index.js:21:11)
at /app/server/endpoints/system.js:210:18

Thanks

@RobDiek commented on GitHub (Jan 22, 2025): Getting the same error. Not able to login on CasaOS NOR on "Easypanel.io". Im sorry for asking this but cant you somehow just remove that the line is mandatory? I think this might be some CSRF thing which is interfering here? I now "killed" two instances of AnythingLLM because it cant survive a stupid container restart. I know, I know, its not your responsibility to fix other peoples issue - but maybe just make the issue so easy to appear. Error log is regarding jwt token [backend] info: [TELEMETRY SENT] {"event":"login_event","distinctId":"aa2f341f-ed29-4537-84a3-5605f347cd1c::1","properties":{"multiUserMode":false,"runtime":"docker"}} [backend] info: [Event Logged] - login_event [backend] error: Cannot create JWT as JWT_SECRET is unset. Error: Cannot create JWT as JWT_SECRET is unset. at makeJWT (/app/server/utils/http/index.js:21:11) at /app/server/endpoints/system.js:210:18 Thanks
Author
Owner

@timothycarambat commented on GitHub (Jan 22, 2025):

[backend] error: Cannot create JWT as JWT_SECRET is unset. Error: Cannot create JWT as JWT_SECRET is unset.

This is because the binded .env is not persisting between container restarts - that is what needs to be fixed in the CasaOs docker config or however casa works. We are not going to work around it because it's not the way the image should be run.

If we can't make JWT tokens we can't support multi-user or worse, we skip this check and now on container restart your password hash cannot be validated because the previous token used during hashing rotated. Resulting in even more random GitHub issues.

I don't know who built the config for this integration, but it is wrong - this is an adjusted config that should work

name: anythingllm
services:
  anythingllm:
    cap_add:
      - SYS_ADMIN
    container_name: anythingllm
    extra_hosts:
      - host.docker.internal:host-gateway
    image: mintplexlabs/anythingllm
    labels:
      icon: https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/AnythingLLM/icon.png
    ports:
      - target: 3001
        published: "3051"
        protocol: tcp
    restart: always
    volumes:
      - type: bind
        source: /DATA/AppData/anythingllm/storage
        target: /app/server/storage

     # Add binding to the ENV in storage to app/server/.env
      - type: bind
        source: /DATA/AppData/anythingllm/storage/.env
        target: /app/server/.env
    devices: []
    command: []
    environment: []
    networks:
      - default
    privileged: false
    hostname: anythingllm
    cpu_shares: 90
    deploy:
      resources:
        limits:
          memory: 7825M
networks:
  default:
    name: anythingllm_default
x-casaos:
  architectures:
    - amd64
  category: Chat
  description:
    en_uk: AnythingLLM is the easiest to use, all-in-one AI application that can do
      RAG, AI Agents, and much more with no code or infrastructure headaches.
    en_us: AnythingLLM is the easiest to use, all-in-one AI application that can do
      RAG, AI Agents, and much more with no code or infrastructure headaches.
    ja_jp: AnythingLLM は、コードやインフラストラクチャの問題を気にすることなく、RAG、AI エージェントなどを行う最も使いやすいオールインワン
      AI アプリケーションです。
    zh_cn: AnythingLLM 是最易于使用的一体化 AI 应用程序,可以使用 RAG、AI 代理等功能,无需代码或基础设施麻烦。
  developer: Mintplex Labs
  icon: https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/AnythingLLM/icon.png
  index: /
  is_uncontrolled: false
  main: anythingllm
  port_map: "3051"
  scheme: http
  screenshot_link:
    - https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/AnythingLLM/screenshot-1.gif
  store_app_id: anythingllm
  tagline:
    en_uk: The all-in-one AI application.
    en_us: The all-in-one AI application.
    ja_jp: オールインワン AI アプリケーション。
    zh_cn: 一体化 AI 应用程序。
  tips:
    before_install:
      en_uk: >
        **Usage Tips**

        AnythingLLM supports but does not directly provide various LLMs backends, you need to configure the backends you need yourself.

        Please refer to the [official documentation](https://docs.anythingllm.com) for more information.
      en_us: >
        **Usage Tips**

        AnythingLLM supports but does not directly provide various LLMs backends, you need to configure the backends you need yourself.

        Please refer to the [official documentation](https://docs.anythingllm.com) for more information.
      ja_jp: |
        **使用上のヒント**
        AnythingLLM は、さまざまな LLMs バックエンドをサポートしていますが、必要なバックエンドを自分で構成する必要があります。
        詳細については、[公式ドキュメント](https://docs.anythingllm.com)を参照してください。
      zh_cn: |
        **使用提示**
        AnythingLLM 支持但不直接提供各种LLMs后端,您需要自行配置需要的后端。
        请参考[官方文档](https://docs.anythingllm.com)以获取更多信息。
  title:
    en_uk: AnythingLLM
    en_us: AnythingLLM
    ja_jp: AnythingLLM
    zh_cn: AnythingLLM
    custom: ""
  hostname: ""
  author: self

How I can publish that to their store - I have no idea, but that fix above is all that is needed.

I see I can fork their app repo and update it, but I dont have a casaOS machine on hand - I would have to set that up first so I can make sure that change works - in general, that is all that is missing

@timothycarambat commented on GitHub (Jan 22, 2025): > [backend] error: Cannot create JWT as JWT_SECRET is unset. Error: Cannot create JWT as JWT_SECRET is unset. This is because the binded `.env` is not persisting between container restarts - that is what needs to be fixed in the CasaOs docker config or however casa works. We are not going to work around it because it's not the way the image should be run. If we can't make JWT tokens we can't support multi-user or worse, we skip this check and now on container restart your password hash cannot be validated because the previous token used during hashing rotated. Resulting in _even more_ random GitHub issues. I don't know who built the config for this integration, but it is wrong - this is an adjusted config that should work ```yaml name: anythingllm services: anythingllm: cap_add: - SYS_ADMIN container_name: anythingllm extra_hosts: - host.docker.internal:host-gateway image: mintplexlabs/anythingllm labels: icon: https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/AnythingLLM/icon.png ports: - target: 3001 published: "3051" protocol: tcp restart: always volumes: - type: bind source: /DATA/AppData/anythingllm/storage target: /app/server/storage # Add binding to the ENV in storage to app/server/.env - type: bind source: /DATA/AppData/anythingllm/storage/.env target: /app/server/.env devices: [] command: [] environment: [] networks: - default privileged: false hostname: anythingllm cpu_shares: 90 deploy: resources: limits: memory: 7825M networks: default: name: anythingllm_default x-casaos: architectures: - amd64 category: Chat description: en_uk: AnythingLLM is the easiest to use, all-in-one AI application that can do RAG, AI Agents, and much more with no code or infrastructure headaches. en_us: AnythingLLM is the easiest to use, all-in-one AI application that can do RAG, AI Agents, and much more with no code or infrastructure headaches. ja_jp: AnythingLLM は、コードやインフラストラクチャの問題を気にすることなく、RAG、AI エージェントなどを行う最も使いやすいオールインワン AI アプリケーションです。 zh_cn: AnythingLLM 是最易于使用的一体化 AI 应用程序,可以使用 RAG、AI 代理等功能,无需代码或基础设施麻烦。 developer: Mintplex Labs icon: https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/AnythingLLM/icon.png index: / is_uncontrolled: false main: anythingllm port_map: "3051" scheme: http screenshot_link: - https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/AnythingLLM/screenshot-1.gif store_app_id: anythingllm tagline: en_uk: The all-in-one AI application. en_us: The all-in-one AI application. ja_jp: オールインワン AI アプリケーション。 zh_cn: 一体化 AI 应用程序。 tips: before_install: en_uk: > **Usage Tips** AnythingLLM supports but does not directly provide various LLMs backends, you need to configure the backends you need yourself. Please refer to the [official documentation](https://docs.anythingllm.com) for more information. en_us: > **Usage Tips** AnythingLLM supports but does not directly provide various LLMs backends, you need to configure the backends you need yourself. Please refer to the [official documentation](https://docs.anythingllm.com) for more information. ja_jp: | **使用上のヒント** AnythingLLM は、さまざまな LLMs バックエンドをサポートしていますが、必要なバックエンドを自分で構成する必要があります。 詳細については、[公式ドキュメント](https://docs.anythingllm.com)を参照してください。 zh_cn: | **使用提示** AnythingLLM 支持但不直接提供各种LLMs后端,您需要自行配置需要的后端。 请参考[官方文档](https://docs.anythingllm.com)以获取更多信息。 title: en_uk: AnythingLLM en_us: AnythingLLM ja_jp: AnythingLLM zh_cn: AnythingLLM custom: "" hostname: "" author: self ``` ~~How I can publish that to their store - I have no idea, but that fix above is all that is needed.~~ I see I can fork their app repo and update it, but I dont have a casaOS machine on hand - I would have to set that up first so I can make sure that change works - in general, that is all that is missing
Author
Owner

@xoconoch commented on GitHub (Jan 22, 2025):

Hey, now that Timothy kindly provided this docker-compose file you could just import it as a custom installation and it should be the exact same experience as if you were to download it from the app store (except that it is now functionnal, duh). I also Before this, I worked around the error by setting up relevant environment variables directly into the docker-compose.yaml or through CasaOS interface as shown in the image (I sincerely apologize for profaning mintplex's work like that, but I really needed it to work with casa)

Image

@xoconoch commented on GitHub (Jan 22, 2025): Hey, now that Timothy kindly provided this docker-compose file you could just import it as a custom installation and it should be the exact same experience as if you were to download it from the app store (except that it is now functionnal, duh). ~~I also~~ Before this, I worked around the error by setting up relevant environment variables directly into the docker-compose.yaml or through CasaOS interface as shown in the image (I sincerely apologize for profaning mintplex's work like that, but I really needed it to work with casa) ![Image](https://github.com/user-attachments/assets/e7a8ca08-e2cd-46e9-a0fb-e2997221a227)
Author
Owner

@furkanyolal commented on GitHub (Jan 22, 2025):

hi there, i was having the same issue and even i have installed anythingllm with official docker commands it grays out after i try to enter something to chat. you can check out the screenshots below, could any of you guys check it out? ill be appreciated.
ps. i have entered my gemini api key from settings and selected gemini-1.5-flash-latest

Image

after pressing "enter" key,

Image

@furkanyolal commented on GitHub (Jan 22, 2025): hi there, i was having the same issue and even i have installed anythingllm with official docker commands it grays out after i try to enter something to chat. you can check out the screenshots below, could any of you guys check it out? ill be appreciated. ps. i have entered my gemini api key from settings and selected gemini-1.5-flash-latest ![Image](https://github.com/user-attachments/assets/74d6d7df-b712-4830-b9ef-e4a121ea4e47) after pressing "enter" key, ![Image](https://github.com/user-attachments/assets/0d69ce95-85b8-4546-a060-6111a8b6007f)
Author
Owner

@timothycarambat commented on GitHub (Jan 23, 2025):

@furknyolal Are you able to open browser console? Seems like a frontend error here - which is probably occurring due to something related to the backend/config of this issue.

Do you know of a way to run CasaOS easily? That would help me finally put this niche bug to rest so everyone can use it out of the box as intended.

@timothycarambat commented on GitHub (Jan 23, 2025): @furknyolal Are you able to open browser console? Seems like a frontend error here - which is probably occurring due to something related to the backend/config of this issue. Do you know of a way to run CasaOS easily? That would help me finally put this niche bug to rest so everyone can use it out of the box as intended.
Author
Owner

@xoconoch commented on GitHub (Jan 23, 2025):

CasaOS is not any distro or “real” OS, it is basically a docker compose frontend. You could setup a Debian VM and install it as stated in their docs (it is pretty straight forward with their install script). Or, if you’re willing to, I could temporarily give you access to my Casa system, I am on the mintplex discord by the same name as here.

@xoconoch commented on GitHub (Jan 23, 2025): CasaOS is not any distro or “real” OS, it is basically a docker compose frontend. You could setup a Debian VM and install it as stated in their docs (it is pretty straight forward with their install script). Or, if you’re willing to, I could temporarily give you access to my Casa system, I am on the mintplex discord by the same name as here.
Author
Owner

@timothycarambat commented on GitHub (Jan 23, 2025):

You could setup a Debian VM and install it as stated in their docs

I can do this pretty trivially then, Ill have to make some time to get it going, but sounds pretty simple reading their docs

@timothycarambat commented on GitHub (Jan 23, 2025): > You could setup a Debian VM and install it as stated in their docs I can do this pretty trivially then, Ill have to make some time to get it going, but sounds pretty simple reading their docs
Author
Owner

@furkanyolal commented on GitHub (Jan 23, 2025):

@furknyolal Are you able to open browser console? Seems like a frontend error here - which is probably occurring due to something related to the backend/config of this issue.

Do you know of a way to run CasaOS easily? That would help me finally put this niche bug to rest so everyone can use it out of the box as intended.

It is actually a browser console, it seems it is not cause i take a screenshot by cropping the chrome navigation bar. I can give you the CasaOS config and logs of mine if it would be helpful or can give a temporary access to my cloud VDS which is CasaOS and anythingllm installed in it.

@furkanyolal commented on GitHub (Jan 23, 2025): > [@furknyolal](https://github.com/furknyolal) Are you able to open browser console? Seems like a frontend error here - which is probably occurring due to something related to the backend/config of this issue. > > Do you know of a way to run CasaOS easily? That would help me finally put this niche bug to rest so everyone can use it out of the box as intended. It is actually a browser console, it seems it is not cause i take a screenshot by cropping the chrome navigation bar. I can give you the CasaOS config and logs of mine if it would be helpful or can give a temporary access to my cloud VDS which is CasaOS and anythingllm installed in it.
Author
Owner

@timothycarambat commented on GitHub (Jan 23, 2025):

@furknyolal Turns out that frontend issue was my fault from a merge yesterday - nothing to do with Casa

Patched via https://github.com/Mintplex-Labs/anything-llm/commit/9584a7e1400a2ac581631f1901281c29c15224ba
Build status: https://github.com/Mintplex-Labs/anything-llm/actions/runs/12937628980/job/36085959888

When that is complete - repull the image and this will be resolved

@timothycarambat commented on GitHub (Jan 23, 2025): @furknyolal Turns out that frontend issue was my fault from a merge yesterday - nothing to do with Casa Patched via https://github.com/Mintplex-Labs/anything-llm/commit/9584a7e1400a2ac581631f1901281c29c15224ba Build status: https://github.com/Mintplex-Labs/anything-llm/actions/runs/12937628980/job/36085959888 When that is complete - repull the image and this will be resolved
Author
Owner

@furkanyolal commented on GitHub (Jan 23, 2025):

@furknyolal Turns out that frontend issue was my fault from a merge yesterday - nothing to do with Casa

Patched via 9584a7e Build status: https://github.com/Mintplex-Labs/anything-llm/actions/runs/12937628980/job/36085959888

When that is complete - repull the image and this will be resolved

Oh, i wasnt expected this kind of thing. It felt like it does relate with CasaOS. Anyways, thanks for your help on this issue. I'm gonna wait for build and inform you about whether issue is resolved or not.

@furkanyolal commented on GitHub (Jan 23, 2025): > [@furknyolal](https://github.com/furknyolal) Turns out that frontend issue was my fault from a merge yesterday - nothing to do with Casa > > Patched via [9584a7e](https://github.com/Mintplex-Labs/anything-llm/commit/9584a7e1400a2ac581631f1901281c29c15224ba) Build status: https://github.com/Mintplex-Labs/anything-llm/actions/runs/12937628980/job/36085959888 > > When that is complete - repull the image and this will be resolved Oh, i wasnt expected this kind of thing. It felt like it does relate with CasaOS. Anyways, thanks for your help on this issue. I'm gonna wait for build and inform you about whether issue is resolved or not.
Author
Owner

@furkanyolal commented on GitHub (Jan 23, 2025):

Ok, it is working without any problem right now. Thanks again @timothycarambat

@furkanyolal commented on GitHub (Jan 23, 2025): Ok, it is working without any problem right now. Thanks again @timothycarambat
yindo changed title from [BUG]: Could not validate login (again) to [GH-ISSUE #2877] [BUG]: Could not validate login (again) 2026-06-05 14:42:56 -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#1829