Hard to trace error db.normalizeId
Not really a bug report but i was running a action that called a ctx.runMutation that then called a mutation function which by mistake had a ctx.viewerId that passed into another async function that probably failed at the getX for that user. This orginally worked via the web so it didn't get caught because they were authed. Using ents.
I tried to run the function from console and a init script and got errors every time. But if i checked the act as user in console it still errored.
What made it weird was line 114 was a empty line before the bad ctx.runMutation
And every time i narrowed it down it was a empty line before the function running. And running the function directly that ctx.runMutation called gave the same error.
Maybe this can save someone else the headache.
1 Reply
Checking the logs for the Request ID might be also helpful when multiple functions are involved: https://docs.convex.dev/functions/debugging#finding-relevant-logs-by-request-id
Debugging | Convex Developer Hub
Debugging is the process of figuring out why your code isn't behaving as you