Agent Unknown Error

Hey team, any tips for finding the root cause of errors like this? Using ai-sdk v5, with agent streamVNext
9 Replies
Chad Holmes
Chad HolmesOP3w ago
Ah after digging it was TPM rate limit error Would traces have shown this? I can't seem to get traces in my Postgres layer
_roamin_
_roamin_3w ago
Hey @Chad Holmes ! It looks like we're not bubbling the error up properly. I'm not sure traces would have helped. Are you using the new AI tracing?
Chad Holmes
Chad HolmesOP3w ago
I don't think so - I was only able to find it after configuring custom logging at the ai-sdk layer. I am on the latest version of mastra though, happy to try out new tracing if that could work!
_roamin_
_roamin_3w ago
Got it! The new AI tracing is going to be our new observability solution (the current OTEL one will be deprecated at some point). You can find docs at https://mastra.ai/en/docs/observability/ai-tracing/overview One thing, you mentioned that you're using postgres, the adapater for postgres is going to be released today, so you might not be able to test it out until that is released. (unless you want to test it out with libsql)
AI Tracing | Observability | Mastra Docs
Set up AI tracing for Mastra applications
Chad Holmes
Chad HolmesOP3w ago
Serendipitious timing! Thanks so much @Romain will be v excited to try it out today
Mastra Triager
GitHub
[DISCORD:1422621600590594088] Agent Unknown Error · Issue #8349 ·...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1422621600590594088 Hey team, any tips for finding the root cause of errors like this? Using ai-sdk v5, wi...
LekoArts
LekoArts3w ago
Can you try updating all mastra packages to their latest version?
Chad Holmes
Chad HolmesOP3w ago
Hi team, I updated! And we were able to solve the error. However I am now trying to enable tracing and seeing the following error
ERROR [2025-10-02 14:29:47.166 -0600] (Mastra): [AI Tracing] Export error [exporter=tracing-default-exporter]
err: {
"type": "MastraError",
"message": "AI tracing is not supported by this storage adapter (PostgresStore)",
"stack":
Error: AI tracing is not supported by this storage adapter (PostgresStore)
at PostgresStore.get aiTracingStrategy [as aiTracingStrategy] (file:///Us
ERROR [2025-10-02 14:29:47.166 -0600] (Mastra): [AI Tracing] Export error [exporter=tracing-default-exporter]
err: {
"type": "MastraError",
"message": "AI tracing is not supported by this storage adapter (PostgresStore)",
"stack":
Error: AI tracing is not supported by this storage adapter (PostgresStore)
at PostgresStore.get aiTracingStrategy [as aiTracingStrategy] (file:///Us
Was postgres adaption for tracing not enabled by the most recent update? Wait now, I figured out how to get the upgrade to work, but I'm not seeing any traces get written
AI tracing exporter initialized {
strategy: 'batch-with-updates',
source: 'auto',
storageAdapter: '',
maxBatchSize: 1000,
maxBatchWaitMs: 5000
}
AI tracing exporter initialized {
strategy: 'batch-with-updates',
source: 'auto',
storageAdapter: '',
maxBatchSize: 1000,
maxBatchWaitMs: 5000
}
Seeing this without the storage adapter despite having success with messages and threads getting posted to postgres Okay all solved, didn't realize these are writing to a new table mastra_ai_spans
_roamin_
_roamin_3w ago
Awesome, glad you figured it out! Let me know if you're running into other issues 😉

Did you find this page helpful?