GithubHelp home page GithubHelp logo

extrange / ibkr-docker Goto Github PK

View Code? Open in Web Editor NEW
157.0 3.0 33.0 204 KB

Run IBKR Gateway/TWS in a Docker container

Shell 63.30% HTML 8.52% Dockerfile 24.98% Python 3.20%
algorithmic-trading docker ibgateway ibkr quant quantitative-finance trading trading-bot tws tws-api

ibkr-docker's Introduction

Interactive Brokers in Docker

Trader Workstation

IB Gateway

Features

  • Fully containerized TWS/IB Gateway, no external dependencies
  • TWS API access automatically configured and forwarded
  • Viewable in a browser (via noVNC)
  • Auto-restart, auto-login TWS/IB Gateway automatically via IBC Alpha

Getting Started

Using docker run

docker run -d \
  -p "127.0.0.1:6080:6080" \
  -p "127.0.0.1:8888:8888" \
  --ulimit nofile=10000 \
  -e USERNAME=your_username \
  -e PASSWORD=your_password \
  ghcr.io/extrange/ibkr:latest

Using docker compose (recommended)

Create a .env file:

USERNAME=<your IBKR username>
# wrap password in single quotes if $, /, or \ are present
PASSWORD='<your IBKR password>'

compose.yml:

---
services:
  ibkr:
    image: ghcr.io/extrange/ibkr # latest, stable, 10.21, 10.21.1p etc
    ports:
      - "127.0.0.1:6080:6080" # noVNC browser access
      - "127.0.0.1:8888:8888" # API access
    ulimits:
      nofile: 10000 # See FAQ
    environment:
      USERNAME: ${USERNAME}
      PASSWORD: ${PASSWORD}
      # TWOFA_TIMEOUT_ACTION: restart
      # GATEWAY_OR_TWS: tws
      #
      # Variables prefixed with IBC_ override IBCAlpha`s config.ini:
      # IBC_TradingMode: live
      # IBC_ReadOnlyApi: yes
      # ...
      # See below for more details

Important: Boolean-like values (e.g. yes/no) must be wrapped in single quotes to prevent them from being interpreted as True/False by th YAML parser.

View at localhost:6080.

TWS API is accessible at port 8888.

Environment Variables

Variable Description Default
USERNAME Username edemo
PASSWORD Password demouser
GATEWAY_OR_TWS What to start, either tws or gateway tws
TWOFA_TIMEOUT_ACTION 2FA timeout action. Either restart or exit. restart
TWS_SETTINGS_PATH (optional) Path to store TWS settings (see FAQ)

Variables prefixed with IBC_ will override settings in IBCAlpha's config.ini, e.g.:

  • IBC_TradingMode (default: live)
  • IBC_ExistingSessionDetectedAction (default: manual)
  • IBC_ReadOnlyApi (default: keep existing)
  • etc.

See possible values here.

Docker Images

See available tags and versions here.

FAQ

How do I save TWS settings locally?

If you want to save TWS settings locally (e.g. to persist settings across container runs), set TWS_SETTINGS_PATH to say, /settings. Then, add a bind mount on your local filesystem, such as in the following compose.yml:

#...
  environment:
    TWS_SETTINGS_PATH: /settings
    #...
  volumes:
    - ./settings:/settings:rw

Now, TWS will load settings from your local filesystem for each container run.

Cannot connect to API when using TWS

You will need to manually enable Enable ActiveX and Socket Clients (see this issue).

Error: library initialization failed - unable to allocate file descriptor table - out of memory/root/ibc/scripts/ibcstart.sh

Ensure that you have the appropriate ulimit nofile set: either --ulimit nofile=10000 (docker run) or ulimits: nofile: 10000 (docker compose).

Which tag to use, latest or stable?

stable is generally preferred as there are less bugs.

What is the difference between IB Gateway and Trader Workstation (TWS)?

TWS is a fully featured trading platform with many features.

IB Gateway has a minimal GUI and is used for API access to the trading platform, for example with automated trading. It also uses less resources.

See here for more differences.

Do I need to download TWS separately?

Both the IB Gateway and TWS installation scripts include both IB Gateway and TWS, so downloading either is fine.

What ports does TWS/IB Gateway use internally?

TWS uses 7496 (live) and 7497 (paper), while IB gateway uses 4001 (live) and 4002 (paper).

There is no need to change the port for this image, as it automatically forwards the correct port (based on trading mode and TWS/IB Gateway) to 8888.

How do I configure the default login to paper/live trading?

Set the environment variable IBC_TradingMode to paper or live.

Repository Architecture

  • New versions of IB Gateway are checked for daily, and fetched if available, as a release (detect-releases.yml).
  • A PR with the updated Dockerfile (obtained by running build.sh <latest/stable> <version>) is automatically created
  • I test the updated configuration (both IB Gateway/TWS)
  • I then manually merge the PR, and tag the resulting commit with git tag docker-<version>-<latest/stable>
  • Pushing the tag triggers a docker build action (publish.yml, based on the docker- prefix), which reads the version and release channel (latest/stable) from the tag, and then fetches the repo at the tag's commit, builds from the appropriate folder (latest/stable), tags and pushes the image to ghcr.io/extrange/ibkr.

ibkr-docker's People

Contributors

dependabot[bot] avatar extrange avatar github-actions[bot] avatar walkerwalker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ibkr-docker's Issues

Not an issue but question

I've been trying to use a docker volume to save IBKR settings such data I don't lose them after rebuilding the container.
The IBCAlpha mentions the TWS_SETTINGS_PATH that should be used with the Startup script.
I don't think it's something that I can pass as an environment variable now.

Would you have any suggestion?

connection refused, paper trading

