UnusualAlpha / ib-gateway-docker

Docker image with IB Gateway and IBC
MIT License
233 stars 94 forks source link

fail to connect #110

Closed josephchenhk closed 1 year ago

josephchenhk commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce

  1. clone master branch and edit the docker-compose.yml file: replace 'latest' with 'stable'
  2. create .env in the same directory as docker-compose.yml, input the information for the following:
    TWS_USERID=myuserid
    TWS_PASSWORD=mypassword
    TRADING_MODE=paper
    READ_ONLY_API=no
  3. run docker-compose up

Expected behavior expect to connect ib normally

Container logs Starting ib-gateway-docker-master_ib-gateway_1 ... done Attaching to ib-gateway-docker-master_ib-gateway_1 ib-gateway_1 | ib-gateway_1 | ================================================================================ ib-gateway_1 | ib-gateway_1 | Starting IBC version on 2023-10-11 at 15:25:55 ib-gateway_1 | ib-gateway_1 | Operating system: Linux ca53af3cb547 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux ib-gateway_1 | ib-gateway_1 | Arguments: ib-gateway_1 | ib-gateway_1 | TWS version = 10.22.1m ib-gateway_1 | Program = Gateway ib-gateway_1 | Entry point = ibcalpha.ibc.IbcGateway ib-gateway_1 | --tws-path = /root/Jts ib-gateway_1 | --tws-settings-path = ib-gateway_1 | --ibc-path = /root/ibc ib-gateway_1 | --ibc-ini = /root/ibc/config.ini ib-gateway_1 | --mode = paper ib-gateway_1 | --java-path = ib-gateway_1 | --user = ib-gateway_1 | --pw = ib-gateway_1 | --fix-user = ib-gateway_1 | --fix-pw = ib-gateway_1 | ib-gateway_1 | ================================= ib-gateway_1 | Generating the classpath ib-gateway_1 | Classpath=/root/Jts/ibgateway/10.22.1m/jars/jackson-core-2.12.3.jar:/root/Jts/ibgateway/10.22.1m/jars/jts4launch-1022.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-linux64-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-swing-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/locales.jar:/root/Jts/ibgateway/10.22.1m/jars/log4j-api-2.17.1.jar:/root/Jts/ibgateway/10.22.1m/jars/log4j-core-2.17.1.jar:/root/Jts/ibgateway/10.22.1m/jars/total-2020.jar:/root/Jts/ibgateway/10.22.1m/jars/twslaunch-1022.jar:/root/Jts/ibgateway/10.22.1m/jars/twslaunch-install4j-1.12.jar:/root/Jts/ibgateway/10.22.1m/.install4j/i4jruntime.jar:/root/ibc/IBC.jar ib-gateway_1 | ib-gateway_1 | Generating the JAVA VM options ib-gateway_1 | Java VM Options=-Xmx768m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70 -Dtwslaunch.autoupdate.serviceImpl=com.ib.tws.twslaunch.install4j.Install4jAutoUpdateService -Dchannel=latest -Dexe4j.isInstall4j=true -Dinstall4jType=standalone -DjtsConfigDir=/root/Jts ib-gateway_1 | ib-gateway_1 | Determining the location of java executable ib-gateway_1 | Location of java executable=/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/bin ib-gateway_1 | ib-gateway_1 | Renaming IB's TWS or Gateway start script to prevent restart without IBC ib-gateway_1 | ib-gateway_1 | Starting Gateway with this command: ib-gateway_1 | "/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/bin/java" -cp "/root/Jts/ibgateway/10.22.1m/jars/jackson-core-2.12.3.jar:/root/Jts/ibgateway/10.22.1m/jars/jts4launch-1022.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-linux64-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-swing-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/locales.jar:/root/Jts/ibgateway/10.22.1m/jars/log4j-api-2.17.1.jar:/root/Jts/ibgateway/10.22.1m/jars/log4j-core-2.17.1.jar:/root/Jts/ibgateway/10.22.1m/jars/total-2020.jar:/root/Jts/ibgateway/10.22.1m/jars/twslaunch-1022.jar:/root/Jts/ibgateway/10.22.1m/jars/twslaunch-install4j-1.12.jar:/root/Jts/ibgateway/10.22.1m/.install4j/i4jruntime.jar:/root/ibc/IBC.jar" -Xmx768m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70 -Dtwslaunch.autoupdate.serviceImpl=com.ib.tws.twslaunch.install4j.Install4jAutoUpdateService -Dchannel=latest -Dexe4j.isInstall4j=true -Dinstall4jType=standalone -DjtsConfigDir=/root/Jts ibcalpha.ibc.IbcGateway "/root/ibc/config.ini" paper ib-gateway_1 | ib-gateway_1 | IBC Settings: ib-gateway_1 | AcceptBidAskLastSizeDisplayUpdateNotification=accept ib-gateway_1 | AcceptIncomingConnectionAction=reject ib-gateway_1 | AcceptNonBrokerageAccountWarning=yes ib-gateway_1 | AllowBlindTrading=no ib-gateway_1 | BindAddress= ib-gateway_1 | ClosedownAt= ib-gateway_1 | CommandPrompt= ib-gateway_1 | ControlFrom= ib-gateway_1 | DismissNSEComplianceNotice=yes ib-gateway_1 | DismissPasswordExpiryWarning=no ib-gateway_1 | ExistingSessionDetectedAction=primary ib-gateway_1 | ExitAfterSecondFactorAuthenticationTimeout=no ib-gateway_1 | FIX=no ib-gateway_1 | FIXLoginId= ib-gateway_1 | FIXPassword= ib-gateway_1 | IbAutoClosedown=yes ib-gateway_1 | IbDir=/root/Jts ib-gateway_1 | IbLoginId= ib-gateway_1 | IbPassword= ib-gateway_1 | LogStructureScope=known ib-gateway_1 | LogStructureWhen=never ib-gateway_1 | LoginDialogDisplayTimeout=60 ib-gateway_1 | MinimizeMainWindow=no ib-gateway_1 | OverrideTwsApiPort=4000 ib-gateway_1 | ReadOnlyApi=no ib-gateway_1 | ReadOnlyLogin=no ib-gateway_1 | SaveTwsSettingsAt= ib-gateway_1 | SecondFactorAuthenticationExitInterval= ib-gateway_1 | SecondFactorDevice= ib-gateway_1 | SendMarketDataInLotsForUSstocks= ib-gateway_1 | StoreSettingsOnServer= ib-gateway_1 | SuppressInfoMessages=yes ib-gateway_1 | TradingMode= ib-gateway_1 | End IBC Settings ib-gateway_1 | ib-gateway_1 | 2023-10-11 15:25:55:893 IBC: Version: 3.16.0 ib-gateway_1 | System Properties ib-gateway_1 | ------------------------------------------------------------ ib-gateway_1 | jtsConfigDir = /root/Jts ib-gateway_1 | java.runtime.name = Java(TM) SE Runtime Environment ib-gateway_1 | sun.boot.library.path = /usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/amd64 ib-gateway_1 | java.vm.version = 25.202-b08 ib-gateway_1 | java.vm.vendor = Oracle Corporation ib-gateway_1 | java.vendor.url = http://java.oracle.com/ ib-gateway_1 | path.separator = : ib-gateway_1 | java.vm.name = Java HotSpot(TM) 64-Bit Server VM ib-gateway_1 | file.encoding.pkg = sun.io ib-gateway_1 | user.country = US ib-gateway_1 | sun.java.launcher = SUN_STANDARD ib-gateway_1 | sun.os.patch.level = unknown ib-gateway_1 | java.vm.specification.name = Java Virtual Machine Specification ib-gateway_1 | user.dir = /root/Jts ib-gateway_1 | java.runtime.version = 1.8.0_202-b08 ib-gateway_1 | java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment ib-gateway_1 | java.endorsed.dirs = /usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/endorsed ib-gateway_1 | os.arch = amd64 ib-gateway_1 | java.io.tmpdir = /tmp ib-gateway_1 | line.separator = ib-gateway_1 | ib-gateway_1 | java.vm.specification.vendor = Oracle Corporation ib-gateway_1 | os.name = Linux ib-gateway_1 | sun.jnu.encoding = ANSI_X3.4-1968 ib-gateway_1 | java.library.path = /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib ib-gateway_1 | java.specification.name = Java Platform API Specification ib-gateway_1 | java.class.version = 52.0 ib-gateway_1 | sun.management.compiler = HotSpot 64-Bit Tiered Compilers ib-gateway_1 | exe4j.isInstall4j = true ib-gateway_1 | os.version = 5.10.104-linuxkit ib-gateway_1 | user.home = /root ib-gateway_1 | user.timezone = GMT ib-gateway_1 | java.awt.printerjob = sun.print.PSPrinterJob ib-gateway_1 | file.encoding = ANSI_X3.4-1968 ib-gateway_1 | java.specification.version = 1.8 ib-gateway_1 | java.class.path = /root/Jts/ibgateway/10.22.1m/jars/jackson-core-2.12.3.jar:/root/Jts/ibgateway/10.22.1m/jars/jts4launch-1022.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-linux64-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/jxbrowser-swing-7.29.jar:/root/Jts/ibgateway/10.22.1m/jars/locales.jar:/root/Jts/ibgateway/10.22.1m/jars/log4j-api-2.17.1.jar:/root/Jts/ibgateway/10.22.1m/jars/log4j-core-2.17.1.jar:/root/Jts/ibgateway/10.22.1m/jars/total-2020.jar:/root/Jts/ibgateway/10.22.1m/jars/twslaunch-1022.jar:/root/Jts/ibgateway/10.22.1m/jars/twslaunch-install4j-1.12.jar:/root/Jts/ibgateway/10.22.1m/.install4j/i4jruntime.jar:/root/ibc/IBC.jar ib-gateway_1 | user.name = root ib-gateway_1 | channel = latest ib-gateway_1 | java.vm.specification.version = 1.8 ib-gateway_1 | sun.java.command = ibcalpha.ibc.IbcGateway /root/ibc/config.ini paper ib-gateway_1 | java.home = /usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202 ib-gateway_1 | sun.arch.data.model = 64 ib-gateway_1 | user.language = en ib-gateway_1 | java.specification.vendor = Oracle Corporation ib-gateway_1 | awt.toolkit = sun.awt.X11.XToolkit ib-gateway_1 | java.vm.info = mixed mode ib-gateway_1 | java.version = 1.8.0_202 ib-gateway_1 | java.ext.dirs = /usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/ext:/usr/java/packages/lib/ext ib-gateway_1 | sun.boot.class.path = /usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/resources.jar:/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/rt.jar:/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/sunrsasign.jar:/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/jsse.jar:/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/jce.jar:/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/charsets.jar:/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/jfr.jar:/usr/local/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/classes ib-gateway_1 | java.vendor = Oracle Corporation ib-gateway_1 | file.separator = / ib-gateway_1 | twslaunch.autoupdate.serviceImpl = com.ib.tws.twslaunch.install4j.Install4jAutoUpdateService ib-gateway_1 | java.vendor.url.bug = http://bugreport.sun.com/bugreport/ ib-gateway_1 | install4jType = standalone ib-gateway_1 | sun.io.unicode.encoding = UnicodeLittle ib-gateway_1 | sun.cpu.endian = little ib-gateway_1 | sun.cpu.isalist = ib-gateway_1 | ------------------------------------------------------------ ib-gateway_1 | 2023-10-11 15:25:55:899 IBC: Using default settings provider: ini file is /root/ibc/config.ini ib-gateway_1 | 2023-10-11 15:25:55:900 IBC: Using default login manager: getting username and password from args ib-gateway_1 | 2023-10-11 15:25:55:900 IBC: Using default main window manager ib-gateway_1 | 2023-10-11 15:25:55:900 IBC: Using default trading mode manager: constructor parameter args: tradingMode=paper ib-gateway_1 | 2023-10-11 15:25:55:901 IBC: Using default config dialog manager ib-gateway_1 | 2023-10-11 15:25:55:904 IBC: CommandServer is not started because the port is not configured ib-gateway_1 | 2023-10-11 15:25:55:988 IBC: TWS Settings directory is: /root/Jts ib-gateway_1 | 2023-10-11 15:25:55:994 IBC: Ensuring /root/Jts/jts.ini contains required minimal lines ib-gateway_1 | 2023-10-11 15:25:55:995 IBC: Found setting: [Logon]/s3store=true ib-gateway_1 | 2023-10-11 15:25:55:995 IBC: Found setting: [Logon]/Locale=en ib-gateway_1 | 2023-10-11 15:25:55:995 IBC: Found setting: [Logon]/displayedproxymsg=1 ib-gateway_1 | 2023-10-11 15:25:55:995 IBC: Found setting: [Logon]/UseSSL=true ib-gateway_1 | 2023-10-11 15:25:55:996 IBC: Found setting: [IBGateway]/ApiOnly=true ib-gateway_1 | 2023-10-11 15:25:55:996 IBC: Confirmed /root/Jts/jts.ini contains required minimal lines ib-gateway_1 | 2023-10-11 15:25:55:997 IBC: Starting Gateway ib-gateway_1 | 2023-10-11 15:25:55:997 IBC: Starting session: will exit if login dialog is not displayed within 60 seconds ib-gateway_1 | 2023-10-11 15:25:57:151 IBC: Getting config dialog ib-gateway_1 | 2023-10-11 15:25:57:151 IBC: Creating config dialog future ib-gateway_1 | 2023-10-11 15:25:57:152 IBC: Getting main window ib-gateway_1 | 2023-10-11 15:25:57:152 IBC: Creating main window future ib-gateway_1 | 2023-10-11 15:25:57:151 IBC: Getting config dialog ib-gateway_1 | 2023-10-11 15:25:57:160 IBC: Waiting for config dialog future to complete ib-gateway_1 | 2023-10-11 15:25:58:259 IBC: Detected frame entitled: IBKR Gateway; event=Opened ib-gateway_1 | 2023-10-11 15:25:58:280 IBC: Detected frame entitled: IBKR Gateway; event=Activated ib-gateway_1 | 2023-10-11 15:25:58:283 IBC: Detected frame entitled: IBKR Gateway; event=Focused ib-gateway_1 | Forking :::4000 onto 0.0.0.0:4002

Versions (please complete the following information):

Additional context Add any other context about the problem here.

jackysywk commented 10 months ago

I had the same problem too. but i found changing the dockerfile settings could work.

ENV IB_GATEWAY_VERSION=10.19.1j (change to a workable version)