开云体育

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

IBC not able to authenticate after "Re-login is required"


 

I have been running TWS in paper trading mode using IBC for a while, last night I configured the TWS to autorestart, it did autorestart correctly as given in the attached log file, but after a few hours TWS threw a "Re-login is required" dialog, IBC tried to re-login but couldn't, and multiple re-logins attempts actually locked me out of the account asking to reset password.

Can someone please explain why in the first place that re-login was required, and why IBC was not able to authenticate it?

Below is attached the snippet of logs indicating above, and also is attached the complete log file.

Thanks

2024-07-12 23:46:41:632 IBC: Found TWS main window
2024-07-12 23:46:41:633 IBC: Login has completed
2024-07-12 23:46:43:504 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Lost focus
2024-07-12 23:46:43:505 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Deactivated
2024-07-12 23:46:43:505 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Activated
2024-07-12 23:46:43:506 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Focused
2024-07-12 23:46:43:507 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Opened
2024-07-12 23:46:43:508 IBC: detected frame entitled: Login; event=Closed
2024-07-12 23:46:43:508 IBC: detected frame entitled: Login; event=Closed
2024-07-12 23:46:43:510 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Lost focus
2024-07-12 23:46:43:512 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Deactivated
2024-07-12 23:46:43:512 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Activated
2024-07-12 23:46:43:513 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Focused
2024-07-12 23:46:51:951 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Lost focus
2024-07-12 23:46:51:952 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Deactivated
2024-07-12 23:46:51:953 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Activated
2024-07-12 23:46:51:955 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Focused
2024-07-12 23:46:57:971 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=State changed
2024-07-13 03:28:45:991 IBC: detected frame entitled: Connecting to server...; event=Opened
2024-07-13 03:28:46:218 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Lost focus
2024-07-13 03:28:46:219 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Deactivated
2024-07-13 03:28:46:220 IBC: detected frame entitled: Connecting to server...; event=Activated
2024-07-13 03:28:46:221 IBC: detected frame entitled: Connecting to server...; event=Focused
2024-07-13 06:40:46:237 IBC: detected dialog entitled: Re-login is required; event=Opened
2024-07-13 06:40:46:238 IBC: Re-login to session
2024-07-13 06:40:46:238 IBC: Click button: Re-login
2024-07-13 06:40:46:386 IBC: detected frame entitled: Attempt 163: Authenticating...; event=Lost focus
2024-07-13 06:40:46:386 IBC: detected frame entitled: Attempt 163: Authenticating...; event=Deactivated
2024-07-13 06:40:46:386 IBC: detected dialog entitled: Re-login is required; event=Activated
2024-07-13 06:40:46:402 IBC: detected dialog entitled: Re-login is required; event=Focused
2024-07-13 06:40:46:430 IBC: detected dialog entitled: Re-login is required; event=Lost focus
2024-07-13 06:40:46:430 IBC: detected dialog entitled: Re-login is required; event=Deactivated
2024-07-13 06:40:46:431 IBC: detected dialog entitled: Re-login is required; event=Closed
2024-07-13 06:40:46:431 IBC: detected frame entitled: Attempt 163: Authenticating...; event=Activated
2024-07-13 06:40:46:432 IBC: detected frame entitled: Attempt 163: Authenticating...; event=Focused
2024-07-13 06:40:46:612 IBC: detected frame entitled: Attempt 163: server error, will retry in seconds...; event=Lost focus
2024-07-13 06:40:46:612 IBC: detected frame entitled: Attempt 163: server error, will retry in seconds...; event=Deactivated
2024-07-13 06:40:46:670 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Activated
2024-07-13 06:40:46:671 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Focused
2024-07-13 06:40:46:677 IBC: detected dialog entitled: Login failed; event=Opened
2024-07-13 06:40:46:677 IBC: Login failed
2024-07-13 06:40:46:677 IBC: Ensure login frame visible
2024-07-13 06:40:46:688 IBC: Click button: OK


 