listening on AF=2 0.0.0.0:8888 2023-09-05T13:04:40.955082341Z 2023/09/05 13:04:40 socat[330] N opening connection to AF=2 127.0.0.1:7497 2023-09-05T13:04:40.955169241Z 2023/09/05 13:04:40 socat[330] W recvmsg(): Resource temporarily unavailable 2023-09-05T13:04:40.955249754Z 2023/09/05 13:04:40 socat[330] E connect(5, AF=2 127.0.0.1:7497, 16): Connection refused 2023-09-05T13:04:40.955328204Z 2023/09/05 13:04:40 socat[330] N exit(1)

unfortunately the connection seems to be refused when accessing from localhost?

  • image: stable
  • tws
  • paper
  • ports are forwarded

autorestart file not found

After running ibkr-docker for some time it seems to eventually exit with the following logs:

2024-02-01 00:17:41.561
2024-02-01 05:17:41:363 IBC: detected frame entitled: Connecting to server...; event=Opened
2024-02-01 00:18:16.261
2024/02/01 05:18:16 socat[245] N socket 2 (fd 5) is at EOF
2024-02-01 00:18:17.461
2024/02/01 05:18:17 socat[245] N exiting with status 0
2024-02-01 00:18:18.062
2024/02/01 05:18:18 socat[15] N childdied(): handling signal 17
2024-02-01 00:19:09.561
2024-02-01 05:19:09:362 IBC: detected dialog entitled: Shutdown progress; event=Opened
2024-02-01 00:19:19.462
2024-02-01 05:19:19:463 IBC: detected dialog entitled: API client needs write access action confirmation; event=Lost focus
2024-02-01 00:19:20.461
2024-02-01 05:19:19:661 IBC: detected dialog entitled: API client needs write access action confirmation; event=Deactivated
2024-02-01 00:19:22.360
2024-02-01 05:19:22:263 IBC: detected dialog entitled: Shutdown progress; event=Activated
2024-02-01 00:19:22.760
2024-02-01 05:19:22:662 IBC: detected dialog entitled: Shutdown progress; event=Focused
2024-02-01 00:19:22.761
2024-02-01 05:19:22:761 IBC: detected dialog entitled: IBKR Gateway; event=Opened
2024-02-01 00:19:23.461
2024-02-01 05:19:22:762 IBC: detected dialog entitled: Shutdown progress; event=Lost focus
2024-02-01 00:19:23.461
2024-02-01 05:19:23:461 IBC: detected dialog entitled: Shutdown progress; event=Deactivated
2024-02-01 00:19:25.261
2024-02-01 05:19:23:861 IBC: detected dialog entitled: IBKR Gateway; event=Activated
2024-02-01 00:19:26.161
2024-02-01 05:19:26:161 IBC: detected dialog entitled: IBKR Gateway; event=Focused
2024-02-01 00:19:26.161
2024-02-01 05:19:26:162 IBC: detected dialog entitled: API client needs write access action confirmation; event=Closed
2024-02-01 00:32:39.168
2024-02-01 05:32:38,962 JTS-ShutdownTask-Shutdown_IA-921 ERROR Attempted to append to non-started appender d
2024-02-01 00:32:42.268
2024-02-01 05:32:39,662 JTS-ShutdownTask-Shutdown_IA-921 ERROR Attempted to append to non-started appender d
2024-02-01 00:32:43.268
2024-02-01 05:32:42,762 NIA-Input-Queue-2 ERROR Attempted to append to non-started appender d
2024-02-01 00:32:44.261
2024-02-01 05:32:43,463 NIA-Input-Queue-2 ERROR Attempted to append to non-started appender d
2024-02-01 00:33:14.860
2024-02-01 05:33:14,662 pool-3-thread-1 ERROR Attempted to append to non-started appender f
2024-02-01 00:33:27.561
IBC returned exit status 0
2024-02-01 00:33:31.871
autorestart file not found
2024-02-01 00:33:31.871
Gateway finished

Are there some extra steps to prevent this from happening, such as producing a autorestart file?

no paper connection possible

2023/09/04 17:20:32 socat[149] N opening connection to AF=2 127.0.0.1:7497
2023/09/04 17:20:32 socat[149] W recvmsg(): Resource temporarily unavailable
2023/09/04 17:20:32 socat[149] E connect(5, AF=2 127.0.0.1:7497, 16): Connection refused
2023/09/04 17:20:32 socat[149] N exit(1)

connecting via VPC looks like it's not being able to click the login button

using :stable
tried gateway and tws

market data in both - live and paper TWS containers

TWS does not allow to show market data in a paper instance if live instance (for the same user) is running on ANOTHER machine (but shows if both are running on the same machine).
we run one container for live and another container for paper but they do not "see" each other and TWS does not show market data in paper container. any ideas how to make them both show market data? thank you.

Everything works fine on localhost, but not on my server

I use the following docker file to run the image locally and it is working fine:


version: '3.8'

services:
  ibkr:
    image: ghcr.io/extrange/ibkr:latest
    ports:
      - "127.0.0.1:6080:6080"
      - "127.0.0.1:8888:8888"
    ulimits:
      nofile: 10000
    environment:
      USERNAME: ${USERNAME_1}
      PASSWORD: ${PASSWORD}
      GATEWAY_OR_TWS: gateway
      IBC_TradingMode: paper
      IBC_ReadOnlyApi: no
      IBC_AcceptNonBrokerageAccountWarning: yes

However, when I run the same setup on my home server, I can't access anything.

I did deploy a few test docker compose web apps to the same server and they are accessible in the home network, however, above docker compose ports are not accessible.

Do i need and special setup when I run the image on a servers other than local host?

Market data sharing of concurrent live and paper sessions

I have a problem with ibkr-docker which I cannot wrap my head around:

IB allows sharing of market data between live and paper trading accounts as long as both TWS/Gateway run on the same machine. This unfortunately does not work when using docker, because each container counts as a different machine for IB.

As I have a live trading container that I do not want to stop while I am testing some new stuff in paper trading, this is a severe problem for me. Are there any ideas how I could run two TWS instances from within one container or other solutions?

VNC client

Thanks for that very interesting image!

Is it possible to have vnc without browser access via an vnc client supported?

