Interactive broker error

from quantrocket.ibg import set_credentials

set_credentials("ibg1", username="eonum313", trading_mode="paper")

generates the following error:


ValueError Traceback (most recent call last)
in
1 from quantrocket.ibg import set_credentials
2
----> 3 set_credentials("ibg1", username="eonum313", trading_mode="paper")

/opt/conda/lib/python3.8/site-packages/quantrocket/ibg.py in set_credentials(gateway, username, password, trading_mode)
75 statuses = list_gateway_statuses(gateways=[gateway])
76 if not statuses:
---> 77 raise ValueError("no such IB Gateway: {0}".format(gateway))
78
79 if username and not password:

ValueError: no such IB Gateway: ibg1

Assuming you haven't edited docker-compose.yml, this would imply that something went wrong in bringing up your deployment. You can run docker ps and see if quantrocket_ibg1_1 is running. You can try to recreate the ibg1 container:

docker-compose up -d --force-recreate ibg1

And/or you could try a fresh install in case some wires got crossed somewhere.

now I am getting the following error:


NameError Traceback (most recent call last)
in
1 from quantrocket.ibg import set_credentials
2
----> 3 set_credem
4
5 set_credentials("ibg1", username="eonum313", trading_mode="paper")

NameError: name 'set_credem' is not defined

Delete set_credem. This is a basic Python error/typo, not anything QuantRocket-related. The forum is really geared for QuantRocket-specific issues.

I am still receiving the following error. I did use
docker-compose up -d --force-recreate ibg1

ValueError Traceback (most recent call last)
in
3 # set_credem
4
----> 5 set_credentials("ibg1", username="seppr123", trading_mode="paper")

/opt/conda/lib/python3.8/site-packages/quantrocket/ibg.py in set_credentials(gateway, username, password, trading_mode)
75 statuses = list_gateway_statuses(gateways=[gateway])
76 if not statuses:
---> 77 raise ValueError("no such IB Gateway: {0}".format(gateway))
78
79 if username and not password:

ValueError: no such IB Gateway: ibg1

You can use docker-compose ps and see if quantrocket_ibg1_1 is running.

You can also check the startup logs for that container:

docker-compose logs ibg1

They should end with something like this:

ibg1_1             | spawned uWSGI master process (pid: 1)
ibg1_1             | spawned the uWSGI spooler on dir /var/tmp/uwsgi/spool/monitor with pid 9
ibg1_1             | spawned uWSGI worker 1 (pid: 10, cores: 2)
ibg1_1             | spawned uWSGI worker 2 (pid: 12, cores: 2)
ibg1_1             | cache sweeper thread enabled
ibg1_1             | spawned uWSGI mule 1 (pid: 14)
ibg1_1             | spawned uWSGI mule 2 (pid: 15)
ibg1_1             | Starting socat.
ibg1_1             | Starting virtual X frame buffer: Xvfb.
ibg1_1             | Starting x11vnc.
ibg1_1             | Starting websockify.

Yes everything is fine there but when I run this:

from quantrocket.ibg import set_credentials

set_credentials("ibg1", username="seppr123", trading_mode="paper")

It returns this error:


ValueError Traceback (most recent call last)
in
1 from quantrocket.ibg import set_credentials
2
----> 3 set_credentials("ibg1", username="seppr123", trading_mode="paper")

/opt/conda/lib/python3.8/site-packages/quantrocket/ibg.py in set_credentials(gateway, username, password, trading_mode)
75 statuses = list_gateway_statuses(gateways=[gateway])
76 if not statuses:
---> 77 raise ValueError("no such IB Gateway: {0}".format(gateway))
78
79 if username and not password:

ValueError: no such IB Gateway: ibg1

I wonder if you could set up a meeting to resolve this.

docker-compose ps

quantrocket-account-1 "uwsgi-quantrocket -…" account running 80/tcp
quantrocket-blotter-1 "uwsgi-quantrocket -…" blotter running 80/tcp
quantrocket-codeload-1 "uwsgi-quantrocket -…" codeload running 80/tcp
quantrocket-countdown-1 "/usr/bin/supervisor…" countdown running 80/tcp
quantrocket-db-1 "uwsgi-quantrocket -…" db running 80/tcp
quantrocket-flightlog-1 "uwsgi-quantrocket -…" flightlog running 9020/tcp
quantrocket-fundamental-1 "uwsgi-quantrocket -…" fundamental running 80/tcp
quantrocket-history-1 "uwsgi-quantrocket -…" history running 80/tcp
quantrocket-houston-1 "/bin/bash /opt/quan…" houston running 0.0.0.0:1969->80/tcp
quantrocket-ibg1-1 "uwsgi-quantrocket -…" ibg1 running 5900/tcp
quantrocket-ibgrouter-1 "uwsgi-quantrocket -…" ibgrouter running 80/tcp
quantrocket-jupyter-1 "/bin/bash /opt/quan…" jupyter running 80/tcp
quantrocket-license-service-1 "uwsgi-quantrocket -…" license-service running 4040/tcp
quantrocket-logspout-1 "/bin/logspout syslo…" logspout running 80/tcp
quantrocket-master-1 "uwsgi-quantrocket -…" master running 80/tcp
quantrocket-moonshot-1 "uwsgi-quantrocket -…" moonshot running 80/tcp
quantrocket-postgres-1 "docker-entrypoint.s…" postgres running 5432/tcp
quantrocket-realtime-1 "uwsgi-quantrocket -…" realtime running 80/tcp
quantrocket-satellite-1 "/opt/quantrocket/bi…" satellite running 80/tcp
quantrocket-theia-1 "node /home/theia/sr…" theia running 80/tcp
quantrocket-zipline-1 "uwsgi-quantrocket -…" zipline running 80/tcp

