¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

TWS asks for 2FA every 24 hours even though "Auto restart" for one week enabled


 

I'm using IBC 3.16 and TWS 10.19 with "Auto restart" enabled at 2:30am.? The first run of IBC+TWS was Sunday at 3:42am, but on Monday at 3:42 I'm asked for 2FA.? The expected behavior is no 2FA for one week, which is the case when running TWS directly without IBC.

1) See attached?TWS Lock and Exit settings.jpg
2) See attached?IBC-3.16.0_TWS-1019_MONDAY.txt?
Is this the issue, where is this file supposed to be?:
"Finding autorestart file
INFO: Could not find files for the given pattern(s).
autorestart file not found "

Thank you!


 

3) See attached?C:\Jts\launcher.log ( as opposed to C:\Jts\1019\launcher.log which is not written to when using IBC )?
There was a Monday 2:30am restart as expected, with no 2FA.?
But then again at 3:42am, 24 hours after original start of IBC+TWS it restarted again and asked for 2FA, which was not as expected..


 

¿ªÔÆÌåÓý

If you started it at 03:42 on Sunday, then I think it will assume that it was a start in the week that ENDS on that Sunday. So when it gets to the configured auto-restart time it thinks it hasn¡¯t done the required Sunday login for this week, and so it does a full 2FA login.

?

I don¡¯t quite understand your second email, which says there WAS a Monday 2:30 am restart without 2FA, but the single log file you sent doesn¡¯t seem consistent with this.

?

I presume these 3:42am starts are via Task Scheduler?

?

I suggest you do the starts at a later time? Since the first one is on a Sunday when the markets are closed, I can¡¯t see any reason why you shouldn¡¯t start later in the day, say 14:00 EST.

?

I do my starts at 22:15 UK time, which is 17:15 EST (most of the time, except during the weeks where the UK and US haven¡¯t both transitioned to DST on the same day). This is conveniently at a time where nothing seems to be happening in the US markets.

?

By the way, the messages:

?

"Finding autorestart file

INFO: Could not find files for the given pattern(s).

autorestart file not found "

?

are expected when IBC is checking to see whether this is an auto-restart situation. If there is no autorestart file, it¡¯s a full restart (that annoying INFO message is output by the DOS ¡®where¡¯ command, and I haven¡¯t found a way to suppress it).

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of Mark Dabrowski via groups.io
Sent: 30 January 2023 09:10
To: [email protected]
Subject: [ibc] TWS asks for 2FA every 24 hours even though "Auto restart" for one week enabled

?

I'm using IBC 3.16 and TWS 10.19 with "Auto restart" enabled at 2:30am.? The first run of IBC+TWS was Sunday at 3:42am, but on Monday at 3:42 I'm asked for 2FA.? The expected behavior is no 2FA for one week, which is the case when running TWS directly without IBC.

1) See attached?TWS Lock and Exit settings.jpg
2) See attached?IBC-3.16.0_TWS-1019_MONDAY.txt?
Is this the issue, where is this file supposed to be?:
"Finding autorestart file

INFO: Could not find files for the given pattern(s).

autorestart file not found "


Thank you!


 

As seen in the attached scheduled task history, it's the culprit..? I guess I need to disable it and enable it at exactly 2:32am, my first trigger time?

Again, as per today's C:\Jts\launcher.log
it does the 2:30 restart as expected without 2FA:
2023-01-31 02:30:24.899 [GU] INFO? [JTS-Main] - ------------------------------- TWS RESTART --------------------------------

but then the scheduled task launches at 3:42am (when I must have originally enabled the scheduled task) asking for 2FA every day:
2023-01-31 03:42:06.828 [PF] INFO? [JTS-Main] - ------------------------------- TWS RESTART --------------------------------


 

¿ªÔÆÌåÓý

The screenshot shows that the first task is being stopped at 03:36:57 because it reaches its timeout. That means that when the next schedule start arrives at 03:42:01, it is no longer running, so a new task is started and this will be a new launch of TWS, and hence a full login.

?

There shouldn¡¯t be any time limits to the tasks. If you think about the normal case where the thing loads up on Sunday and keeps running (and auto-restarting daily) all week, that is all the one task (the task being the instance of the batch file, not the instance of TWS which of course is reloaded each day at restart).

?

You don¡¯t need the task start time and the auto-restart time to be the same. It won¡¯t help if the task has a defined timeout.

?

By the way, launcher.log is not really relevant, as it contains no information relevant to IBC. The IBC logfile is much more useful.

?

?

?

?

From: [email protected] <[email protected]> On Behalf Of Mark Dabrowski via groups.io
Sent: 31 January 2023 14:12
To: [email protected]
Subject: Re: [ibc] TWS asks for 2FA every 24 hours even though "Auto restart" for one week enabled

?

As seen in the attached scheduled task history, it's the culprit..? I guess I need to disable it and enable it at exactly 2:32am, my first trigger time?

Again, as per today's C:\Jts\launcher.log
it does the 2:30 restart as expected without 2FA:
2023-01-31 02:30:24.899 [GU] INFO? [JTS-Main] - ------------------------------- TWS RESTART --------------------------------

but then the scheduled task launches at 3:42am (when I must have originally enabled the scheduled task) asking for 2FA every day:
2023-01-31 03:42:06.828 [PF] INFO? [JTS-Main] - ------------------------------- TWS RESTART --------------------------------


 

Thank you Richard.? I modified the scheduled task?
from
Start TWS Live (daily)
to
Start TWS Live (weekly)
starting Sunday and running for 6 days, checking if it runs every 10 minutes