I find it cumbersome to have a different url each time and also could not get it working accessing from my local machine via wireguard to the cloud provider.

Support specify ibc version in docker-compose

wow. Great work and it helps me a lot. As written in the title, I wonder if it's possible to also specify the ibc version in docker-compose. For example, right now, it is 3.12.0. We probably don't need to use it immediately but I guess it's nice to be able to specify it in docker-compose rather than in the dockerfile. Possibly through build arguments?

Cannot connect to TWS/ IB Gateway on GCP

Hi there,

I'm working on google cloud and got this error when connecting
image
image
I had the global configuration set on localhost:6080
image

from the docker's log, i feel like I can connect to the API port
image
there is no connection refused log as in #16

Could anyone help? Thanks in advance!

Gateway shows as GreyBox

I am seeing a Grey Box when using the console. This appears after I login, before that VNC shows everything as expected.

Am I doing something wrong?

docker run -d -p "127.0.0.1:6080:6080" -p "127.0.0.1:8888:8888" --ulimit nofile=10000 -e USERNAME=XXXX -e PASSWORD=PXXX -e GATEWAY_OR_TWS=gateway ghcr.io/extrange/ibkr:latest

image

Connection issue: auto restart failure

Hello, I'm having a hard time understanding this error. Any help with this?

2024-04-12 06:33:44 Navigate to this URL:
2024-04-12 06:33:44
2024-04-12 06:33:44 http://40995f0eb97e:6080/vnc.html?host=40995f0eb97e&port=6080
2024-04-12 06:33:44
2024-04-12 06:33:44 Press Ctrl-C to exit
2024-04-12 06:33:44
2024-04-12 06:33:44
2024-04-12 06:33:45 IBC returned exit status 133
2024-04-12 06:33:45 autorestart file not found
2024-04-12 06:33:45
2024-04-12 06:33:45 TWS finished
2024-04-12 06:33:45
2024-04-12 06:33:45 assertion failed [rem_idx != -1]: Unable to find existing allocation for shared memory segment to unmap
2024-04-12 06:33:45 (VMAllocationTracker.cpp:745 remove_shared_mem)
2024-04-12 06:33:45 /opt/ibc/scripts/ibcstart.sh: line 504: 46 Trace/breakpoint trap "$java_path/java" -cp "$ibc_classpath" $java_vm_options$autorestart_option $entry_point "$ibc_ini" ${mode}

Here are my docker-compose file

services:
  ibkr:
    image: ghcr.io/extrange/ibkr:stable # Use the latest image
    ports:
      - "127.0.0.1:6080:6080" # noVNC browser access
      - "127.0.0.1:8888:8888" # API access
    ulimits:
      nofile: 10000 # Set the file limit, see FAQ
    environment:
      TWS_SETTINGS_PATH: /settings
      USERNAME: ${USERNAME}
      PASSWORD: ${PASSWORD}
      TWOFA_TIMEOUT_ACTION: restart
      GATEWAY_OR_TWS: tws
      # Variables prefixed with IBC_ override IBCAlpha's config.ini:
      IBC_TradingMode: paper # Specify the trading mode, either 'paper' or 'live'
      IBC_ReadOnlyApi: no
    volumes:
      - ./settings:/settings:rw
      

Reconnection issue

Hi,
I really enjoy your TWS image, but I've faced with one problem recently.
At some point in time connections start failing. The UI keeps running ok, but I can't connect to API.
Here is my container logs:

2024/01/25 15:07:07 socat[12] N accepting connection from AF=2 100.100.1.137:47806 on AF=2 100.100.207.15:8888
2024/01/25 15:07:07 socat[12] N forked off child process 835
2024/01/25 15:07:07 socat[12] N listening on AF=2 0.0.0.0:8888
2024/01/25 15:07:07 socat[835] N opening connection to AF=2 127.0.0.1:7497
2024/01/25 15:07:07 socat[835] N successfully connected from local address AF=2 127.0.0.1:51930
2024/01/25 15:07:07 socat[835] N starting data transfer loop with FDs [6,6] and [5,5]
2024/01/25 15:07:11 socat[835] N socket 1 (fd 6) is at EOF
2024/01/25 15:07:11 socat[835] N exiting with status 0
2024/01/25 15:07:11 socat[12] N childdied(): handling signal 17

and ib insync returns:

