Troubleshooting
This page lists common issues when integrating with the MesoLive Python SDK and the underlying SignalR hubs.
Installation issues
ModuleNotFoundError: pysignalr
- Cause: dependencies were not installed (or the environment blocks VCS/git dependencies).
- Fix: reinstall the wheel with dependency resolution enabled, or install from your internal package index that mirrors dependencies.
Connection and auth
MesoLiveApiException(status=Unauthorized, ...)
- Cause: missing/invalid API key, expired key, or lack of access to the cluster’s API seat.
- Fix: generate a new MesoLive API key and ensure
MESOLIVE_API_KEYis set (not the MesoSim API key). See Accessing the APIs.
TimeoutError: Timed out connecting to hub ...
- Cause: instance URL is wrong, network blocks websockets, or the hub is unavailable.
- Fix:
- verify
MESOLIVE_INSTANCEuses the portal base URL (example:https://portal.MYCOMPANY.mesolive.io) - try increasing connect timeout using
HubConnectionOptions(connect_timeout_s=...)
- verify
Data Hub pitfalls
Stream fails immediately with “Provider is required”
- Cause: some Data Hub endpoints require
Provider(underlying/contract/combo). The error typically surfaces as aMesoLiveSignalRErrorfor streams. - Fix: pass
Provider=models.DataProviderType.IBKR(or the provider you have configured) in the args.
TWS agent not available / Unable to resolve contract
- Cause: the provider’s agent is not connected for your user, or contract resolution failed.
- Fix: confirm agent connectivity via Control Hub
list_agents()and use a provider that is connected and entitled.
Quotes are None or stale (*AgeMs high)
- Cause: missing market data entitlements, illiquid contracts, or the provider feed is delayed.
- Fix: check underlying/provider availability and use snapshots to resync when needed.
Control Hub idempotency
DuplicateRequest and Conflict errors during retries
- Cause: you retried an idempotent operation (expected), or reused an idempotency key with different parameters (not allowed).
- Fix:
- for safe retry: reuse the same key with the same parameters and recover via
get_idempotency_record() - never reuse the same key for a different request payload
- for safe retry: reuse the same key with the same parameters and recover via
note
The SDK raises MesoLiveApiException for DuplicateRequest and Conflict. In automation code, treat these as control-flow and recover using GetIdempotencyRecord.
Event Hub gotchas
“I’m missing events after restart”
- Fix pattern:
- persist
EventSeqIdas a durable cursor - on startup: replay via
GetEventsSincebefore relying on live callbacks - subscribe using
SubscribeToStrategies(Strategies=None)if you need all strategy updates
- persist
“My handlers break the stream / connection”
- The SDK logs and suppresses handler exceptions, but slow handlers can still cause your app to fall behind.
- Fix: keep handlers fast; offload work to your own queue/worker tasks.