I'm seeing a weird error I haven't seen before whe...
# server-api
g
I'm seeing a weird error I haven't seen before when trying to create a dispatch. This is from the node sdk to hit the livekit api
Copy code
(node:77045) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
[Nest] 77045  - 05/14/2025, 6:11:31 PM   ERROR [ExceptionsHandler] Unauthorized: invalid token: eyJhbGciOiJIU<rest of token>NPyrXOkW4bCopWkecRT_R_vI, error: go-jose/go-jose: error in cryptographic primitive
    at TwirpRpc.request (/Users/ben/code/achilles-server/node_modules/.pnpm/livekit-server-sdk@2.10.2/node_modules/livekit-server-sdk/src/TwirpRPC.ts:82:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async AgentDispatchClient.createDispatch (/Users/ben/code/achilles-server/node_modules/.pnpm/livekit-server-sdk@2.10.2/node_modules/livekit-server-sdk/src/AgentDispatchClient.ts:56:18)
    at async LivekitService.createPreScreenCallDispatch (/Users/ben/code/achilles-server/apps/server/src/livekit/livekit.service.ts:229:5)
    at async ApplicationsService.sendPreScreenCall (/Users/ben/code/achilles-server/apps/server/src/applications/applications.service.ts:554:5)
    at async ApplicationsController.sendPreScreenCall (/Users/ben/code/achilles-server/apps/server/src/applications/applications.controller.ts:58:5) {
  status: 401,
  code: undefined
}
Has anyone seen that before?
r
Signing with wrong or missing secret?
g
All the env vars are there
ill double check theyre the correct ones
im pulling direct from our dev environment though and that works so it should be fine but will still double check.
r
You can try putting the token here and the keys and see if it can verify it: https://yepher.com/livekit/validate_token.html
I've only ever seen a 401 like that one for 2 cases. 1. Wrong keys. 2. Wrong time on system that issued the token
g
image.png
token is expired
pretty sure my system time is correct though
im in nyc
very strange
set automatically
is the token cached somewhere that i can clear?
r
yea exired 5 minutes ago so looks good
no caching that I know of.
Can you show the second time on that page (below the one you are showing)
g
image.png
r
oh the nbf is zero. That is not right
g
I just did another one, that token is valid
r
not sure why nbf is zero
g
well
I restarted my computer this morning and it worked