2024-01-25 15:07:07,189 ib_insync.client INFO Connecting to 52.139.19.233:8888 with clientId 101...
2024-01-25 15:07:07,242 ib_insync.client INFO Connected
2024-01-25 15:07:11,246 ib_insync.client INFO Disconnecting
2024-01-25 15:07:11,246 ib_insync.client ERROR API connection failed: TimeoutError()
2024-01-25 15:07:11,247 ib_insync.client INFO Disconnected.
Traceback (most recent call last):
File "C:\Python310\lib\asyncio\tasks.py", line 650, in _wrap_awaitable
return (yield from awaitable.await())
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Python310\lib\asyncio\tasks.py", line 456, in wait_for
return fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\AndriiO18\projects\tws-tests\ib.py", line 63, in
ds = DataStream(1)
File "C:\Users\AndriiO18\projects\tws-tests\ib.py", line 38, in init
self.ib = IB().connect(c_id)
File "C:\Users\AndriiO18\projects\tws-tests\ib.py", line 20, in connect
self.ib.connect(
File "C:\Users\AndriiO18\projects\tws-tests.venv\lib\site-packages\ib_insync\ib.py", line 279, in connect
return self._run(self.connectAsync(
File "C:\Users\AndriiO18\projects\tws-tests.venv\lib\site-packages\ib_insync\ib.py", line 318, in _run
return util.run(*awaitables, timeout=self.RequestTimeout)
File "C:\Users\AndriiO18\projects\tws-tests.venv\lib\site-packages\ib_insync\util.py", line 341, in run
result = loop.run_until_complete(task)
File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Users\AndriiO18\projects\tws-tests.venv\lib\site-packages\ib_insync\ib.py", line 1748, in connectAsync
await self.client.connectAsync(host, port, clientId, timeout)
File "C:\Users\AndriiO18\projects\tws-tests.venv\lib\site-packages\ib_insync\client.py", line 217, in connectAsync
await asyncio.wait_for(self.apiStart, timeout)
File "C:\Python310\lib\asyncio\tasks.py", line 458, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

The problem is I can't catch the real reason of this problem because it can run without any problems for hours.
I used recent ghcr.io/extrange/ibkr:stable then downgraded to ghcr.io/extrange/ibkr:10.19.2d but the problem appeared there too.
And only container restart fixes the problem.
Both TWS and IB GW have this issue.

Will be grateful for any advice.
Thanks.

Cannot connect to TWS API

Hi

My docker-compose setup of TWS:

image

Container is successfully created and I can open TWS and see trades etc:

image

I'm trying connect to TWS using provided EClientSocket from TWS API. Using host: ikbr, port: 8888 (tried use host as localhost, 127.0.0.1, host.docker.internal etc. nothing helped):

image

I am not getting any error but IsConnected() method at line 42 all time returning me false.

In ikbr container logs I can see thet connection to 127.0.0.1:7496 is refused:

image

What I'm doing wrong?

VNC connection keeps dropping

I am connecting using a desktop VNC viewer (UltraVNC). The server drops the connection and my viewer reconnects instantly every 26sec. I have many other dockers running VNC including one that runs TWS and have not experienced this issue with any of the others. Is there some type of timeout configured?

app | Fri Sep  1 02:53:37 2023
app |  VNCSConnST:  Failed to flush remaining socket data on close: write: Broken
app |               pipe (32)
app |  VNCSConnST:  closing 192.168.1.103::59114: write: Connection reset by peer
app |               (104)
app |  EncodeManager: Framebuffer updates: 240
app |  EncodeManager:   Tight:
app |  EncodeManager:     Solid: 24.641 krects, 379.554 Mpixels
app |  EncodeManager:            385 KiB (1:3851.74 ratio)
app |  EncodeManager:   ZRLE:
app |  EncodeManager:     Bitmap RLE: 1.673 krects, 2.32451 Mpixels
app |  EncodeManager:                 59.5166 KiB (1:152.894 ratio)
app |  EncodeManager:     Indexed RLE: 22.466 krects, 243.357 Mpixels
app |  EncodeManager:                  11.5646 MiB (1:80.2958 ratio)
app |  EncodeManager:     Full Colour: 31.764 krects, 255.872 Mpixels
app |  EncodeManager:                  46.8194 MiB (1:20.8554 ratio)
app |  EncodeManager:   Total: 80.544 krects, 881.107 Mpixels
app |  EncodeManager:          58.8181 MiB (1:57.1606 ratio)
app |  Connections: closed: 192.168.1.103::59114
app |  ComparingUpdateTracker: 278.1 Mpixels in / 70.458 kpixels out
app |  ComparingUpdateTracker: (1:3947.03 ratio)
app |
app | Fri Sep  1 02:53:41 2023
app |  Connections: accepted: 192.168.1.103::59119
app |  SConnection: Client needs protocol version 3.8
app |  SConnection: Client requests security type None(1)
app |  VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
app |  VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888
app |  VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888
app |
app | Fri Sep  1 02:54:07 2023
app |  VNCSConnST:  Failed to flush remaining socket data on close: write: Broken
app |               pipe (32)
app |  VNCSConnST:  closing 192.168.1.103::59119: write: Broken pipe (32)
app |  EncodeManager: Framebuffer updates: 230
app |  EncodeManager:   Tight:
app |  EncodeManager:     Solid: 23.909 krects, 365.184 Mpixels
app |  EncodeManager:            373.562 KiB (1:3819.39 ratio)
app |  EncodeManager:   ZRLE:
app |  EncodeManager:     Bitmap RLE: 1.603 krects, 2.22725 Mpixels
app |  EncodeManager:                 57.0264 KiB (1:152.894 ratio)
app |  EncodeManager:     Indexed RLE: 21.526 krects, 233.135 Mpixels
app |  EncodeManager:                  11.0284 MiB (1:80.663 ratio)
app |  EncodeManager:     Full Colour: 30.228 krects, 245.128 Mpixels
app |  EncodeManager:                  44.83 MiB (1:20.8663 ratio)
app |  EncodeManager:   Total: 77.266 krects, 845.675 Mpixels
app |  EncodeManager:          56.2789 MiB (1:57.3373 ratio)
app |  Connections: closed: 192.168.1.103::59119
app |  ComparingUpdateTracker: 356.381 Mpixels in / 147.076 kpixels out
app |  ComparingUpdateTracker: (1:2423.11 ratio)
app |
app | Fri Sep  1 02:54:11 2023
app |  Connections: accepted: 192.168.1.103::59123
app |  SConnection: Client needs protocol version 3.8
app |  SConnection: Client requests security type None(1)
app |  VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
app |  VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888
app |  VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888

Paper works fine but live (with push auth) crashes after login

When trying to use it with a live account, after signing in and confirming the sign in via mobile 2fa it starts to show the tws window and then the tws crashes without any error message and starts a new auth cycle.

The same container with a paper account and no 2fa works just fine.

i tried latest and stable. All have the same issue.

assertion failed [rem_idx != -1]: Unable to find existing allocation for shared memory segment to unmap

just in the past days I'm getting the above error, previously it was working - strange!

docker compose yaml

version: "3"
services:
  ibgateway:
    image: ghcr.io/extrange/ibkr:stable
    platform: linux/amd64
    shm_size: 500m
    container_name: ibgateway
    # restart: unless-stopped
    ulimits:
      nofile: 10000
    environment:
      - USERNAME=xxxx
      - PASSWORD=xxxxxx
      - IBC_TradingMode=paper
      # - IBC_ReadOnlyApi=yes
      - GATEWAY_OR_TWS=gateway
    ports:
      - 6080:6080 # vnc
      - 8888:8888 # api

logs

ibgateway  | 2024-01-24 07:25:31:974 IBC:     jts.ini: ApiOnly=true
ibgateway  | 2024-01-24 07:25:31:974 IBC: Starting Gateway
ibgateway  | 
ibgateway  | 
ibgateway  | Navigate to this URL:
ibgateway  | 
ibgateway  |     http://1b0800d336b3:6080/vnc.html?host=1b0800d336b3&port=6080
ibgateway  | 
ibgateway  | Press Ctrl-C to exit
ibgateway  | 
ibgateway  | 
ibgateway  | assertion failed [rem_idx != -1]: Unable to find existing allocation for shared memory segment to unmap
ibgateway  | (VMAllocationTracker.cpp:745 remove_shared_mem)
ibgateway  |  /opt/ibc/scripts/ibcstart.sh: line 504:   226 Trace/breakpoint trap   "$java_path/java" -cp "$ibc_classpath" $java_vm_options$autorestart_option $entry_point "$ibc_ini" "$ib_user_id" "$ib_password" ${mode}
ibgateway  | IBC returned exit status 133
ibgateway  | autorestart file not found
ibgateway  | 
ibgateway  | Gateway finished
ibgateway  | 
ibgateway exited with code 133

system:
Mac OS, docker desktop, platform: linux/amd64 mode

remove Client 1 , can't connect.

I m using docker-compose,,

docker running well.

but when I try to connect, says "remove Client"

here is the logs,

starting data transfer loop with FDs [6,6] and [5,5]
remove Client 0
2023/10/05 11:22:15 socat[236] N socket 1 (fd 6) is at EOF
2023/10/05 11:22:15 socat[236] N socket 2 (fd 5) is at EOF
2023/10/05 11:22:15 socat[236] N exiting with status 0
2023/10/05 11:22:15 socat[11] N childdied(): handling signal 17
2023/10/05 11:22:35 socat[11] N accepting connection from AF=2 159.138.57.90:50374 on AF=2 192.168.48.2:8888
2023/10/05 11:22:35 socat[11] N forked off child process 242
2023/10/05 11:22:35 socat[11] N listening on AF=2 0.0.0.0:8888
2023/10/05 11:22:35 socat[242] N opening connection to AF=2 127.0.0.1:4001
2023/10/05 11:22:35 socat[242] N successfully connected from local address AF=2 127.0.0.1:51850
2023/10/05 11:22:35 socat[242] N starting data transfer loop with FDs [6,6] and [5,5]
remove Client 23

and I have checked the logs in the web interface:
shows there is a connection, but there is no response keep hanging on me.

image

API looks all right, just no response. keep hanging :

app = TestApp()
app.connect("xxxxxx", 8888, 23)
app.run()
orders = app.reqPositions()
print(orders)

How to set timezone

Hi Folks,

Would would be the easiest way to set the timezone for IB Gateway?

Thank you,

Can't connect to X11 window server using ':0' as the value of the DISPLAY variable

edit: same error for ghcr.io/extrange/ibkr:latest
fresh compose with ghcr.io/extrange/ibkr:stable:

2024-04-09 07:51:52 Starting TWS with this command:
2024-04-09 07:50:27 2024/04/09 07:50:27 socat[11] N listening on AF=2 0.0.0.0:8888
2024-04-09 07:50:27 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2024-04-09 07:50:27 2024-04-09 07:50:27:718 IBC: An exception has occurred:
2024-04-09 07:50:27 java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
2024-04-09 07:50:27 at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
2024-04-09 07:50:27 at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
2024-04-09 07:50:27 at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
2024-04-09 07:50:27 at java.security.AccessController.doPrivileged(Native Method)
2024-04-09 07:50:27 at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:74)
2024-04-09 07:50:27 at java.lang.Class.forName0(Native Method)
2024-04-09 07:50:27 at java.lang.Class.forName(Class.java:264)
2024-04-09 07:50:27 at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
2024-04-09 07:50:27 at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
2024-04-09 07:50:27 at sun.awt.X11.XToolkit.(XToolkit.java:132)
2024-04-09 07:50:27 at java.lang.Class.forName0(Native Method)
2024-04-09 07:50:27 at java.lang.Class.forName(Class.java:264)
2024-04-09 07:50:27 at java.awt.Toolkit$2.run(Toolkit.java:860)
2024-04-09 07:50:27 at java.awt.Toolkit$2.run(Toolkit.java:855)
2024-04-09 07:50:27 at java.security.AccessController.doPrivileged(Native Method)
2024-04-09 07:50:27 at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
2024-04-09 07:50:27 at ibcalpha.ibc.IbcTws.createToolkitListener(Unknown Source)
2024-04-09 07:50:27 at ibcalpha.ibc.IbcTws.load(Unknown Source)
2024-04-09 07:50:27 at ibcalpha.ibc.IbcTws.main(Unknown Source)

java.util.concurrent.CompletionException: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:

If I run the docker for some time (or click a URL), I got the following error (in both stable and latest):

ibkr-1  | Tue Jan 16 14:58:58 2024
ibkr-1  |  Connections: accepted: 127.0.0.1::39138
ibkr-1  |  SConnection: Client needs protocol version 3.8
ibkr-1  |  SConnection: Client requests security type None(1)
ibkr-1  |  VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
ibkr-1  | 172.22.0.1 - - [16/Jan/2024 14:58:58] code 404, message File not found
ibkr-1  |  VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian bgr888
ibkr-1  |  ComparingUpdateTracker: 0 pixels in / 0 pixels out
ibkr-1  |  ComparingUpdateTracker: (1:-nan ratio)
ibkr-1  | 2024-01-16 14:59:52:216 IBC: detected dialog entitled: Second Factor Authentication; event=Closed
ibkr-1  | 2024-01-16 15:00:22:216 IBC: detected dialog entitled: Second Factor Authentication; event=Closed
ibkr-1  | 2024-01-16 15:00:28:442 IBC: detected dialog entitled: Second Factor Authentication; event=Closed
ibkr-1  | 2024-01-16 15:00:30:467 IBC: detected dialog entitled: Downloading settings from server; event=Closed
ibkr-1  | LogModuleConfigurator-Init: Log4j Ver2.x found on classpath
ibkr-1  | LogModuleConfigurator-Init: LogModuleConfigurator initialized with Log4j Verd.x
ibkr-1  | 2024-01-16 15:00:42:374 IBC: detected frame entitled: ; event=Lost focus
ibkr-1  | 2024-01-16 15:00:42:374 IBC: detected frame entitled: ; event=Deactivated
ibkr-1  | java.util.concurrent.CompletionException: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
ibkr-1  | 	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
ibkr-1  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
ibkr-1  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ibkr-1  | 	at java.lang.Thread.run(Thread.java:748)
ibkr-1  | Caused by: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.lambda$checkAvailability$1(LinuxDependencies.java:82)
ibkr-1  | 	at java.util.Optional.ifPresent(Optional.java:159)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.checkAvailability(LinuxDependencies.java:67)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:152)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:163)
ibkr-1  | 	at feature.webapp.E.b(E.java:766)
ibkr-1  | 	at feature.webapp.E.a(E.java:675)
ibkr-1  | 	at feature.webapp.E.c(E.java:638)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
ibkr-1  | 	... 7 more
ibkr-1  | java.util.concurrent.CompletionException: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
ibkr-1  | 	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
ibkr-1  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
ibkr-1  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ibkr-1  | 	at java.lang.Thread.run(Thread.java:748)
ibkr-1  | Caused by: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.lambda$checkAvailability$1(LinuxDependencies.java:82)
ibkr-1  | 	at java.util.Optional.ifPresent(Optional.java:159)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.checkAvailability(LinuxDependencies.java:67)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:152)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:163)
ibkr-1  | 	at feature.webapp.E.b(E.java:766)
ibkr-1  | 	at feature.webapp.E.a(E.java:675)
ibkr-1  | 	at feature.webapp.E.c(E.java:638)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
ibkr-1  | 	... 7 more
ibkr-1  | java.util.concurrent.CompletionException: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
ibkr-1  | 	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
ibkr-1  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
ibkr-1  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ibkr-1  | 	at java.lang.Thread.run(Thread.java:748)
ibkr-1  | Caused by: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.lambda$checkAvailability$1(LinuxDependencies.java:82)
ibkr-1  | 	at java.util.Optional.ifPresent(Optional.java:159)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.checkAvailability(LinuxDependencies.java:67)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:152)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:163)
ibkr-1  | 	at feature.webapp.E.b(E.java:766)
ibkr-1  | 	at feature.webapp.E.a(E.java:675)
ibkr-1  | 	at feature.webapp.E.c(E.java:638)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
ibkr-1  | 	... 7 more
ibkr-1  | java.util.concurrent.CompletionException: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
ibkr-1  | 	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
ibkr-1  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
ibkr-1  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ibkr-1  | 	at java.lang.Thread.run(Thread.java:748)
ibkr-1  | Caused by: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.lambda$checkAvailability$1(LinuxDependencies.java:82)
ibkr-1  | 	at java.util.Optional.ifPresent(Optional.java:159)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.checkAvailability(LinuxDependencies.java:67)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:152)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:163)
ibkr-1  | 	at feature.webapp.E.b(E.java:766)
ibkr-1  | 	at feature.webapp.E.a(E.java:675)
ibkr-1  | 	at feature.webapp.E.c(E.java:638)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
ibkr-1  | 	... 7 more
ibkr-1  | 2024-01-16 15:00:44:323 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Activated
ibkr-1  | 2024-01-16 15:00:44:324 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Focused
ibkr-1  | java.util.concurrent.CompletionException: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
ibkr-1  | 	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
ibkr-1  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
ibkr-1  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ibkr-1  | 	at java.lang.Thread.run(Thread.java:748)
ibkr-1  | Caused by: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.lambda$checkAvailability$1(LinuxDependencies.java:82)
ibkr-1  | 	at java.util.Optional.ifPresent(Optional.java:159)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.checkAvailability(LinuxDependencies.java:67)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:152)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:163)
ibkr-1  | 	at feature.webapp.E.b(E.java:766)
ibkr-1  | 	at feature.webapp.E.a(E.java:675)
ibkr-1  | 	at feature.webapp.E.c(E.java:638)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
ibkr-1  | 	... 7 more
ibkr-1  | java.util.concurrent.CompletionException: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
ibkr-1  | 	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
ibkr-1  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
ibkr-1  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ibkr-1  | 	at java.lang.Thread.run(Thread.java:748)
ibkr-1  | Caused by: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.lambda$checkAvailability$1(LinuxDependencies.java:82)
ibkr-1  | 	at java.util.Optional.ifPresent(Optional.java:159)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.checkAvailability(LinuxDependencies.java:67)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:152)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:163)
ibkr-1  | 	at feature.webapp.E.b(E.java:766)
ibkr-1  | 	at feature.webapp.E.a(E.java:675)
ibkr-1  | 	at feature.webapp.E.c(E.java:638)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
ibkr-1  | 	... 7 more
ibkr-1  | 2024-01-16 15:00:45:618 IBC: detected dialog entitled: Pending Tasks; event=Closed
ibkr-1  | 2024-01-16 15:00:45:626 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Lost focus
ibkr-1  | 2024-01-16 15:00:45:627 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Deactivated
ibkr-1  | java.util.concurrent.CompletionException: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
ibkr-1  | 	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
ibkr-1  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
ibkr-1  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
ibkr-1  | 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ibkr-1  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ibkr-1  | 	at java.lang.Thread.run(Thread.java:748)
ibkr-1  | Caused by: com.teamdev.jxbrowser.engine.MissingDependencyException: Missing dependencies have been detected:
ibkr-1  | 	chromium => libasound.so.2 libnssutil3.so libnss3.so libgbm.so.1 libsmime3.so libnspr4.so
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.lambda$checkAvailability$1(LinuxDependencies.java:82)
ibkr-1  | 	at java.util.Optional.ifPresent(Optional.java:159)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.LinuxDependencies.checkAvailability(LinuxDependencies.java:67)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:152)
ibkr-1  | 	at com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:163)
ibkr-1  | 	at feature.webapp.E.b(E.java:766)
ibkr-1  | 	at feature.webapp.E.a(E.java:675)
ibkr-1  | 	at feature.webapp.E.c(E.java:638)
ibkr-1  | 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
ibkr-1  | 	... 7 more
ibkr-1  | 2024-01-16 15:01:04:807 IBC: detected frame entitled: News & Research; event=Opened
ibkr-1  | 2024-01-16 15:01:04:851 IBC: detected frame entitled: News & Research; event=Activated
ibkr-1  | 2024-01-16 15:01:04:852 IBC: detected frame entitled: News & Research; event=Focused
ibkr-1  | Exception in thread "JavaFX Application Thread" java.lang.UnsatisfiedLinkError: /opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/amd64/libjfxmedia.so: libasound.so.2: cannot open shared object file: No such file or directory
ibkr-1  | 	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
ibkr-1  | 	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
ibkr-1  | 	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
ibkr-1  | 	at java.lang.Runtime.load0(Runtime.java:809)
ibkr-1  | 	at java.lang.System.load(System.java:1086)
ibkr-1  | 	at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
ibkr-1  | 	at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
ibkr-1  | 	at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
ibkr-1  | 	at com.sun.media.jfxmediaimpl.NativeMediaManager.lambda$new$33(NativeMediaManager.java:115)
ibkr-1  | 	at java.security.AccessController.doPrivileged(Native Method)
ibkr-1  | 	at com.sun.media.jfxmediaimpl.NativeMediaManager.<init>(NativeMediaManager.java:106)
ibkr-1  | 	at com.sun.media.jfxmediaimpl.NativeMediaManager$NativeMediaManagerInitializer.<clinit>(NativeMediaManager.java:77)
ibkr-1  | 	at com.sun.media.jfxmediaimpl.NativeMediaManager.getDefaultInstance(NativeMediaManager.java:89)
ibkr-1  | 	at com.sun.media.jfxmedia.MediaManager.getSupportedContentTypes(MediaManager.java:50)
ibkr-1  | 	at com.sun.javafx.webkit.prism.PrismGraphicsManager.getSupportedMediaTypes(PrismGraphicsManager.java:154)
ibkr-1  | 	at com.sun.webkit.Timer.twkFireTimerEvent(Native Method)
ibkr-1  | 	at com.sun.webkit.Timer.fireTimerEvent(Timer.java:83)
ibkr-1  | 	at com.sun.webkit.Timer.notifyTick(Timer.java:64)
ibkr-1  | 	at javafx.scene.web.WebEngine$PulseTimer.lambda$null$2(WebEngine.java:1228)
ibkr-1  | 	at com.sun.javafx.application.PlatformImpl.lambda$null$402(PlatformImpl.java:295)
ibkr-1  | 	at java.security.AccessController.doPrivileged(Native Method)
ibkr-1  | 	at com.sun.javafx.application.PlatformImpl.lambda$runLater$403(PlatformImpl.java:294)
ibkr-1  | 	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
ibkr-1  | 	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
ibkr-1  | 	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$208(GtkApplication.java:245)
ibkr-1  | 	at java.lang.Thread.run(Thread.java:748)
ibkr-1  | #
ibkr-1  | # A fatal error has been detected by the Java Runtime Environment:
ibkr-1  | #
ibkr-1  | #  SIGSEGV (0xb) at pc=0x00007fd4ad6c35da, pid=45, tid=0x00007fd32c1906c0
ibkr-1  | #
ibkr-1  | # JRE version: Java(TM) SE Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
ibkr-1  | # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.202-b08 mixed mode linux-amd64 compressed oops)
ibkr-1  | # Problematic frame:
ibkr-1  | # V  [libjvm.so+0x6c35da]  jni_GetArrayLength+0x3a
ibkr-1  | #
ibkr-1  | # Core dump written. Default location: /settings/core or core.45
ibkr-1  | #
ibkr-1  | # An error report file with more information is saved as:
ibkr-1  | # /settings/hs_err_pid45.log
ibkr-1  | #
ibkr-1  | # If you would like to submit a bug report, please visit:
ibkr-1  | #   http://bugreport.java.com/bugreport/crash.jsp
ibkr-1  | #
ibkr-1  | /opt/ibc/scripts/ibcstart.sh: line 504:    45 Aborted                 (core dumped) "$java_path/java" -cp "$ibc_classpath" $java_vm_options$autorestart_option $entry_point "$ibc_ini" "$ib_user_id" "$ib_password" ${mode}
ibkr-1  | IBC returned exit status 134
ibkr-1  | autorestart file not found
ibkr-1  |
ibkr-1  | TWS finished
ibkr-1  |
ibkr-1 exited with code 134

