gnzsnz / ib-gateway-docker

Docker image with IB Gateway/TWS and IBC
https://github.com/users/gnzsnz/packages/container/package/ib-gateway
MIT License
278 stars 53 forks source link

I get a java error in docker logs just after login. #170

Closed eyalco closed 1 month ago

eyalco commented 2 months ago

Before you submit this issue

Describe the bug

  1. I use ghcr.io/gnzsnz/ib-gateway:latest pulled from repo not built locally.
  2. I use the default docker-compose.yml as on github with a local .env with my credentials and the default suggested values in the github repo.
  3. Login is successfull.
  4. I am able to connect with a python client app from another docker on port 4004.
  5. However just after login without any connection yet I see the following error in the docker logs for ib-gateway:

... 2024-09-19 07:27:46:000 IBC: Click button: OK 2024-09-19 07:27:46:143 IBC: detected dialog entitled: Warning; event=Lost focus 2024-09-19 07:27:46:143 IBC: detected dialog entitled: Warning; event=Deactivated 2024-09-19 07:27:46:144 IBC: detected dialog entitled: Warning; event=Closed 2024-09-19 07:27:46:196 IBC: detected dialog entitled: Pending Tasks; event=Closed 2024-09-19 07:27:46:198 IBC: detected dialog entitled: IBKR Gateway; event=Opened 2024-09-19 07:27:46:201 IBC: Click button: OK 2024-09-19 07:27:46:284 IBC: detected dialog entitled: IBKR Gateway; event=Activated 2024-09-19 07:27:46:286 IBC: detected dialog entitled: IBKR Gateway; event=Focused 2024-09-19 07:27:46:307 IBC: detected dialog entitled: IBKR Gateway; event=Lost focus 2024-09-19 07:27:46:309 IBC: detected dialog entitled: IBKR Gateway; event=Deactivated 2024-09-19 07:27:46:312 IBC: detected dialog entitled: IBKR Gateway; event=Closed 2024-09-19 07:27:46:314 IBC: detected dialog entitled: DUXXXXXXX Trader Workstation Configuration (Simulated Trading); event=Closed 2024-09-19 07:27:46:360 IBC: detected dialog entitled: Login Messages; event=Opened 2024-09-19 07:27:46:360 IBC: detected dialog entitled: Login Messages; event=Activated 2024-09-19 07:27:46:361 IBC: detected dialog entitled: Login Messages; event=Focused java.util.concurrent.CompletionException: java.lang.UnsatisfiedLinkError: /tmp/JxBrowser/7.29/libtoolkit.so: libgobject-2.0.so.0: cannot open shared object file: No such file or directory at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.UnsatisfiedLinkError: /tmp/JxBrowser/7.29/libtoolkit.so: libgobject-2.0.so.0: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1086) at com.teamdev.jxbrowser.internal.JniLibrary.loadLibrary(JniLibrary.java:53) at com.teamdev.jxbrowser.internal.JniLibrary.lambda$new$0(JniLibrary.java:47) at java.security.AccessController.doPrivileged(Native Method) at com.teamdev.jxbrowser.internal.JniLibrary.(JniLibrary.java:45) at com.teamdev.jxbrowser.internal.ToolkitLibrary.(ToolkitLibrary.java:37) at com.teamdev.jxbrowser.internal.ToolkitLibrary.instance(ToolkitLibrary.java:27) at com.teamdev.jxbrowser.internal.xz.JniResourceExtractor.extract(JniResourceExtractor.java:47) at com.teamdev.jxbrowser.internal.xz.XzExtractor.extract(XzExtractor.java:51) at com.teamdev.jxbrowser.internal.ChromiumExtractor.lambda$extract$0(ChromiumExtractor.java:38) at java.security.AccessController.doPrivileged(Native Method) at com.teamdev.jxbrowser.internal.ChromiumExtractor.extract(ChromiumExtractor.java:35) at com.teamdev.jxbrowser.engine.internal.EngineImpl.extractChromiumBinariesIfNecessary(EngineImpl.java:427) at com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:149) at com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:163) at feature.webapp.A.b(A.java:822) at feature.webapp.A.a(A.java:723) at feature.webapp.A.c(A.java:686) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) ... 7 more

To Reproduce

ib-gateway: restart: always

build:

