livekit-cli icon indicating copy to clipboard operation
livekit-cli copied to clipboard

Unable to authenticate in Livekit 401 "Unauthorized"

Open angel007sya opened this issue 1 year ago • 8 comments

  • Logged correctly with lk cloud auth
  • Python agent neither does work, same error 401 using correct API keys
lk sip outbound create outbound-trunk.json
WARNING: config file C:\Users\langd/.livekit/cli-config.yaml should have permissions 600
Using default project [agent]
twirp error unauthenticated: Error from intermediary with HTTP status code 401 "Unauthorized"

angel007sya avatar Jun 03 '25 20:06 angel007sya

Thanks for the report. We're aware of some Windows-specific network errors that might be responsible for this. If possible can you confirm that the issue is not present on other OS with your same setup/project?

rektdeckard avatar Jun 03 '25 20:06 rektdeckard

Thanks for the report. We're aware of some Windows-specific network errors that might be responsible for this. If possible can you confirm that the issue is not present on other OS with your same setup/project?

Yes I am on Windows 11. But on other computer same OS, different account (logged with gmail too) did not have this problem

I will try tomorrow to log in using WSL

angel007sya avatar Jun 03 '25 20:06 angel007sya

@rektdeckard

Same account using WSL same error. Different account on WSL same error 401.

Is there any hotfix that I can try?

angel007sya avatar Jun 04 '25 20:06 angel007sya

Using VirtualBox Windows machine same problem

angel007sya avatar Jun 04 '25 20:06 angel007sya

This error is crucial for us. We need to build our agent as soon as possible and are considering other providers. Even a workaround would be acceptable. Thank you in advance.

angel007sya avatar Jun 04 '25 20:06 angel007sya

I am going to try tonight using private ubuntu server in the cloud

angel007sya avatar Jun 05 '25 06:06 angel007sya

Windows isn't working for me. WSL didn't work either. I installed Ubuntu dual boot, and it's working fine.

anlagbr avatar Jun 30 '25 06:06 anlagbr

We're not quite sure of root causes here, but have noticed auth errors resulting from a disagreement in system time. Some people have had luck toggling NTP on their OS, or otherwise resetting the system clock. I personally use pool.ntp.org over apple's default time server and have not been able to reproduce the issue.

Another thing to try is deleting the credentials from the CLI and reauthenticating:

  • lk project remove <project_name>
  • Visit the API keys page and remove the key associated with your device
  • lk cloud auth again

rektdeckard avatar Jul 17 '25 19:07 rektdeckard