Manual action needed for paper in stable and latest

Hi there,

first, thanks for the great work! Your docker solution is really helpful!

Sadly, when I run the gateway in paper mode, it will only accept connections after I manually closed the alert about using a paper account (see picture and logs). It says "Peer closed connection. clientId 4 already in use?" but as you can see on the first screenshot, it is not in use.

Any Ideas how I can solve this automatically without having to manually close the alert every time?

Logs:

2023-12-06 12:32:40 Connecting to IB...
2023-12-06 12:32:40 Trying to connect...
2023-12-06 12:32:41 Peer closed connection. clientId 4 already in use?
2023-12-06 12:32:45 API connection failed: TimeoutError()
2023-12-06 12:32:45 Connect failed
2023-12-06 12:32:45 Attempt 1 of max 10
2023-12-06 12:32:45 Retrying in 60 seconds...
2023-12-06 12:33:45 Peer closed connection. clientId 4 already in use?
2023-12-06 12:33:50 API connection failed: TimeoutError()
2023-12-06 12:33:50 Connect failed
2023-12-06 12:33:50 Attempt 2 of max 10
2023-12-06 12:33:50 Retrying in 60 seconds...
2023-12-06 12:34:51 Connected to IB

Screenshot 2023-12-06 at 12 34 11
Screenshot 2023-12-06 at 12 35 09

