[Bug]: Authentication Error, User not found, passed user_id=default_user_id
What happened?
Hi, I'm running the app with the docker-dompose which I updated a bit - changed the port of the app and also I created a .env file with the following:
LITELLM_MASTER_KEY="sk-123" LITELLM_SALT_KEY="sk-123"
The app loads up ok but once I try to log in with admin and master key I get: Authentication Error, User not found, passed user_id=default_user_id
I've tried also running the postman /user/list and found nothing.
Relevant log output
Are you a ML Ops Team?
No
What LiteLLM version are you on ?
latest
Twitter / LinkedIn details
No response
Same here! I've set the keys correctly in the .env file and can verify they are loaded using "docker-compose exec litellm env | grep MASTER_KEY". Still I keep getting "{"error":{"message":"Invalid credentials used to access UI.\nCheck 'UI_USERNAME', 'UI_PASSWORD' in .env file","type":"auth_error","param":"invalid_credentials","code":"401"}}"
Getting the same here...
Same here. When you check the container it also says unhealthy but cannot fix.
Same here. I had to go back to a previous nightly build.
Same for me. Followed Networkchuck instructions in this video https://www.youtube.com/watch?v=nQCOTzS5oU0
Same here. I had to go back to a previous nightly build.
which one works for you?
Guys,
I found that using the latest stable tag worked well. I used Portainer to deleted any storage, images, containers related to LiteLLM and then re cloned the repo and targeted the stable tag. Compose Up and it's running smoothly.
Having the same issue. Last Stable tagged build (litellm_stable_release_branch-v1.61.3-stable) did not work. I have also tried. main-v1.63.7-nightly main-stable
This worked for me (I use litellm:v1.63.8-stable as stated in the litellm/docker-compose.yml): Problem is the admin user not being correctly setup. Make sure your .env file contains the following (please set your own keys):
LITELLM_MASTER_KEY="sk-1234"
LITELLM_SALT_KEY="your_random_salt_key"
UI_USERNAME=admin
UI_PASSWORD=sk-1234
PROXY_ADMIN_ID=admin
Make sure to restart LiteLLM with:
docker-compose down
docker-compose up -d
Then create the admin user manually with the following (don't forget to replace sk-1234, [email protected], admin below with your own):
curl --location 'http://localhost:4000/user/new' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data-raw '{"user_email": "[email protected]", "user_id": "admin"}'
I was able to login with my user and password as set in the .env file (i.e., admin and sk-1234 above).
You can change details for your admin user via "Internal Users" on the UI.
Special thanks to NetworkChuck
This worked for me (I use litellm:v1.63.8-stable as stated in the litellm/docker-compose.yml): Problem is the admin user not being correctly setup. Make sure your .env file contains the following (please set your own keys):
LITELLM_MASTER_KEY="sk-1234"LITELLM_SALT_KEY="your_random_salt_key"UI_USERNAME=adminUI_PASSWORD=sk-1234PROXY_ADMIN_ID=adminMake sure to restart LiteLLM with:
docker-compose downdocker-compose up -dThen create the admin user manually with the following (don't forget to replace
sk-1234,[email protected],adminbelow with your own):
curl --location 'http://localhost:4000/user/new' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data-raw '{"user_email": "[email protected]", "user_id": "admin"}'I was able to login with my user and password as set in the .env file (i.e.,
adminandsk-1234above). You can change details for your admin user via "Internal Users" on the UI.Special thanks to NetworkChuck
Or just use a previous build which works well until this bug is solved
I used ghcr.io/berriai/litellm-database:main-v1.63.6-nightly in the docker-compose file which worked for me.
Having the same issue. Last Stable tagged build (litellm_stable_release_branch-v1.61.3-stable) did not work. I have also tried. main-v1.63.7-nightly main-stable
I used ghcr.io/berriai/litellm-database:main-v1.63.6-nightly in the docker-compose file which worked for me.
curl --location 'http://localhost:4000/user/new' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data-raw '{"user_email": "[email protected]", "user_id": "admin"}'
This was the only solution that made it work for me!
I downloaded the previous nights release. At first it resulted in the same error. I then cleared everything out relating to litellm then did a compose and this time the previous nights release I'd downloaded worked fine.
On Sat, 15 Mar 2025, 03:21 thadius83, @.***> wrote:
Having the same issue. Last Stable tagged build (litellm_stable_release_branch-v1.61.3-stable) did not work. I have also tried. main-v1.63.7-nightly main-stable
I used ghcr.io/berriai/litellm-database:main-v1.63.6-nightly in the docker-compose file which worked for me.
— Reply to this email directly, view it on GitHub https://github.com/BerriAI/litellm/issues/9243#issuecomment-2726168223, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATM5F2775OINHTE64EFY4F32UOMCPAVCNFSM6AAAAABZASX3ICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRWGE3DQMRSGM . You are receiving this because you commented.Message ID: @.***> [image: thadius83]thadius83 left a comment (BerriAI/litellm#9243) https://github.com/BerriAI/litellm/issues/9243#issuecomment-2726168223
Having the same issue. Last Stable tagged build (litellm_stable_release_branch-v1.61.3-stable) did not work. I have also tried. main-v1.63.7-nightly main-stable
I used ghcr.io/berriai/litellm-database:main-v1.63.6-nightly in the docker-compose file which worked for me.
— Reply to this email directly, view it on GitHub https://github.com/BerriAI/litellm/issues/9243#issuecomment-2726168223, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATM5F2775OINHTE64EFY4F32UOMCPAVCNFSM6AAAAABZASX3ICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRWGE3DQMRSGM . You are receiving this because you commented.Message ID: @.***>
This worked for me (I use litellm:v1.63.8-stable as stated in the litellm/docker-compose.yml): Problem is the admin user not being correctly setup. Make sure your .env file contains the following (please set your own keys):
LITELLM_MASTER_KEY="sk-1234"LITELLM_SALT_KEY="your_random_salt_key"UI_USERNAME=adminUI_PASSWORD=sk-1234PROXY_ADMIN_ID=adminMake sure to restart LiteLLM with:
docker-compose downdocker-compose up -dThen create the admin user manually with the following (don't forget to replace
sk-1234,[email protected],adminbelow with your own):
curl --location 'http://localhost:4000/user/new' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data-raw '{"user_email": "[email protected]", "user_id": "admin"}'I was able to login with my user and password as set in the .env file (i.e.,
adminandsk-1234above). You can change details for your admin user via "Internal Users" on the UI.Special thanks to NetworkChuck
thank you so much, I was stuck on it for hours
Update: LiteLLM Authentication Issue Resolved Good news! I've successfully resolved the authentication issues and can now login to the LiteLLM UI. Here's what worked:
Solution Summary Used the specific image: ghcr.io/berriai/litellm-database:main-v1.63.6-nightly in docker-compose.yml Kept working on the stable-1.63.2 branch Updated the .env file with proper configuration Created the admin user manually via curl Signed in with username "admin" and password "sk-1234" (the UI_PASSWORD value)
Detailed Steps Updated docker-compose.yml image: ghcr.io/berriai/litellm-database:main-v1.63.6-nightly
Updated .env file LITELLM_MASTER_KEY="sk-1234" (edited) LITELLM_SALT_KEY="your_random_salt_key" (edited) UI_USERNAME=admin UI_PASSWORD=sk-1234 (edited) PROXY_ADMIN_ID=admin
Created admin user manually
curl --location 'http://localhost:4000/user/new'
--header 'Authorization: Bearer sk-1234'
--header 'Content-Type: application/json'
--data-raw '{"user_email": "[email protected]", "user_id": "admin"}'
Key Learnings The default setup doesn't automatically create the admin user The PROXY_ADMIN_ID environment variable was essential Using the nightly build of the database image was necessary for stability I needed to use the UI_PASSWORD value for login, not the LITELLM_MASTER_KEY
I found we're having this error (https://github.com/Build5Nines/azd-litellm/issues/2) when deploying the latest release of LiteLLM, and we're using the litellm pip package for deployment. It seems for now, instead of pulling down the latest release, I need to explicitly specify version 1.63.8 and it all works fine. This seems to be the most recent version from before this bug was introduced.
Workaround: execute /user/new endpoint mentioned in swagger
- Add your master_key in the padlock (on the right side)
- Run API with following body
{
"user_id": "default_user_id",
"user_role": "proxy_admin",
"send_invite_email": false
}
Now you will be able to login.
Here is curl command:
curl -X 'POST' \
'http://litelm:4000/user/new' \
-H 'accept: application/json' \
-H 'Ocp-Apim-Subscription-Key: sk-MjW3!7Mfr8Mgamu&' \
-H 'Content-Type: application/json' \
-d '{
"user_id": "default_user_id",
"user_role": "proxy_admin",
"send_invite_email": false
}'
Is this fixed in 1.63.11 ? I wanted to setup my Ollama + LiteLLM server at hostinger after I've watched networkchuks video on youtube.