This message was deleted.
# agents
s
This message was deleted.
b
That was a mouthful, but any support would be appreciated @refined-appointment-81829. We want to get the reliability up, we had less issues when using Vapi/Dailyco.
f
same happening with my token server. Unable to get token.It returns 401 unauthorized
r
Are you connecting to cloud? 401 is due to invalid credentials or potentially your system clock is not correct.
The audio filter issue maybe because you are not connecting to LiveKit cloud and trying to use self hosted instead. That is not supported in self hosted.
f
@refined-appointment-81829 but initially it was not working and then it started working. and again failing. Please help
b
@refined-appointment-81829 we are using LiveKit Cloud, again this is intermittent and not consistent across all sessions, ie not an issue in our code. We are using Render to host our server. I haven't seen these issues before today. Can you check if there's any issue on your end today?
We are setting JSON as metadata on the participant, is there a max size on that field?
r
You say you are using LiveKit cloud then you say you are hosting the server on Redner.
Which is it?
f
My token server is on render
b
we are using LiveKit cloud, but agent is hosted on Render
f
my agent is on livekit cloud
b
r
hard to read screen shots of errors.
What problem are you having?
f
@refined-appointment-81829 my token server is on render. When its trying to get the fetch the token using python server sdk, its returning 401 initially several times. And then after some time it's working. And again some issue after some time. My agent is deployed on livekit cloud. But the token server is hosted on render.
r
Is it possible the clock is not correct on the render server?
Does the client get the 401 or the agent?
f
I m closing the lk api client
client gets 401
r
Check the token server clock, and the api key and secret.
b
last 14 days we only had 3 401s, all today. Was there an outage at this time?
r
no
I can see what that screen shot says. Why not copy paste text?
b
Copy code
{"message": "received job request", "level": "INFO", "name": "livekit.agents", "job_id": "AJ_Pn3iCEdqGRDj", "dispatch_id": "", "room_name": "talktime_Princess Pia_9680", "agent_name": "", "resuming": false, "timestamp": "2025-09-02T14:43:41.613719+00:00"}
{"message": "connecting to room talktime_Princess Pia_9680", "level": "INFO", "name": "realtime-with-tts", "pid": 8286, "job_id": "AJ_Pn3iCEdqGRDj", "timestamp": "2025-09-02T14:43:41.656328+00:00"}
{"message": "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 8562, "timestamp": "2025-09-02T14:43:41.748923+00:00"}
{"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 8562, "elapsed_time": 0.26, "timestamp": "2025-09-02T14:43:42.013228+00:00"}
error: failed to fetch server settings: http status: 401
{"message": "livekit_ffi::server::room:149:livekit_ffi::server::room - audio filter cannot be enabled: LiveKit Cloud is required", "level": "ERROR", "name": "livekit", "pid": 8286, "job_id": "AJ_Pn3iCEdqGRDj", "timestamp": "2025-09-02T14:43:48.358419+00:00"}
r
That looks like agent log to me. Not Client
b
Yes this is the agent python. Probably in this code:
Copy code
logger.info("connecting to room %s", ctx.room.name)
    await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)

    # wait for the first participant to connect
    participant = await ctx.wait_for_participant()
f
ERROR - Failed to create session: 401, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='https://nora-r8206vxa.livekit.cloud/twirp/livekit.RoomService/CreateRoom'
f
I mean the livekit server sdk which I use to get the token
r
check your system clock
f
Jens and I are not working on same project. We have different projects.
r
ok, well that log for Jens looks like a system clock issue (maybe)
Check you livekit secret and key
f
in my case its working now, but again this issue comes
r
sounds like clock skew
f
but how can I update clock on render server
r
Comparing the log timestamp with the server log timestamp. It looks like the agent clock is off by several seconds.
I don't know how to use render. I've never used it before.
Most linux based systems you use NTP
Give LiveKit cloud hosted agents a try and see if you get the same: https://livekit-users.slack.com/archives/C01KZ61HZRR/p1755703664834609
b
Ok thanks for checking, we set it up before cloud went live. And Render was recommended in your docs, I don't know it well at all.