I'm Facing challenge on Login to litellm admin Portal
{ "error": { "message": "Authentication Error, User not found, passed user_id=default_user_id", "type": "auth_error", "param": "None", "code": "400" } }
Iam facing this wherever i want to login to litellm on docker from my hostinger vps
Me2, when I change my password or Username I get an 401. User or Password not found :/
Me2, when I change my password or Username I get an 401. User or Password not found :/
how to solve it? I have tried to search tutorials that talks about that solution and i couldnt find one
can you try https://github.com/BerriAI/litellm/releases/tag/v1.63.7-nightly
Having the same issue. Container shows as unhealthy and the last output is
OCI runtime exec failed: exec failed: unable to start container process: exec: "curl": executable file not found in $PATH: unknown
Also I used v1.63.7-nightly.
Having the same issue. Container shows as unhealthy and the last output is
OCI runtime exec failed: exec failed: unable to start container process: exec: "curl": executable file not found in $PATH: unknown
Also I used v1.63.7-nightly.
Oh, You used v1.63.7 and still failed?
For those having issues trying to follow NetworkChucks install guide
I recommend the following
re-install your ollama image
set your ollama password
create a snapshot
use the following git command: git clone --branch v1.63.6-nightly --single-branch https://github.com/BerriAI/litellm.git
once done change to that directory and create the .env file make note of your LITELLM_MASTER_KEY entry
once that is done you should be able to hit it with
can you try https://github.com/BerriAI/litellm/releases/tag/v1.63.7-nightly
I used ghcr.io/berriai/litellm-database:main-v1.63.6-nightly in the docker-compose file which worked for me.
can you try https://github.com/BerriAI/litellm/releases/tag/v1.63.7-nightly
I used ghcr.io/berriai/litellm-database:main-v1.63.6-nightly in the docker-compose file which worked for me.
oh Thanks, Docker in VPs or Locally?
:4000
Thanks Master it worked
can you try https://github.com/BerriAI/litellm/releases/tag/v1.63.7-nightly
I used ghcr.io/berriai/litellm-database:main-v1.63.6-nightly in the docker-compose file which worked for me.
oh Thanks, Docker in VPs or Locally?
I cloned the active repo.
Then modified the docker-compose file to point to that image version instead of main:latest.
Worked first time after spending a bunch of time with the default user id unknown error -_-
I changed the image for the one you recommend and I still have the same error when I try to log in to the admin it keeps giving me error this is the error message when making the request
"error": { "message": "Authentication Error, User not found, passed user_id=default_user_id", "type": "auth_error", "param": "None", "code": "400" }
I changed the image for the one you recommend and I still have the same error when I try to log in to the admin it keeps giving me error this is the error message when making the request
"error": { "message": "Authentication Error, User not found, passed user_id=default_user_id", "type": "auth_error", "param": "None", "code": "400" }
Same
Thanks @Hyland83! That was breaking my heart last night. Working perfectly now.
I changed the image for the one you recommend and I still have the same error when I try to log in to the admin it keeps giving me error this is the error message when making the request "error": { "message": "Authentication Error, User not found, passed user_id=default_user_id", "type": "auth_error", "param": "None", "code": "400" }
Same
You’ll need to remove the previous docker volumes completely for it to work.
For those having issues trying to follow NetworkChucks install guide I recommend the following re-install your ollama image set your ollama password create a snapshot use the following git command: git clone --branch v1.63.6-nightly --single-branch https://github.com/BerriAI/litellm.git once done change to that directory and create the .env file make note of your LITELLM_MASTER_KEY entry once that is done you should be able to hit it with :4000 and use LITELLM_MASTER_KEY entry for the password and it should log in. If not you can use the snapshot to restore the image back to where you started and try again.
Done all of this and still get the same error (I'm getting a new server in a week and will try it on there with a fresh install and I will tell you how it goes)
Done all of this and still get the same error { "error": { "message": "Authentication Error, User not found, passed user_id=default_user_id", "type": "auth_error", "param": "None", "code": "400" } }
@Hyland83 Thanks for the solution. I followed the steps and it worked
@Hyland83 Thank you this worked.
For others that may have a bit more on your system and do not want to re-image you do not need too or you can save it for a hail mary. It seems the main issue is that Networks Chucks video has you pull down some files that may have issues. If you just remove the folder that was downloaded then you follow Hyland83s instructions starting at "use the following git command" after removing the old litellm folder you should be good to go!
I changed the image for the one you recommend and I still have the same error when I try to log in to the admin it keeps giving me error this is the error message when making the request "error": { "message": "Authentication Error, User not found, passed user_id=default_user_id", "type": "auth_error", "param": "None", "code": "400" }
Same
I tried this and it worked for me just make sure to replace localhost with your server IP, sk-1234 with your password, [email protected] with your own email and user_id with your user ID or leave it as admin:
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"}'
After that you can add: PROXY_ADMIN_ID=admin To your .env file
And make sure to restart LiteLLM with:
docker-compose down
docker-compose up -d
For those having issues trying to follow NetworkChucks install guide I recommend the following re-install your ollama image set your ollama password create a snapshot use the following git command: git clone --branch v1.63.6-nightly --single-branch https://github.com/BerriAI/litellm.git once done change to that directory and create the .env file make note of your LITELLM_MASTER_KEY entry once that is done you should be able to hit it with :4000 and use LITELLM_MASTER_KEY entry for the password and it should log in. If not you can use the snapshot to restore the image back to where you started and try again.
You da man! Had same error, so , In Hostinger, I blew out that OS, then restarted from scratch, and used the nightly instead... Thanks
still not working for me, I tried the different images and combinations of the username and password env vars .... does anyone have a fix? i'm running local on docker, following networkchuck's video
{
"error": {
"message": "Invalid credentials used to access UI.\nCheck 'UI_USERNAME', 'UI_PASSWORD' in .env file",
"type": "auth_error",
"param": "invalid_credentials",
"code": "401"
}
}
Work around while fix on its way:
curl -X POST "http://localhost:4000/user/new" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
"user_email": "[email protected]",
"user_role": "internal_user",
"user_alias": "new",
"send_invite_email": false
}'
psql -U llmproxy -h 127.0.0.1 -p 5432 litellm
(password dbpassword9090 if you haven't changed in docker-compose)
select * from "LiteLLM_UserTable";
...
UPDATE "LiteLLM_UserTable"
SET user_id = 'default_user_id'
WHERE user_id = '8d902e62-22ea-4f32-91e1-3fed9572e738'; -- take user_id from the previous select
now can login with admin and MASTER_KEY you've used for the setup
that worked for me !! thank you!
I just had the same issue, deployed it via Portainer on my existing VM and I could not login whatsoever.
I needed to call the API Endpoint http://0.0.0.0:4000/key/generate in order to create the db keys the containers needing.
After that API Call via Postman, my login via the .env entries UI_USERNAME & UI_PASSWORD, the login was working!
Hope this helps anyone!
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
}'
{ "user_id": "default_user_id", "user_role": "proxy_admin", "send_invite_email": false }
works perfectly!
I was having the same issue with main-stable for this morning. I was getting this exact error.
Two Tests, Stack in portainer in docker swarm would return the same error Locally on my laptop running the docker compose would return authentication error.
Fixed it locally on laptop by changing from main-stable to main-main-v1.63.6-nightly - No More Errors Fixed it in portainer as a stack by making the same change.
Might want to make it known stable is currently defective.
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 }'
Sub in localhost if building on your personal computer!
http://localhost:4000/user/new
This was definitely the ticket! Thank you!
Ironically, Grok3beta brought me here ;p I was going crazy thinking this couldnt possibly be a bug since I was just watching very-recently published YouTube videos on deploying LiteLLM and trying it myself, but here we are; it is a bug and I wasted a lot of my time re-checking my work for no reason.
I simply cloned from the main repo and I was having these issues as defined above:
{"error":{"message":"Authentication Error, User not found, passed user_id=default_user_id","type":"auth_error","param":"None","code":"400"}}
Grok helped me sort the issue out and then I told it I wanted to post my fix in-case it helps others, so here I am... I see that other valid solutions are already posted above, but I'd still like to post my solution and the comments from Grok just in case it helps anyone else:
Within your SSH or in your terminal:
docker exec -it litellm_db_1 psql -U llmproxy -d litellm
INSERT INTO "LiteLLM_UserTable" (user_id, spend, max_budget, user_role) VALUES ('default_user_id', 0.0, NULL, 'admin');
\q
docker compose restart litellm_litellm_1
From Grok3:
_Now, why’d you have to do that INSERT? Short version: Why It Failed: LiteLLM expects a user (default_user_id) in LiteLLM_UserTable for admin UI access, but the default deployment didn’t create it. Your DB was empty, causing the "User not found" error.
What’s Broken: The repo’s docker-compose.yml and docs assume the DB auto-seeds a default user, but it doesn’t. This is likely a repo bug or setup gap—others hit it too (e.g., issue #9264).
Not ENV: Your .env was fine (LITELLM_MASTER_KEY passed through). The issue was the missing user.
Fix Reason: Manually adding default_user_id with user_role='admin' mimics what the deployment should’ve done. The LiteLLM_VerificationToken ties the key to the user for auth. Repo should probably run a migration or seed script—until then, this is the workaround. Enjoy your UI!_
Thanks, All! Take care.
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 the above solution on discord