docker-compose logs ibg1

quantrocket-ibg1-1 | [uWSGI] getting INI configuration from /etc/uwsgi/uwsgi.ini
quantrocket-ibg1-1 | [uWSGI] getting INI configuration from /etc/uwsgi/default.ini
quantrocket-ibg1-1 | [uWSGI] getting INI configuration from /etc/uwsgi/base.ini
quantrocket-ibg1-1 | *** Starting uWSGI 2.0.19.1 (64bit) on [Thu Nov 4 13:36:24 2021] ***
quantrocket-ibg1-1 | compiled with version: 7.3.0 on 24 June 2021 20:30:02
quantrocket-ibg1-1 | os: Linux-5.10.47-linuxkit #1 SMP Sat Jul 3 21:51:47 UTC 2021
quantrocket-ibg1-1 | nodename: c631b7c375de
quantrocket-ibg1-1 | machine: x86_64
quantrocket-ibg1-1 | clock source: unix
quantrocket-ibg1-1 | pcre jit disabled
quantrocket-ibg1-1 | detected number of CPU cores: 8
quantrocket-ibg1-1 | current working directory: /
quantrocket-ibg1-1 | detected binary path: /opt/conda/bin/uwsgi-quantrocket
quantrocket-ibg1-1 | uWSGI running as root, you can use --uid/--gid/--chroot options
quantrocket-ibg1-1 | *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
quantrocket-ibg1-1 | your memory page size is 4096 bytes
quantrocket-ibg1-1 | *** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***
quantrocket-ibg1-1 | detected max file descriptor number: 1048576
quantrocket-ibg1-1 | lock engine: pthread robust mutexes
quantrocket-ibg1-1 | thunder lock: enabled
quantrocket-ibg1-1 | *** Cache "ibgcache" initialized: 0MB (key: 2136 bytes, keys: 10680 bytes, data: 327680 bytes, bitmap: 0 bytes) preallocated ***
quantrocket-ibg1-1 | uwsgi socket 0 bound to TCP address 0.0.0.0:80 fd 4
quantrocket-ibg1-1 | uWSGI running as root, you can use --uid/--gid/--chroot options
quantrocket-ibg1-1 | *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
quantrocket-ibg1-1 | Python version: 3.8.8 (default, Feb 24 2021, 21:46:12) [GCC 7.3.0]
quantrocket-ibg1-1 | Python main interpreter initialized at 0x55db4fa90bc0
quantrocket-ibg1-1 | uWSGI running as root, you can use --uid/--gid/--chroot options
quantrocket-ibg1-1 | *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
quantrocket-ibg1-1 | python threads support enabled
quantrocket-ibg1-1 | your server socket listen backlog is limited to 100 connections
quantrocket-ibg1-1 | your mercy for graceful operations on workers is 60 seconds
quantrocket-ibg1-1 | mapped 618762 bytes (604 KB) for 4 cores
quantrocket-ibg1-1 | *** Operational MODE: preforking+threaded ***
quantrocket-ibg1-1 | i am the bootstrap for uwsgi.SymbolsImporter
quantrocket-ibg1-1 | i am the bootstrap for uwsgi.SymbolsImporter
quantrocket-ibg1-1 | [uwsgi-signal] signum 0 registered (wid: 0 modifier1: 0 target: default, any worker)
quantrocket-ibg1-1 | WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x55db4fa90bc0 pid: 1 (default app)
quantrocket-ibg1-1 | uWSGI running as root, you can use --uid/--gid/--chroot options
quantrocket-ibg1-1 | *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
quantrocket-ibg1-1 | spawned uWSGI master process (pid: 1)
quantrocket-ibg1-1 | spawned the uWSGI spooler on dir /var/tmp/uwsgi/spool/monitor with pid 8
quantrocket-ibg1-1 | spawned uWSGI worker 1 (pid: 9, cores: 2)
quantrocket-ibg1-1 | spawned uWSGI worker 2 (pid: 10, cores: 2)
quantrocket-ibg1-1 | cache sweeper thread enabled
quantrocket-ibg1-1 | spawned uWSGI mule 1 (pid: 13)
quantrocket-ibg1-1 | spawned uWSGI mule 2 (pid: 17)
quantrocket-ibg1-1 | Starting socat.
quantrocket-ibg1-1 | Starting virtual X frame buffer: Xvfb.
quantrocket-ibg1-1 | Starting x11vnc.
quantrocket-ibg1-1 | Starting websockify.

Docker Desktop now ships with Docker Compose v2, and that is causing the problem. For now, please run the following commands to disable Docker Compose v2 and relaunch your containers:

docker-compose disable-v2
docker-compose up -d --force-recreate