开云体育

The logfile you attached has a number of peculiarities that I first need to comment on.

?

First there is this series of consecutive entries:

?

2024-07-12 09:09:22:953 IBC: Starting TWS

ES2 Prism: Error - GLX extension is not supported

??? GLX version 1.3 or higher is required

Xlib:? extension "RANDR" missing on display ":1".

2024-07-12 13:09:33:520 IBC: detected frame entitled: Login; event=Opened

?

For some reason there is a nearly 4-hour gap between the first and the last. Normally I would expect this interval to be about 3 to 5 seconds. Can you throw any light on this? And can you try to get rid of the error messages regarding the GLX extension?(search online for ‘extension "RANDR" missing on display’).

?

The same sequence occurs later at 2024-07-12 19:45:26:152: again a 4-hour gap, at the same point in the start-up phase. Bizarre…

?

Also there is the following entry:

?

2024-07-12 19:45:26:063 IBC: Re-starting sessiohe restarted TWS doesn’t runn

?

IBC does indeed output this message: IBC: Re-starting session But where does he restarted TWS doesn’t run come from? IBC never outputs this anywhere. Have you tampered with the logfile?

?

Regarding your questions:

?

  • I suspect, but I don’t know, that TWS displayed the “Re-login is required’” dialog because it was now Saturday morning, and logins don’t always work on Saturdays. I thought I had improved IBC handling of this dialog in a previous release, but it’s clearly still not adequate. It’s tricky, because I can’t force this to happen, so it’s not possible to test systematically. But I think I understand better what I need to do now.
  • why IBC was not able to authenticate it?” – IBC doesn’t authenticate anything. All it does is the same things that the user has to do, ie enter the username and password and click the login button. In this case it didn’t do that because it didn’t detect the login dialog being made active – this’s what I need to try and fix

?

I’ll try to do this within the next couple of days.

?

?

?

?

From: [email protected] <[email protected]> On Behalf Of mubbashirali35@...
Sent: Saturday, July 13, 2024 5:01 PM
To: [email protected]
Subject: [ibc] IBC not able to authenticate after "Re-login is required"

?

I have been running TWS in paper trading mode using IBC for a while, last night I configured the TWS to autorestart, it did autorestart correctly as given in the attached log file, but after a few hours TWS threw a "Re-login is required" dialog, IBC tried to re-login but couldn't, and multiple re-logins attempts actually locked me out of the account asking to reset password.

Can someone please explain why in the first place that re-login was required, and why IBC was not able to authenticate it?

Below is attached the snippet of logs indicating above, and also is attached the complete log file.

Thanks

