Hi Richard
Thanks again for your great work!
Just wanted to get your thoughts on some unexpected (?) behaviour on my end (Windows 10) Thanks!:
Attempt 1:
1. Run StartGateway.bat on my PC
2. Wait for Gateway to finish Start
3. Run Restart.bat (Repeated Attempt 1 by sending the RESTART command to the CommandServer for same result)
4. Gateway successfully restarts but there is a 2nd Gateway window at the login page.
5. Run Stop.bat
Result is IBC and the 2nd Gateway window at the login page are closed by Stop.bat but the logged in Gateway window remains
Attempt 2:
Same steps as above, but wait 5 minutes after running StartGateway.bat
Result is there are two Gateway windows attempting to login, one successfully logs in and the other says user already logged in.
Attempt 1 Logs:
2023-03-03 17:40:04:604 IBC: Using default login manager: getting username and password from args but not found. Will get from settings
2023-03-03 17:40:04:604 IBC: Using default main window manager
2023-03-03 17:40:04:604 IBC: Using default trading mode manager: constructor parameter args but trading mode not present - will be taken from settings
2023-03-03 17:40:04:605 IBC: Using default config dialog manager
2023-03-03 17:40:04:607 IBC: CommandServer is starting with port 7462
2023-03-03 17:40:04:634 IBC: CommandServer listening on addresses: 127.0.0.1,0:0:0:0:0:0:0:1,192.168.68.119,fd91:1c8e:8a6c:87c9:a4f2:4cb6:6317:60d2,fd91:1c8e:8a6c:87c9:194e:9d67:d5b7:cc25,fe80:0:0:0:b46d:6095:83d:fbf5%eth2; port: 7462
2023-03-03 17:40:04:634 IBC: CommandServer started and is ready to accept commands
2023-03-03 17:40:04:645 IBC: TWS Settings directory is: C:\Jts
2023-03-03 17:40:04:648 IBC: Ensuring C:\Jts\jts.ini contains required minimal lines
2023-03-03 17:40:04:648 IBC: Found setting: [Logon]/s3store=true
2023-03-03 17:40:04:649 IBC: Found setting: [Logon]/Locale=en
2023-03-03 17:40:04:649 IBC: Found setting: [Logon]/displayedproxymsg=1
2023-03-03 17:40:04:649 IBC: Found setting: [Logon]/UseSSL=true
2023-03-03 17:40:04:649 IBC: Found setting: [IBGateway]/ApiOnly=true
2023-03-03 17:40:04:649 IBC: Confirmed C:\Jts\jts.ini contains required minimal lines
2023-03-03 17:40:04:649 IBC: Starting Gateway
2023-03-03 17:40:04:649 IBC: Re-starting session
2023-03-03 17:40:06:447 IBC: Detected frame entitled: IB Gateway; event=Activated
2023-03-03 17:40:06:451 IBC: Detected frame entitled: IB Gateway; event=Focused
2023-03-03 17:40:06:452 IBC: Detected frame entitled: IB Gateway; event=Opened
2023-03-03 17:40:06:452 IBC: Login dialog WINDOW_OPENED: LoginState is LOGGED_OUT
2023-03-03 17:40:12:541 IBC: Detected frame entitled: IB Gateway; event=Lost focus
2023-03-03 17:40:12:542 IBC: Detected frame entitled: IB Gateway; event=Deactivated
2023-03-03 17:41:01:382 IBC: CommandServer: ControlFrom setting =
2023-03-03 17:41:01:382 IBC: CommandServer accepted connection from: /127.0.0.1
2023-03-03 17:41:01:551 IBC: CommandServer received command: RESTART
2023-03-03 17:41:01:551 IBC: Getting main window
2023-03-03 17:41:01:552 IBC: Creating main window future
2023-03-03 17:41:05:431 IBC: Detected frame entitled: IB Gateway; event=Activated
2023-03-03 17:41:05:433 IBC: Detected frame entitled: IB Gateway; event=Focused
2023-03-03 17:41:06:401 IBC: Detected frame entitled: IB Gateway; event=Lost focus
2023-03-03 17:41:06:401 IBC: Detected frame entitled: IB Gateway; event=Deactivated
2023-03-03 17:41:08:073 IBC: Detected frame entitled: IB Gateway; event=Activated
2023-03-03 17:41:08:074 IBC: Detected frame entitled: IB Gateway; event=Focused
2023-03-03 17:41:12:161 IBC: Detected frame entitled: IB Gateway; event=Lost focus
2023-03-03 17:41:12:161 IBC: Detected frame entitled: IB Gateway; event=Deactivated
2023-03-03 17:41:12:520 IBC: CommandServer: ControlFrom setting =
2023-03-03 17:41:12:520 IBC: CommandServer accepted connection from: /127.0.0.1
2023-03-03 17:41:12:671 IBC: CommandServer received command: STOP
2023-03-03 17:41:12:672 IBC: Closing command channel
2023-03-03 17:41:12:672 IBC: CommandServer closing
2023-03-03 17:41:12:673 IBC: Login has not completed: exiting immediately
2023-03-03 17:41:12:673 IBC: CommandServer is shutdown
Attempt 2:
2023-03-03 17:44:01:930 IBC: Using default login manager: getting username and password from args but not found. Will get from settings
2023-03-03 17:44:01:930 IBC: Using default main window manager
2023-03-03 17:44:01:931 IBC: Using default trading mode manager: constructor parameter args but trading mode not present - will be taken from settings
2023-03-03 17:44:01:931 IBC: Using default config dialog manager
2023-03-03 17:44:01:933 IBC: CommandServer is starting with port 7462
2023-03-03 17:44:01:959 IBC: CommandServer listening on addresses: 127.0.0.1,0:0:0:0:0:0:0:1,192.168.68.119,fd91:1c8e:8a6c:87c9:a4f2:4cb6:6317:60d2,fd91:1c8e:8a6c:87c9:194e:9d67:d5b7:cc25,fe80:0:0:0:b46d:6095:83d:fbf5%eth2; port: 7462
2023-03-03 17:44:01:959 IBC: CommandServer started and is ready to accept commands
2023-03-03 17:44:01:968 IBC: TWS Settings directory is: C:\Jts
2023-03-03 17:44:01:970 IBC: Ensuring C:\Jts\jts.ini contains required minimal lines
2023-03-03 17:44:01:970 IBC: Found setting: [Logon]/s3store=true
2023-03-03 17:44:01:970 IBC: Found setting: [Logon]/Locale=en
2023-03-03 17:44:01:970 IBC: Found setting: [Logon]/displayedproxymsg=1
2023-03-03 17:44:01:970 IBC: Found setting: [Logon]/UseSSL=true
2023-03-03 17:44:01:970 IBC: Found setting: [IBGateway]/ApiOnly=true
2023-03-03 17:44:01:970 IBC: Confirmed C:\Jts\jts.ini contains required minimal lines
2023-03-03 17:44:01:970 IBC: Starting Gateway
2023-03-03 17:44:01:970 IBC: Starting session: will exit if login dialog is not displayed within 60 seconds
2023-03-03 17:44:03:722 IBC: Detected frame entitled: IB Gateway; event=Activated
2023-03-03 17:44:03:729 IBC: Detected frame entitled: IB Gateway; event=Focused
2023-03-03 17:44:03:730 IBC: Detected frame entitled: IB Gateway; event=Opened
2023-03-03 17:44:03:730 IBC: Login dialog WINDOW_OPENED: LoginState is LOGGED_OUT
2023-03-03 17:44:03:730 IBC: Trading mode from settings: tradingMode=live
2023-03-03 17:44:03:730 IBC: Setting Trading mode = live
2023-03-03 17:44:03:816 IBC: Login attempt: 1
2023-03-03 17:44:03:826 IBC: Click button: Log In
2023-03-03 17:44:04:642 IBC: Detected frame entitled: IB Gateway; event=Lost focus
2023-03-03 17:44:04:643 IBC: Detected frame entitled: IB Gateway; event=Deactivated
2023-03-03 17:44:04:643 IBC: Detected frame entitled: Loading...; event=Activated
2023-03-03 17:44:04:647 IBC: Detected frame entitled: Loading...; event=Focused
2023-03-03 17:44:04:647 IBC: Detected frame entitled: Loading...; event=Opened
2023-03-03 17:44:04:647 IBC: Found Gateway main window
2023-03-03 17:44:05:205 IBC: Detected frame entitled: Loading...; event=Lost focus
2023-03-03 17:44:05:205 IBC: Detected frame entitled: Loading...; event=Deactivated
2023-03-03 17:44:05:205 IBC: Detected frame entitled: Authenticating...; event=Activated
2023-03-03 17:44:05:206 IBC: Detected frame entitled: Authenticating...; event=Focused
2023-03-03 17:44:05:206 IBC: Detected frame entitled: Authenticating...; event=Opened
2023-03-03 17:44:05:945 IBC: Detected frame entitled: Authenticating...; event=Lost focus
2023-03-03 17:44:05:945 IBC: Detected frame entitled: Authenticating...; event=Deactivated
2023-03-03 17:44:05:945 IBC: Detected dialog entitled: Second Factor Authentication; event=Activated
2023-03-03 17:44:05:947 IBC: Detected dialog entitled: Second Factor Authentication; event=Focused
2023-03-03 17:44:05:947 IBC: Detected dialog entitled: Second Factor Authentication; event=Opened
2023-03-03 17:44:05:947 IBC: Second Factor Authentication initiated
2023-03-03 17:44:11:750 IBC: Detected dialog entitled: Second Factor Authentication; event=Lost focus
2023-03-03 17:44:11:750 IBC: Detected dialog entitled: Second Factor Authentication; event=Deactivated
2023-03-03 17:44:11:751 IBC: Detected frame entitled: Authenticating...; event=Activated
2023-03-03 17:44:11:751 IBC: Detected frame entitled: Authenticating...; event=Focused
2023-03-03 17:44:11:752 IBC: Detected dialog entitled: Second Factor Authentication; event=Closed
2023-03-03 17:44:11:752 IBC: Duration since login: 7 seconds
2023-03-03 17:44:11:752 IBC: If login has not completed, IBC will exit in 40 seconds
LogModuleConfigurator-Init: Log4j Ver2.x found on classpath
LogModuleConfigurator-Init: LogModuleConfigurator initialized with Log4j Verd.x
2023-03-03 17:44:13:925 IBC: Detected frame entitled: Starting application...; event=Lost focus
2023-03-03 17:44:13:926 IBC: Detected frame entitled: Starting application...; event=Focused
2023-03-03 17:44:13:927 IBC: Detected frame entitled: Starting application...; event=Lost focus
2023-03-03 17:44:13:927 IBC: Detected frame entitled: Starting application...; event=Deactivated
2023-03-03 17:44:13:927 IBC: Detected frame entitled: IB Gateway; event=Activated
2023-03-03 17:44:13:928 IBC: Detected frame entitled: IB Gateway; event=Focused
2023-03-03 17:44:13:928 IBC: Detected frame entitled: Starting application...; event=Closed
2023-03-03 17:44:13:928 IBC: Login has completed
2023-03-03 17:44:22:499 IBC: Detected frame entitled: IB Gateway; event=Lost focus
2023-03-03 17:44:22:499 IBC: Detected frame entitled: IB Gateway; event=Deactivated
2023-03-03 17:48:52:617 IBC: CommandServer: ControlFrom setting =
2023-03-03 17:48:52:618 IBC: CommandServer accepted connection from: /127.0.0.1
2023-03-03 17:48:52:784 IBC: CommandServer received command: RESTART
2023-03-03 17:48:52:785 IBC: Getting main window
2023-03-03 17:48:52:785 IBC: Main window already found
2023-03-03 17:48:52:788 IBC: Setting auto-restart time to 05:49 PM
2023-03-03 17:48:52:789 IBC: Closing command channel
2023-03-03 17:48:52:789 IBC: Getting config dialog
2023-03-03 17:48:52:789 IBC: Creating config dialog future
2023-03-03 17:48:52:789 IBC: Getting main window
2023-03-03 17:48:52:789 IBC: Main window already found
2023-03-03 17:48:52:789 IBC: Getting main window
2023-03-03 17:48:52:789 IBC: Main window already found
2023-03-03 17:48:52:789 IBC: Invoking config dialog menu
2023-03-03 17:48:53:054 IBC: Detected dialog entitled: U9195885 Trader Workstation Configuration; event=Activated
2023-03-03 17:48:53:056 IBC: Detected dialog entitled: U9195885 Trader Workstation Configuration; event=Focused
2023-03-03 17:48:53:057 IBC: Detected dialog entitled: U9195885 Trader Workstation Configuration; event=Opened
2023-03-03 17:48:53:057 IBC: Got config dialog from future
2023-03-03 17:48:53:062 IBC: Setting Auto restart time
2023-03-03 17:48:53:086 IBC: Auto restart time changed from 05:40 PM to 05:49 PM
2023-03-03 17:48:53:095 IBC: Click button: OK
2023-03-03 17:48:53:172 IBC: Detected dialog entitled: U9195885 Trader Workstation Configuration; event=Closed
2023-03-03 17:48:53:172 IBC: Detected dialog entitled: U9195885 Trader Workstation Configuration; event=Lost focus
2023-03-03 17:48:53:172 IBC: Detected dialog entitled: U9195885 Trader Workstation Configuration; event=Deactivated
2023-03-03 17:48:53:172 IBC: Detected frame entitled: IB Gateway; event=Activated
2023-03-03 17:48:53:173 IBC: Detected frame entitled: IB Gateway; event=Focused
2023-03-03 17:49:00:205 IBC: Detected frame entitled: IB Gateway; event=Lost focus
2023-03-03 17:49:00:205 IBC: Detected frame entitled: IB Gateway; event=Deactivated
2023-03-03 17:49:00:205 IBC: Detected dialog entitled: Restart in progress; event=Activated
2023-03-03 17:49:00:206 IBC: Detected dialog entitled: Restart in progress; event=Focused
2023-03-03 17:49:00:207 IBC: Detected dialog entitled: Restart in progress; event=Opened
2023-03-03 17:49:00,523 JTS-IA Stopper-101 ERROR Attempted to append to non-started appender d
2023-03-03 17:49:00,524 JTS-IA Stopper-101 ERROR Attempted to append to non-started appender d
2023-03-03 17:49:00,525 NIA-Input-Queue-2 ERROR Attempted to append to non-started appender d
2023-03-03 17:49:00,525 NIA-Input-Queue-2 ERROR Attempted to append to non-started appender d
2023-03-03 17:49:01,622 pool-3-thread-1 ERROR Attempted to append to non-started appender f
Program has exited
Error level is 0
Check for 2FA dialog timed out
Check for login dialog display timeout
Check for restart
call :GetAutoRestartOption
Finding autorestart file
autorestart file found at C:\Jts\amgehjgmnolmhjbjhkdeojcddnkficaikkpcpjlj\autorestart
AUTORESTART_OPTION is -Drestart=amgehjgmnolmhjbjhkdeojcddnkficaikkpcpjlj
IBC will autorestart shortly