deephaven-examples / deephaven-ib

An Interactive Brokers integration for Deephaven
Apache License 2.0
64 stars 27 forks source link

Ubuntu22.04 - tws client connect error Python3.10 local install no docker #103

Closed AssetOverflow closed 1 year ago

AssetOverflow commented 2 years ago

Server started on port 10000 import deephaven-ib as dhib r-Scheduler-Serial-1 | i.d.s.s.SessionState | Internal Error '29f24170-7764-4a2b-82a8-ee995663e89f' java.lang.RuntimeException: Error in Python interpreter: import deephaven_ib as dhib IB_PORT=7496 HOST="localhost" client = dhib.IbSessionTws(host=HOST, port=PORT, read_only=True) client.connect() r-Scheduler-Serial-1 | i.d.s.s.SessionState | Internal Error '63d7f573-33ee-4ffd-a1a1-c837e4253b17' java.lang.RuntimeException: Error in Python interpreter: client = dhib.IbSessionTws(host=HOST, port=IB_PORT, read_only=True) client.connect() ERROR:ibapi.wrapper:ERROR -1 2104 Market data farm connection is OK:usopt ERROR:ibapi.wrapper:ERROR -1 2104 Market data farm connection is OK:usfarm ERROR:ibapi.wrapper:ERROR -1 2106 HMDS data farm connection is OK:ushmds ERROR:ibapi.wrapper:ERROR -1 2158 Sec-def data farm connection is OK:secdefil ERROR:ibapi.wrapper:ERROR 31 321 Error validating request.-'bQ' : cause - 'BAG' isn't supported for contract data request. Please enter a valid security type

Exception in thread IbTwsClient: Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/ibapi-10.19.1-py3.10.egg/ibapi/client.py", line 263, in run File "/usr/local/lib/python3.10/dist-packages/ibapi-10.19.1-py3.10.egg/ibapi/decoder.py", line 1387, in interpret File "/usr/local/lib/python3.10/dist-packages/ibapi-10.19.1-py3.10.egg/ibapi/decoder.py", line 1277, in processErrorMsg File "/home/ss317/.local/lib/python3.10/site-packages/deephaven_ib/_tws/tws_client.py", line 428, in error self.contract_registry.add_error_data(req_id=reqId, error_string=errorString) File "/home/ss317/.local/lib/python3.10/site-packages/deephaven_ib/_tws/contract_registry.py", line 110, in add_error_data event.set() AttributeError: 'NoneType' object has no attribute 'set'

====================================

local install on Ubuntu22.04 python3 version = python3.10.6

chipkent commented 1 year ago

Sorry for the delay in looking at this.

I see a line mismatch between the error you are reporting and the most current code. Your error is on 110. I think the equivalent code is on 112 of the current code.

I think this PR fixed your problem. https://github.com/deephaven-examples/deephaven-ib/commit/d686362b42baf4c864002a34ca8b1509fad99a21

Can you update to v0.2.16 and see if the problem has been resolved? This version was from Oct 7, so you might not have pulled it when reporting the problem.

chipkent commented 1 year ago

https://github.com/deephaven-examples/deephaven-ib/pull/100

chipkent commented 1 year ago

I believe this problem has been resolved.