Keyboard Shortcuts
Likes
Search
TWS or IBC times out while TWS panels and charts are loading
I have a strange problem that I have seen maybe a dozen times before. I log in with 2FA (face recognition on my iphone), TWS starts to display my (classic mode) quote panels, charts, and trading log window, and then everything shuts down. It always scares me. Once I had to wait half a day before I could get a login that would stick around for the week (auto-relogin every day). Otherwise, the whole setup works very well, and has been doing so since the beginning of the year.
Here is the IBC text displayed in read in the Windows command window. Does anyone have any tips or configuration changes that might help to avoid the (seemingly random) problem? If it helps any, I run the code on an AWS t3.large instance, which always feels slow. ?
+ IBC version 3.16.2
+ Running TWS 1019 at 2023-06-05 16:40:29.02
+
+ Diagnostic information is logged in:
+ C:\IBC\Logs\me\IBC-3.16.2_TWS-1019_MONDAY.txt
+
+ ** Caution: closing this window will close TWS 1019 **
+
The system cannot find the drive specified.
Second factor authentication dialog has timed out, IBC not restarted
+==============================================================================
+
+? ? ? ? ? ? ? ? ? ? ? ?**** An error has occurred ****
+
+ Error while: Running StartIBC.bat
+
+ ERRORLEVEL = 1111
+ Error: TWOFA_TIMEOUT_ACTION is set to : something wrong here
+ Please look in the diagnostics file mentioned above for further information
+============================================================================== The log file says: (note the weird Log4j Verd.x?) 2023-05-22 00:45:17:199 IBC: Login dialog WINDOW_OPENED: LoginState is LOGGED_OUT
2023-05-22 00:45:17:200 IBC: Setting Trading mode = live
2023-05-22 00:45:17:280 IBC: Setting user name
2023-05-22 00:45:17:284 IBC: Setting password
2023-05-22 00:45:17:287 IBC: Login attempt: 1
2023-05-22 00:45:17:352 IBC: Click button: Log In
2023-05-22 00:45:17:804 IBC: Button now disabled: Log In
2023-05-22 00:45:20:374 IBC: Detected dialog entitled: Second Factor Authentication; event=Closed
2023-05-22 00:45:20:377 IBC: Duration since login: 3 seconds
2023-05-22 00:45:20:377 IBC: If login has not completed, IBC will exit in 40 seconds
2023-05-22 00:45:22:844 IBC: Detected dialog entitled: Downloading settings from server; event=Closed
LogModuleConfigurator-Init: Log4j Ver2.x found on classpath
LogModuleConfigurator-Init: LogModuleConfigurator initialized with Log4j Verd.x
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2023-05-22 00:46:03:498 IBC: IBC closing because login has not completed after Second Factor Authentication
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2023-05-22 00:46:03:499 IBC: Exiting with exit code=1111
2023-05-22 00:46:03,718 JTS-AsyncNonLocked-35 WARN Unable to register Log4j shutdown hook because JVM is shutting down. Using SimpleLogger
Program has exited
Error level is 1111
Check for 2FA dialog timed out
2FA completion timed-out but TWOFA_TO_ACTION=EXIT so not restarting IBC
Normal exit
?
TWS finished at 2023-05-22? 0:46:04.49
IBC running TWS 1019 has finished at 2023-05-22? 0:46:04.51
I don't understand why IBC or TWS or whatever would close down when the login obviously worked and TWS was starting to display my trading screens. Any help or advice would be appreciated. Thank you. |
¿ªÔÆÌåÓýPlease reply to this with your complete logfile attached. I keep saying this over and over again: the logfile contains masses of information that may be helpful in diagnosing issues. If you don¡¯t give me that information, it¡¯s like having one hand tied behind my back and just wastes my time. ? And please attach the logfile: don¡¯t just quote it in the message. ? Richard |
¿ªÔÆÌåÓýOk, thanks for that. ? The short answer here is this: can you please set the value of SecondFactorAuthenticationExitInterval in config.ini to something higher than the default value (which is 40). I suggest: ? SecondFactorAuthenticationExitInterval=90 ? The slightly longer answer is that IBC is just not giving TWS long enough to get fired up before deciding that login hasn¡¯t worked. The default of 40 used to be adequate in most situations, but I¡¯ve noticed that recent TWS releases are often ?taking longer to get everything ready, and this is especially true if your computer is a little slow. In fact that¡¯s exactly the situation here, where I¡¯m running in a virtual machine on a 1.8GHz server from 2014, so not exactly speedy ¨C I have set this to 100. ? And here¡¯s a bit more info: the intention was that if IBC¡¯s auto-2FA restart facility is not in use, then IBC would just let TWS take as long as it wanted, and if for some weird reason it never got going properly then the user would be left to decide what to do. That¡¯s why the comment in config.ini for SecondFactorAuthenticationExitInterval says ¡®This setting is only relevant if ReloginAfterSecondFactorAuthenticationTimeout is set to 'yes', or if ExitAfterSecondFactorAuthenticationTimeout is set to 'yes'¡¯. However in fact, as you¡¯ve found, the SecondFactorAuthenticationExitInterval setting is actually always relevant. ? I will correct this flaw in the next release, and I¡¯ll also increase the default value.. ? Richard ? ? ? From: [email protected] <[email protected]> On Behalf Of Kevin Jameson
Sent: Tuesday, June 6, 2023 9:00 PM To: [email protected] Subject: Re: [ibc] TWS or IBC times out while TWS panels and charts are loading ? Here is my entire log file. |
When we moved from version 9 of TWS to version 10 we experienced generally slightly longer startup and restart times with the occasional very long delay. TWS and any open windows appeared to be frozen during these times, so we ran some network traces to see what is going on between TWS and the "outside" world. First of all, during startup and restart, V10 TWS performs many more interactions with IBKR than what comparable V9 TWS would do. But the biggest impact on startup time in general and the cause of all very long startup times was downloading, installing, and starting JxBrowser. While TWS/IBGW are still fundamentally Java 8 programs (and there is nothing wrong with that since Java 8 is a long-term support version along with Java 11, and Java 17), IBKR continuously upgrades the JavaFX GUI technology they use. And they take advantage of JxBrowser, a complete Chromium browser that is installed in /tmp/JxBrowser (on Linux). The current version 7.26 is just shy of 400MB when installed so it is no surprise that downloading, installing, and starting that browser may take some time. At least the peak delays are somewhat independent of how fast your server is. We have not analyzed what exactly triggers the download and installation during startup (other than cases after system reboot when /tmp is empty) and under what circumstances TWS reuses and existing installation, but we have occasionally seen multiple versions installed by the end of the week. I guess that was the long way of saying that peak startup times can be very long for TWS V10 and timeouts might have to increased considerably, as Richard suggested. ´³¨¹°ù²µ±ð²Ô On Wed, Jun 7, 2023 at 09:49 AM, Kevin Jameson wrote:
Thank you. I thought it might be a slow-machine timeout (I'm on AWS), but I was kind of following the instructions "Don't change anything below this line!" :-) |
¿ªÔÆÌåÓý´³¨¹°ù²µ±ð²Ô ? Thanks very much for that fascinating information. I¡¯ll consider adding something explicit to the IBC User Guide to point out the potential consequences of this, and what to do if it causes a problem. ? Richard ? |