-
Notifications
You must be signed in to change notification settings - Fork 1
Troubleshooting
Current as of 6 Apr 2026
This page describes the common errors encountered and what to do.
⁉️ Unexpected message: 'State' object has no attribute 'usage_metadata'
- Issue: unknown, but happens to new accounts and after crash recoveries
- Solution: "Erase memory" and reload the 'app' page
⁉️ Unexpected message: Error code: 400 - {'error': {'message': 'Input tokens exceed the configured limit of 272000 tokens. Your messages resulted in 328508 tokens. Please reduce the length of the messages.', 'type': 'invalid_request_error', 'param': 'messages', 'code': 'context_length_exceeded'}}
- Issue: the previous tool call generated a large amount of text which overloaded the capacity of the LLM.
- Solution: First, log out and sign-in again. Repeat your query. If it still fails, only then do you click "Erase memory" and reload the 'app' page.
⁉️ Unexpected message: Found AIMessages with tool_calls that do not have a corresponding ToolMessage. Here are the first few of those tool calls: [{'name':'...]. Every tool call (LLM requesting to call a tool) in the message history MUST have a corresponding ToolMessage (result of a tool invocation to return to the LLM) - this is required by most LLM providers. For troubleshooting, visit: https://docs.langchain.com/oss/python/langgraph/errors/INVALID_CHAT_HISTORY
- Issue: previous session was interrupted during a tool call. The model's conversation history is now in an invalid state and must be repaired by deleting the unanswered tool call from the history.
- Solution: Click "Repair AI" and reload the 'app' page
⁉️ Unexpected message: (psycopg.errors.AdminShutdown) terminating connection due to administrator command [SQL: SELECT ...] [parameters: {'table_name': ..., 'schema_name': ...}] (Background on this error at: https://sqlalche.me/e/20/e3q8)
- No solution. Database was shut-down halfway. Need to contact administrator to restart database service.
Session expired. Please log in again. Error 500: Internal Server Error
- Issue: The token has expired after 2 hours of logging in.
- Solution: Need to log out and log in to get a new token. If it still doesn't work, the app is down.
Error 500: Internal Server Error
- The app is down. There is no solution but to contact admin.
- Issue: Too many requests sent to LLM provider e.g. OpenAI.
- Solution: Wait a while before trying again.
- Issue: The billing account associated with the LLM API key is out of credits.
- Solution: Contact admin to recharge credits in dev platform.
Initialization error: the connection is closed
- Issue: app needs to reload. Contact admin
upstream connect error or disconnect/reset before headers. reset reason: connection failure
- Issue: Unknown. Need to contact admin to restart server.
⁉️ Unexpected message: Error code: 400 - {'error': {'message': 'Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt: https://platform.openai.com/docs/guides/reasoning#advice-on-prompting', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_prompt'}}
- Issue: unknown
- Solution: Tell the agent to continue and it should be fine
⁉️ Unexpected message: Error code: 400 - {'error': {'message': "Invalid 'messages': array too long. Expected an array with maximum length 16384, but got an array with length 16856 instead.", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'array_above_max_length'}}
- Issue: unknown
- Issue: Refresh the app page and continue on