#  context: ./latest
container_name: ib-gateway
image: ghcr.io/gnzsnz/ib-gateway:10.29.1h
environment:
  TWS_USERID: ${TWS_USERID}
  TWS_PASSWORD: ${TWS_PASSWORD}
  TRADING_MODE: ${TRADING_MODE:-paper}
  TWS_SETTINGS_PATH: ${TWS_SETTINGS_PATH:-}
  TWS_ACCEPT_INCOMING: ${TWS_ACCEPT_INCOMING:-}
  READ_ONLY_API: ${READ_ONLY_API:-}
  VNC_SERVER_PASSWORD: ${VNC_SERVER_PASSWORD:-}
  TWOFA_TIMEOUT_ACTION: ${TWOFA_TIMEOUT_ACTION:-exit}
  BYPASS_WARNING: ${BYPASS_WARNING:-}
  AUTO_RESTART_TIME: ${AUTO_RESTART_TIME:-}
  AUTO_LOGOFF_TIME: ${AUTO_LOGOFF_TIME:-}
  TWS_COLD_RESTART: ${TWS_COLD_RESTART:-}
  SAVE_TWS_SETTINGS: ${SAVE_TWS_SETTINGS:-}
  RELOGIN_AFTER_TWOFA_TIMEOUT: ${RELOGIN_AFTER_TWOFA_TIMEOUT:-no}
  TWOFA_EXIT_INTERVAL: ${TWOFA_EXIT_INTERVAL:-60}
  TWOFA_DEVICE: ${TWOFA_DEVICE:-}
  EXISTING_SESSION_DETECTED_ACTION: ${EXISTING_SESSION_DETECTED_ACTION:-primary}
  ALLOW_BLIND_TRADING: ${ALLOW_BLIND_TRADING:-no}
  TIME_ZONE: ${TIME_ZONE:-Etc/UTC}
  TZ: ${TIME_ZONE:-Etc/UTC}
  CUSTOM_CONFIG: ${CUSTOM_CONFIG:-NO}
  JAVA_HEAP_SIZE: ${JAVA_HEAP_SIZE:-}
  SSH_TUNNEL: ${SSH_TUNNEL:-}
  SSH_OPTIONS: ${SSH_OPTIONS:-}
  SSH_ALIVE_INTERVAL: ${SSH_ALIVE_INTERVAL:-}
  SSH_ALIVE_COUNT: ${SSH_ALIVE_COUNT:-}
  SSH_PASSPHRASE: ${SSH_PASSPHRASE:-}
  SSH_REMOTE_PORT: ${SSH_REMOTE_PORT:-}
  SSH_USER_TUNNEL: ${SSH_USER_TUNNEL:-}
  SSH_RESTART: ${SSH_RESTART:-}
  SSH_VNC_PORT: ${SSH_VNC_PORT:-}

volumes:

- ${PWD}/jts.ini:/home/ibgateway/Jts/jts.ini

- ${PWD}/config.ini:/home/ibgateway/ibc/config.ini

- ${PWD}/tws_settings/:${TWS_SETTINGS_PATH:-/home/ibgateway/Jts}

- ${PWD}/ssh/:/home/ibgateway/.ssh

# ports:
#   - "127.0.0.1:4001:4003"
#   - "127.0.0.1:4002:4004"
#   - "127.0.0.1:5900:5900"
# ports:
#   - "4001:4003"
#   - "4002:4004"
#   - "5900:5900"
networks:
  - edge-slim-server
mem_limit: 4g
ulimits:
  nofile:
    soft: 65536
    hard: 65536
deploy:
  resources:
    limits:
      memory: 4g

output of `docker compose config: services: ib-gateway: container_name: ib-gateway deploy: resources: limits: memory: "4294967296" environment: ALLOW_BLIND_TRADING: "no" AUTO_LOGOFF_TIME: "" AUTO_RESTART_TIME: 11:59 PM BYPASS_WARNING: "" CUSTOM_CONFIG: "NO" EXISTING_SESSION_DETECTED_ACTION: primary JAVA_HEAP_SIZE: "" READ_ONLY_API: "no" RELOGIN_AFTER_TWOFA_TIMEOUT: "no" SAVE_TWS_SETTINGS: "" SSH_ALIVE_COUNT: "" SSH_ALIVE_INTERVAL: "" SSH_OPTIONS: "" SSH_PASSPHRASE: "" SSH_REMOTE_PORT: "" SSH_RESTART: "" SSH_TUNNEL: "" SSH_USER_TUNNEL: "" SSH_VNC_PORT: "" TIME_ZONE: America/New_York TRADING_MODE: paper TWOFA_DEVICE: "" TWOFA_EXIT_INTERVAL: "60" TWOFA_TIMEOUT_ACTION: restart TWS_ACCEPT_INCOMING: "" TWS_COLD_RESTART: "" TWS_PASSWORD: XXXXXXXXXXXXXX TWS_SETTINGS_PATH: "" TWS_USERID: XXXXXXXXXXXXXXXX TZ: America/New_York VNC_SERVER_PASSWORD: XXXXXXXXXXXX image: ghcr.io/gnzsnz/ib-gateway:10.29.1h mem_limit: "4294967296" networks: edge-slim-server: null restart: always ulimits: nofile: soft: 65536 hard: 65536

Expected

A clear and concise description of what you expected to happen.

Container logs

If applicable, add the container logs docker logs <CONTAINER> or docker compose logs to help explain your problem. MANDATORY ⚠️⚠️

Versions

Please complete the following information:

eyalco commented 2 months ago

sorry for the formatting my docker compose had comments that were turned into markdown h1 headings

gnzsnz commented 2 months ago

besides the error in the log, is this causing any issue? can you use ibgateway?

it looks like an error on ibgateway it self, I don't think I can do anything from my side.

eyalco commented 2 months ago

I can use the gateway. no problems seen