2024-07-12 23:46:41:632 IBC: Found TWS main window
2024-07-12 23:46:41:633 IBC: Login has completed
2024-07-12 23:46:43:504 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Lost focus
2024-07-12 23:46:43:505 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Deactivated
2024-07-12 23:46:43:505 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Activated
2024-07-12 23:46:43:506 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Focused
2024-07-12 23:46:43:507 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Opened
2024-07-12 23:46:43:508 IBC: detected frame entitled: Login; event=Closed
2024-07-12 23:46:43:508 IBC: detected frame entitled: Login; event=Closed
2024-07-12 23:46:43:510 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Lost focus
2024-07-12 23:46:43:512 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Deactivated
2024-07-12 23:46:43:512 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Activated
2024-07-12 23:46:43:513 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Focused
2024-07-12 23:46:51:951 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Lost focus
2024-07-12 23:46:51:952 IBC: detected frame entitled: DU2368051 Interactive Brokers (Simulated Trading); event=Deactivated
2024-07-12 23:46:51:953 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Activated
2024-07-12 23:46:51:955 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Focused
2024-07-12 23:46:57:971 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=State changed
2024-07-13 03:28:45:991 IBC: detected frame entitled: Connecting to server...; event=Opened
2024-07-13 03:28:46:218 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Lost focus
2024-07-13 03:28:46:219 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Deactivated
2024-07-13 03:28:46:220 IBC: detected frame entitled: Connecting to server...; event=Activated
2024-07-13 03:28:46:221 IBC: detected frame entitled: Connecting to server...; event=Focused
2024-07-13 06:40:46:237 IBC: detected dialog entitled: Re-login is required; event=Opened
2024-07-13 06:40:46:238 IBC: Re-login to session
2024-07-13 06:40:46:238 IBC: Click button: Re-login
2024-07-13 06:40:46:386 IBC: detected frame entitled: Attempt 163: Authenticating...; event=Lost focus
2024-07-13 06:40:46:386 IBC: detected frame entitled: Attempt 163: Authenticating...; event=Deactivated
2024-07-13 06:40:46:386 IBC: detected dialog entitled: Re-login is required; event=Activated
2024-07-13 06:40:46:402 IBC: detected dialog entitled: Re-login is required; event=Focused
2024-07-13 06:40:46:430 IBC: detected dialog entitled: Re-login is required; event=Lost focus
2024-07-13 06:40:46:430 IBC: detected dialog entitled: Re-login is required; event=Deactivated
2024-07-13 06:40:46:431 IBC: detected dialog entitled: Re-login is required; event=Closed
2024-07-13 06:40:46:431 IBC: detected frame entitled: Attempt 163: Authenticating...; event=Activated
2024-07-13 06:40:46:432 IBC: detected frame entitled: Attempt 163: Authenticating...; event=Focused
2024-07-13 06:40:46:612 IBC: detected frame entitled: Attempt 163: server error, will retry in seconds...; event=Lost focus
2024-07-13 06:40:46:612 IBC: detected frame entitled: Attempt 163: server error, will retry in seconds...; event=Deactivated
2024-07-13 06:40:46:670 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Activated
2024-07-13 06:40:46:671 IBC: detected frame entitled: Dow Jones Today's Top Ten; event=Focused
2024-07-13 06:40:46:677 IBC: detected dialog entitled: Login failed; event=Opened
2024-07-13 06:40:46:677 IBC: Login failed
2024-07-13 06:40:46:677 IBC: Ensure login frame visible
2024-07-13 06:40:46:688 IBC: Click button: OK


 

Thanks for the detailed reply, and sure I am looking into that extension RANDR missing.

As for the time difference, could it be due to timezone difference as my system timezone is Eastern which has exactly four hours difference with the UTC? For the "Re-starting sessiohe restarted TWS doesn’t runn", this line could have been tampered by me as I was looking into it on VSCode, might have pasted unknowingly what I was google searching that time, ignore it.

Also all of this happened again, TWS triggered relogin required and after excessive failed attempts I am again locked out of my account. While you are looking into IBC's handling of this dialog, is there a way to restrict IBC to stop attempting logins after x number of failures?

Thanks!


 

开云体育

Yes, that time difference must be due to timezone. So the timezone of your computer is America/New_York, as shown in the Java properties listing. But perhaps you have set the timezone in the TWS login options to be UTC? If so, then the start of the ‘time gap’ is presumably when TWS switches your Java VM from America/New_York to UTC. I don’t see any reason why this should cause any problems, but it might be worth doing some runs with TWS and the operating system both running in the same timezone.

?

My conjecture yesterday that the ‘relogin required’ might be due to it being Saturday is almost certainly incorrect. My paper-trading system runs all the way through from Sunday evening until restarting at 12:00 the following Sunday, and I’ve never seen ‘relogin required’.

?

If this is continuing to happen, it would be very helpful if you could run TWS manually (ie without using IBC), and note exactly what happens (there won’t be a useful logfile when the ‘relogin required’ occurs). It should behave exactly the same way when the Re-Login button is clicked as it does when run in IBC (because clicking that same button is all that IBC does here). But then something different ought to happen to enable or cause the re-login to actually take place, and I need to know what this is and why it isn’t happening when running under IBC.

