开云体育

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

Accessing the gateway from another system on my local network

 

Hi all,

I need to access my ib gateway from another machine on my lan. I see a
setting for trusted IP addresses in the ibc configuration file. Is it still
the case that this setting applies only if the fixed setting is set to true?

Pranav


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

 

开云体育

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.

?


Re: 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.
?


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

 

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"


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

 

开云体育

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.


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

 

开云体育

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).


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

 

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!


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

 

开云体育

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


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


Re: Auto-login + TOTP feature?

 

开云体育

Sorry, no chance.

?

Consider what you’re suggesting: you want a mechanism that somehow gets the OTP from the authenticator app to IBC securely, so that IBC can then enter it into the TWS/Gateway login form. So the whole 2FA security would now be dependent on the security of that link (quite apart from the technical aspects of engineering such a link). Since this would be entirely out of IBKR’s control, it would probably be unacceptable to them (and I very much do not want to upset them in this respect).

?

Anyway, what’s the point? There is already a perfectly acceptable 2FA mechanism in IBKR Mobile, that uses only IBKR-developed and approved security mechanisms, and is trivially simple to use. IBC’s only involvement in this is to invoke the 2FA mechanism repeatedly until the user acknowledges the 2FA alert (it has absolutely no involvement in the actual security dialogue between TWS/Gateway and IBKR Mobile) . So why is there any incentive to want to develop another, much more complicated solution?

?

Incorporating a TOTP feature in IBC is a non-starter. I don’t see what it could possibly achieve.

?

Richard

?

From: [email protected] <[email protected]> On Behalf Of Justin C.
Sent: Friday, July 12, 2024 6:26 AM
To: [email protected]
Subject: [ibc] Auto-login + TOTP feature?

?

Hello,

Thanks for developing and maintaining IBC! ?Given IBKR’s recent secure login documentation update for mobile authenticators (), are there any plans to update IBC to be able to automatically enter a one time password like with the user name/password for gateway? ?Or I guess going slightly further, incorporating a TOTP feature in IBC?

Thanks!
Justin


Auto-login + TOTP feature?

Justin C.
 

Hello,

Thanks for developing and maintaining IBC! ?Given IBKR’s recent secure login documentation update for mobile authenticators (), are there any plans to update IBC to be able to automatically enter a one time password like with the user name/password for gateway? ?Or I guess going slightly further, incorporating a TOTP feature in IBC?

Thanks!
Justin


Re: Auto Restart error

 

Thank you for your time.

It seems the above file you mentioned didn't exist.?

TWS was up to date. I have re installed TWS and will continue testing.

Yes, I understand IBKRs Sunday requirement.
ClosedownAt=Saturday 08:00 coverts to Friday 18:00 EDT. I have it set to restart at Sunday 17:00 EDT, will this fulfill the requirement? or should I move the restart time to later??


Re: Auto Restart error

 

开云体育

Can you please delete this file:

?

C:\Jts\mknchjlmhhejmchbnjdpepiokfllkgpcfnnfmkfa\autorestart

?

This file contains encrypted login credentials that are used to re-establish the login session after an auto-restart without the user having to actually login again (or do their 2FA acknowledgement for a live account).

?

It looks like this file may have been corrupted somehow. After deleting it, when you run IBC again it will do a normal automatic login, and hopefully all will be well after that. If not, let me know and we’ll have to collect some diagnostics.

?

But can you please also make sure you’ve got the latest offline version of 10.30, as there do seem to have been some problems with it recently.

?

By the way, are you aware that you have to let TWS shut down completely on Sundays? I note that you have ClosedownAt=Saturday 08:00 in your config.ini. If you restarted it later on Saturday, and then let it run through to Monday, you would be failing to comply with this requirement – it has to be Sunday! Eventually you would then get something like what you experience, although the log messages don’t seem to be quite what I would expect.

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of Jacob Felice
Sent: Tuesday, July 2, 2024 9:05 PM
To: [email protected]
Subject: Re: [ibc] Auto Restart error

?

Edit- I should clarify it worked fine for the two days prior to the fault.?

?

On Wed, 3 Jul 2024 at 05:27, Jacob Felice <jfel1992@...> wrote:

Hi there,?

?

I'm testing IBC on paper for the first time.?

?

This morning TWS had failed to login and I was presented with a dialog box on the login window.

?

I'm not?sure where I am going wrong. Log attached. Any help would be much appreciated.?

?


Re: Auto Restart error

 

Edit- I should clarify it worked fine for the two days prior to the fault.?

On Wed, 3 Jul 2024 at 05:27, Jacob Felice <jfel1992@...> wrote:
Hi there,?

I'm testing IBC on paper for the first time.?

This morning TWS had failed to login and I was presented with a dialog box on the login window.

I'm not?sure where I am going wrong. Log attached. Any help would be much appreciated.?


Auto Restart error

 

Hi there,?

I'm testing IBC on paper for the first time.?

This morning TWS had failed to login and I was presented with a dialog box on the login window.

I'm not?sure where I am going wrong. Log attached. Any help would be much appreciated.?


Re: IBC 3.19.0

 

开云体育

Yes, Pranav. It’s not necessary to change config.ini unless you want to take advantage of new features.

?

?

From: [email protected] <[email protected]> On Behalf Of Pranav Lal
Sent: Monday, June 10, 2024 3:50 PM
To: [email protected]
Subject: Re: [ibc] IBC 3.19.0

?

Hi Richard,

?

I am upgrading in phases. I have changed the paper gateway’s configuration file. Will an older config.ini work with this version? I have not touched my live trading config.ini.

?

Pranav


Re: IBC 3.19.0

 

开云体育

Hi Richard,

?

I am upgrading in phases. I have changed the paper gateway’s configuration file. Will an older config.ini work with this version? I have not touched my live trading config.ini.

?

Pranav


Re: Starting TWS live and paper simultaneously

 

Creating a separate log-file folder for the papersession solved the problem.

Thanks again!!


Re: Starting TWS live and paper simultaneously

 

开云体育

Yes this still works if it’s set up right. In particular you need to makes sure that logfile folders are different for the two instances.

?

Attach the logfiles for both IBC instances, so I can see what’s going on (NB:? I want the IBC log files, not TWS).

?

From: [email protected] <[email protected]> On Behalf Of Despair
Sent: Sunday, June 9, 2024 7:31 PM
To: [email protected]
Subject: [ibc] Starting TWS live and paper simultaneously

?

There was a time when I could start two instances of the TWS (one in paper mode and one for live trading) simultaneously with IBC without problems. At some point this stopped working.?

When I have start my live session and then try to start the additional paper session the IBC window just opens and closes quickly. Can this still be done somehow?


Re: Starting TWS live and paper simultaneously

 

Yes. I do this. It’s explained in the user guide. Look towards the end in the section “Multiple IBC Instances.”