0
Debug a confusing stack trace by working backward from the error
I have a stack trace and error message that doesn't obviously point to the real bug. Help me find it methodically:
1. Start from the exception type and message: state precisely what condition triggers this exception in the language/library it comes from (don't guess generically, look at what that specific error actually means).
2. Walk the stack trace top to bottom, and for each frame, state what would have to be true at that point for the next frame's call to have happened. Stop at the first frame where something looks inconsistent with the code I've shown you.
3. Give your best hypothesis for the root cause, and separately, one alternative hypothesis in case the first is wrong, with a way to distinguish between them (a log statement, a debugger breakpoint, a value to print).
4. Do not propose a fix until the root cause is confirmed or I tell you to proceed with best guess. If I say proceed with best guess, clearly label the fix as unconfirmed.
Stack trace: stack_trace
Relevant code: code
What I was doing when it happened: context