Hey Guys, my agent works perfectly on the console ...
# agents
w
Hey Guys, my agent works perfectly on the console but when I try to run it in dev mode i get a 401 error, I even asked the livekit ai and it couldn’t help me, has anyone got this ?
s
A 401 error suggests you are using invalid LiveKit credentials. Check your
LIVEKIT_
api key / secret / url to make sure they're accurate.
w
I did, everything is actually accurate, I set them up using the lk app env -w and I still have the same error, I even tried to create a dispatch rule and I got this error : twirp error unauthenticated: Error from intermediary with HTTP status code 401 "
s
If the API keys were subsequently deleted, it is possible the credentials saved in the CLI are out of date. I would recommend removing the credentials and reauthenticating CLI:
Copy code
lk project remove <my-project> && lk cloud auth
w
I just did this, I created another project in the web page, put the environment variables in the .env file and authentificated again with lk cloud auth, all of it after removing the previous project and it is still not working. But I noticed something in the error message it looks like Livekit is adding a /agent to my URL which is not in the env. I added it to the URL in my env and it is still not working
But the console is working fine
s
What CLI version are you using?
console
does not connect to LiveKit servers, it uses your device's microphone only
w
Version 2.5.5
s
Are the keys in your
.env
file present on the dashboard if you visit https://cloud.livekit.io/projects/p_/settings/keys ? Are you loading the correct environment file with
dotenv
?
w
Yep I even copied them from the dashboard and put them in my .env file
I don’t know if it’s a problem with windows but that’s the first time I ever get a problem like this
r
Check your system clock
s
Ah yeah, windows NTP has been an issue in the past, still don't know the exact cause. I would toggle it and try again, maybe try a different NTP server
w
Right now I took another account that I created a year ago and tried to run the agent after coding it, ran it in dev mode I still have the same errors
r
Check your system clock, timezone etc.