Container doesn't work on aarch64 machine

Trying to run the container on arm machine returns an error :
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Connecting to API at 8888 cause logout

Basicaly the title, when I try to connect to Trader Workstation API at port 8888, TraderWorkstation logs out.
I'm using latest stable version.

Do anyone else has same problem?

Setting localtime

this is part of my docker-compose.yaml amd I'm getting error below, did anyone solve it?
Host has right time.

  ibkr:
      image: ghcr.io/extrange/ibkr@sha256:905039e3388d10089b9d40bd33303e8eb9c261566f9b82357c0c739b82a236d6 # stable
      ports:
        - "127.0.0.1:6080:6080" # noVNC browser access
        - "127.0.0.1:8880:8888" # API access
      ulimits:
        nofile: 10000 # See FAQ
      environment:
        USERNAME: ${IBKR_USERNAME}
        PASSWORD: ${IBKR_PASSWORD}
      volumes:
        - /etc/localtime:/etc/localtime:ro
      restart: always

image

can't connect to gateway on paper, live works

ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:33:069 IBC: Starting Gateway
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:627 IBC: detected frame entitled: IB Gateway; event=Activated
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:635 IBC: detected frame entitled: IB Gateway; event=Focused
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:636 IBC: detected frame entitled: IB Gateway; event=Opened
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:637 IBC: Login dialog WINDOW_OPENED: LoginState is LOGGED_OUT
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:638 IBC: trading mode from settings: tradingMode=paper
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:639 IBC: Setting Trading mode = paper
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:743 IBC: Setting user name
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:744 IBC: Setting password
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:745 IBC: Login attempt: 1
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:37:766 IBC: Click button: Paper Log In
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:060 IBC: detected frame entitled: IB Gateway; event=Lost focus
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:061 IBC: detected frame entitled: IB Gateway; event=Deactivated
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:062 IBC: detected frame entitled: Loading...; event=Activated
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:082 IBC: detected frame entitled: Loading...; event=Focused
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:083 IBC: detected frame entitled: Loading...; event=Opened
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:084 IBC: Found Gateway main window
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:587 IBC: detected frame entitled: Loading...; event=Lost focus
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:588 IBC: detected frame entitled: Loading...; event=Deactivated
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:588 IBC: detected frame entitled: IB Gateway; event=Activated
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:590 IBC: detected frame entitled: IB Gateway; event=Focused
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:591 IBC: detected dialog entitled: Gateway; event=Opened
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:592 IBC: detected frame entitled: IB Gateway; event=Lost focus
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:593 IBC: detected frame entitled: IB Gateway; event=Deactivated
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:595 IBC: detected dialog entitled: Gateway; event=Activated
ibkr-docker-ib-gateway-1  | 2024-04-15 23:17:40:599 IBC: detected dialog entitled: Gateway; event=Focused
^CGracefully stopping... (press Ctrl+C again to force)