?

I said yesterday that I thought I knew what to do to fix this, but after looking at the code for some time I realise that’s not the case. If I’m unable to make any headway with this, I’ll just have to use a brute force cold restart. For the paper-trading system that wouldn’t be too bad, but for a live system it would be unpleasant because it would mean the user having to do the 2FA alert acknowledgement, which would be unexpected and probably at an inconvenient time.

?

Regarding your suggestion of limiting the number of retries, I think that will sit nicely with the cold restart suggestion above. There is in fact a known reason for the ‘relogin required’ dialog to be displayed, which is when login to the same account is attempted at another TWS: IBC does handle this properly, but it cannot tell the difference between this valid reason and whatever is causing yours. IBC’s handling is the same in both cases (ie click the Re-Login button), so if that leads to a Login failed, then IBC could do a cold restart.

?

I’ll try to get that done tomorrow (Tuessday).


 

开云体育

I’ve produced a new IBC version, updated as per yesterday’s post.

?

I’ve labelled this as a beta, and I’ve put it on my OneDrive rather than uploading it to GitHub. You can get it here:

?

?

All you need to do to use this version is to extract the IBC.jar and version files into your IBC folder, overwriting the existing ones. Then run as normal.

?

If this new version encounters the ‘Login failed’ dialog, it should tidily shut down IBC and TWS, then immediately reload IBC and a new TWS instance, and do a full login.

?

As I said yesterday, this is not an ideal solution to the underlying issue here, ie the ‘Relogin is required’ message, but until we can get some information about what actually causes that, it will at least keep you going.


 

Thanks for getting this done.
?
I am running TWS manually today i.e. without IBC, I'll let you know how do things go with auto-restart functionality and whether I am encountered a relogin is required dialogue etc. Will report back here.
?
Meanwhile I am thinking to discuss this in TWS related groups too, to get an idea what is causing the "relogin is required"


 

So I tried running TWS Manually to see what's up with the "Relogin is required" dialogue.
?
I checked around 3AM ET, and that relogin is required dialogue was there, below is the screenshot attached for that. I am guessing this occurs around IB servers daily reset, I am assuming this as I saw some topics having same issue (Relogin is required) while daily reset is happening in the TWS group here. Once I clicked on the relogin button, I encountered login failed dialogue telling me "passwords are case sensitive", screenshot is attached below.
?
What is happening here? What password is it talking about as I am providing none, just clicking the Relogin button.
?
I'll also be posting this in the TWS group to understand what's actually going on here.
?
Thanks.
?


 

开云体育

Ok thanks. I guess that proves that this is not an IBC issue, though the update I provided should get you out of the hole it causes.

?

I suggest you take this up with IBKR directly (raise a ticket in Account Management).

?

It’s not at all appropriate to ask about this on the TWS API group, as this is nothing whatsoever to do with the API. So I’m going to reject your post to that group (I’m a moderator for that group too).

?

?

From: [email protected] <[email protected]> On Behalf Of mubbashirali35@...
Sent: Thursday, July 18, 2024 8:28 AM
To: [email protected]
Subject: Re: [ibc] IBC not able to authenticate after "Re-login is required"

?

So I tried running TWS Manually to see what's up with the "Relogin is required" dialogue.

?

I checked around 3AM ET, and that relogin is required dialogue was there, below is the screenshot attached for that. I am guessing this occurs around IB servers daily reset, I am assuming this as I saw some topics having same issue (Relogin is required) while daily reset is happening in the TWS group here. Once I clicked on the relogin button, I encountered login failed dialogue telling me "passwords are case sensitive", screenshot is attached below.

?

What is happening here? What password is it talking about as I am providing none, just clicking the Relogin button.

?

I'll also be posting this in the TWS group to understand what's actually going on here.

?

Thanks.

?