erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.81k stars 753 forks source link

IBGateway version stick to 10.19, TWS 10.25, ib_insync requires 10.23 #667

Closed gdassori closed 10 months ago

gdassori commented 10 months ago

Hello. Does this mean that ib_insync wouldn't work with the current IBGateway ?

I'm stick to version 10.19 and I'm experiencing the already reported for previous versions TimeoutError

2023-12-05 13:45:01,348 ib_insync.client INFO Connecting to staging.xxxxxxxxxxxxxxx:4001 with clientId 1...
2023-12-05 13:45:01,363 ib_insync.client INFO Connected
2023-12-05 13:45:01,470 ib_insync.client INFO Disconnected.
2023-12-05 13:46:01,423 ib_insync.client INFO Disconnecting
2023-12-05 13:46:01,423 ib_insync.client ERROR API connection failed: TimeoutError()
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/tasks.py", line 688, in _wrap_awaitable
    return (yield from awaitable.__await__())
asyncio.exceptions.CancelledError
gdassori commented 10 months ago

FYI: I switched from the stable branch to latest and resolved.

faroukBakari commented 8 months ago

You need to manually set timeout this way : ib.connect('127.0.0.1', 7497, clientId=1, timeout=1000)