IbcAlpha / IBC

Automation of Interactive Brokers TWS. You can download the latest release here: https://github.com/ibcalpha/ibc/releases/latest
GNU General Public License v3.0
1.06k stars 185 forks source link

"Server disconnected" dialog not caught? #63

Closed tredondo closed 4 years ago

tredondo commented 5 years ago

Hi, I've noticed that the Gateway has been getting stuck after the forced weekend logout, instead of sending the authentication push message to my Android IBKR app. (That functionality works, I've tried it separately.)

I've attached a screenshot of the VNC session from this past Sunday, and the log file. Please let me know if I can provide mode information.

Thanks again for putting in so much work into ibc!

image

ibc-3.8.1_GATEWAY-972_Monday.txt

rlktradewright commented 5 years ago

Sorry for the delay in responding to this.

It's quite difficult to understand what's going on here. But it looks like Gateway has been displaying the 'Re-login is required' dialog regularly all morning, and IBC has been handling it. Then it appears that Gateway is waiting for an authentication code (from you phone presumably?). This doesn't arrive, so after a while the sequence repeats.. And I presume you're saying that the request to the phone isn't actually appearing on the phone?

At 11:49:04 Gateway displays a dialog entitled 'IB Gateway', which is presumably one of the ones visible in the screenshot? And presumably you weren't actually present, so it was ignored.

Then at 20:19:32 Gateway displays a frame (as opposed to a dialog) entitled 'IB Gateway', which is presumably the other one visible in the screenshot? And at that point you took the screenshot?

Then at 20:22:08 Gateway displayed another frame, this one entitled: 'IB Gateway. API Account: mpub', which is not visible in your screenshot (so I've no idea what it said).

And then finally at 20:22:47 Gateway shut down, having presumably given up after an epic of patient waiting for … what exactly?

So my question is, did you try clicking the OK buttons on the two dialogs visible in the screenshot? If so, what happened?

The thing is, it looks to me like IB are really not wanting to log you back on again, until you restart the Gateway. I had previously thought that that was the case anyway: with both TWS and Gateway you have to restart over the weekend, unless you're not using IBC in which case it will restart for you automatically. (However I note you're using Gateway 972, and I'm not sure what the current situation is with that.)

So, at present I don't have enough information to suggest anything other than simply restarting the gateway every Sunday.

If you can tell me more about what actually happens (with regard to the 2FA and the phone app), and whether clicking on these dialog boxes actually helps, then I could modify IBC to handle these dialogs/frames, but if clicking them doesn't help, then there would be no point.