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.02k stars 179 forks source link

Issue during maintenance window #264

Open ghost opened 1 month ago

ghost commented 1 month ago

Hello,

This morning I my ibc seemed to crash and I'm not sure why. Could I get some help with this? I've attached a screenshot of the exception received.

‏لقطة الشاشة ٢٠٢٤-٠٨-٠٩ في ٠٨ ٠٥ ٠١
rlktradewright commented 1 month ago

You need to post the whole IBC logfile, not just the bit you see on the screen. Attach it to your reply (don't quote it inline).

The exception is misleading. What has actually caused the shutdown is the Login Error dialog displayed by TWS at 04:40:11:681. When IBC encounters this all it can do is restart, so it attempts to close down TWS/Gateway tidily and exit, so that the script can re-start IBC which will then result in full authentication (with 2FA if this is a live account). Unfortunately there is evidently a bug in the closedown routine, and that's what is throwing the exception.

So the reason the Login Error dialog was displayed is entriely a amatter for IBKR. IBC is not the cause of it, it's just reacting to the fact that TWS has displayed it. If I had the full logfile, I might be able to deduce something because it contains a mass of useful information that is often helpful in diagnosing these things, but without that there's nothing I can say.

If for some reason you';re not using an IBC logfile, then this is a direct demonstation of why that's a bad idea. Without it I've no idea what IBC has been doing or how you've configured it. For example, at the most basic level I don't even know any of the following:

What I will do is investigate and fix the problem with the tidy closedown. At least then, if this happens again, everything will restart automatically.

rlktradewright commented 1 month ago

I've fixed the problem that caused the exception report. I'll publish a new release shortly containing this fix: version 3.20.0.

While doing this, I realised that the reason for the Login Error dialog is that the login credentials have expired or been invalidated. The usual reason for this is allowing TWS/Gateway to run right through the weekend without a complete shutdown and restart, which IBKR requires - see the note entitled Auto-Restart limitations and Cold Restart in config.ini.

There may be other reasons why IBKR would invalidate your credentials, but I have no further information about this.