Closed 1984-mike closed 1 month ago
First, the lBC log file is not much help: that's because you used the deprecated LogComponents=yes
setting. This doesn't log any structure details for the Second Factor Authentication dialog, because in fact for some reason that dialog never raises an open event, so the structure logging routine ignores it ('yes' means log the open event only). LogComponents=all
would have caught it, as would the preferred LogStructureScope=known
with LogStructureWhen=activate
.
However in fact I didn't need that structure information anyway: I know that the structure of this dialog has not been changed, because I also use SecondFactorDevice=IB Key
all the time..
I also know that IBC handled the device selection correctly, because either it does or it writes one of several erro messages to the logfile - and there aren't any.
So what seems to be happening here is something I observe occasionally, where although the IB Key entry is correctly selected, the alert is not actually sent to the IBKR Mobile app. in these circumstances, trying again (ie shutting down IBC/TWS and starting again) usually succeeds.
To automate this retrying, set ReloginAfterSecondFactorAuthenticationTimeout=yes
in config.ini. You'll also need to set --on2fatimeout=restart
in the ibcstart.sh command, unless you have a periodic restart using cron or similar.
I have made the changes to config.ini you suggested as well as passing '--on2fatimeout=restart' to ibcstart.sh
TWS still waits in the Select second factor screen, nothing is sent to my phone. If I manually click the Ok button then I get the alert sent to my phone and I can log in.
Below ore the logs with the changes to config.ini
That latest logfile only covers about 11 seconds. Please give me a realistic one.
Start the thing up, and just wait. You need to wait for at least 3 minutes before intervening in any way. No time to explain why now.
@rlktradewright thanks for your help, I have left TWS running for 40-50 minutes, below are the logs
Ok, thanks for that. I'm beginning to understand what's going on here. In TWS 1016, IB changed the way the Second Factor Authentication dialog is generated: before that it was a separate dialog, but they changed it so that the Login dialog morphs into the Second Factor Authentication dialog by overlaying the relevant controls. This has the side effect that IBC doesn't receive the usual events notifying the opening of a dialog, so it fails to detect it, and therefore doesn't deal with it as it should.
So I had to develop a trick, whereby IBC monitors the title of the Login dialog and detects when it changes to "SECOND FACTOR AUTHENTICATION", after which it initiates the proper processing of the latter. Unfortunately this code is not being executed in all the cases where it should be, resulting in the failure to process the device selection.
It should be straightforward to correct this, but I won't do it until the weekend. So I hope I'll be able to publish a new release next week with the fix.
Thanks, really appreciate your help.
Ok, I now have a new version that I should correct the problem. This is a beta version, IBC 3.19.0-beta.2.
If this fixes the problem, I'll publish a new full release, so let me know how it goes.
You can download the new version from here:
https://1drv.ms/f/s!AlqfLEOWDJ9Zh-klxayDSKUDSpj0Ow?e=VBgR6x
The only files you need to update from the zip are IBC.jar
and version
.
You may notice that there is a new ColdRestartTime
setting in config.ini. This is not supported by the Linux scripts in this version, so please ignore it for now. I may include it in the next Release, or I may decide to drop it entirely.
Thank you so much for your help, it worked perfectly.
@rlktradewright would you be able to create a release with the changes?
Yes indeed I've been trying to find a time to do this. Sorry for the delay.
I'm going to be absent for a few days starting on 24 June, so I'll try to do the release before that. I'm also trying to set up a VPN server so that I can access my systems while I'm away.
At the very least I'll push all the updates to GitHub so I should be able to complete the release while I'm away even if I can't access my systems.
@1984-mike
Release 3.19.0 published today.
@rlktradewright Thanks again for all your help
Hi
I am having a problem where IBC is not selecting 'IB Key' as the 2nd factor device
Im running version 3.18.0
in the config.ini I have
SecondFactorDevice=IB Key
I see this was marked as resolved in 3.12.0-beta.2, I have tried running 3.12.0-beta.2 and does not work, could this be the version on TWS im running?
Im running TWS Build 10.19.2l![Screenshot 2024-05-08 114806](https://github.com/IbcAlpha/IBC/assets/936513/a139e915-2448-47d3-9b41-2ff08417d465)
Below is the log file, any help would be appreciated.
tws_logs.txt