it seems like it can't push 2FA for paper trading mode, but live works.

Read file config blocked

Hi !

Thanks for your work !
I get stuck on this screen :
Capture d’écran 2022-01-08 à 15 51 48

I am not sure that this is the image that is the source of this problem, however I had these issues locally and on my Kubernetes cluster.
Furthermore, I can't find any specific logs to this issue ...

My config (basic):

FIX=no
IbLoginId=XXXXXX
IbPassword=XXXX
FIXLoginId=
FIXPassword=
ExitAfterSecondFactorAuthenticationTimeout=no
SecondFactorAuthenticationExitInterval=
TradingMode=paper
AcceptNonBrokerageAccountWarning=yes
LoginDialogDisplayTimeout = 60
IbDir=
StoreSettingsOnServer=
MinimizeMainWindow=no
ExistingSessionDetectedAction=manual
OverrideTwsApiPort=
ReadOnlyLogin=no
ReadOnlyApi=no
AcceptBidAskLastSizeDisplayUpdateNotification=accept
SendMarketDataInLotsForUSstocks=
IbAutoClosedown=yes
ClosedownAt=
AcceptIncomingConnectionAction=accept
AllowBlindTrading=no
SaveTwsSettingsAt=
DismissPasswordExpiryWarning=no
DismissNSEComplianceNotice=yes
ControlFrom=
BindAddress=
CommandPrompt=
SuppressInfoMessages=yes
LogStructureScope=known
LogStructureWhen=never

Has anyone ever had this?

Does not work on Apple silicon

The TWS installer comes with its own JVM that isn't compatible with mac silicon.

You get the following error:

#0 6.724 Error unpacking jar files. The architecture or bitness (32/64)
#0 6.724 of the bundled JVM might not match your machine.

Here is a nice writeup on how you can get around this by overriding the JVM used by the installer: https://trenki2.github.io/blog/2018/01/04/trading-with-raspberry-pi/

Note: you will need to download the installer sh file locally and modify it instead of using wget in the dockerfile.

Just leaving this info here in case someone else runs into this same issue.

Latest docker image should be TWS version 10.23.2a

Unfortunately the stable version currently does not work for me. I get an error "Download of settings failed". With the latest docker image 10.23.1q everything works fine.

Unfortunately this is not the latest version, I now get the following message:
Screenshot 2023-07-07 at 08 40 04 1

Is it possible to create a new image version which contains 10.23.2a? There already is a pull request for that version, but I cannot find the respective docker image on
https://github.com/extrange/ibkr-docker/pkgs/container/ibkr/versions?filters%5Bversion_type%5D=tagged

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.