[Bug]: 🖇 AgentOps: [agentops.InternalSpanProcessor] Error uploading logfile: Upload failed: 401
Contact Details
No response
📦 Package Version
latest
🎞️ Framework Version
No response
🔎 Describe the Bug
I have the AgentOps API key and implemented it in the local code. I was running the Agent in the ADK web ui Agent is running fine but the Agentops is throwing the error 🖇 AgentOps: [agentops.InternalSpanProcessor] Error uploading logfile: Upload failed: 401
🤝 Contribution
- [ ] Yes, I'd be happy to submit a pull request with these changes.
- [ ] I need some guidance on how to contribute.
- [ ] I'd prefer the AgentOps team to handle this update.
I encounter the same issue
We encountered the same 401 error but found a different root cause: Python on macOS had zero CA certificates loaded (ssl.create_default_context().cert_store_stats() returned all zeros), causing HTTPS authentication requests to fail. curl worked fine because it uses system certificates, but Python's SSL module had an empty certificate bundle. Setting SSL_CERT_FILE=/path/to/certifi/cacert.pem in our environment fixed it completely - authentication succeeded and traces uploaded without 401 errors.
This appears to be a separate issue from the async auth race condition described in PR #1270. Our case was a pure SSL/TLS certificate verification failure that happened before any authentication could complete. Common on macOS when Python is installed via homebrew/pyenv without the certificate installer script.