Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to Re-Login #246

Open
akatsev opened this issue Dec 25, 2023 · 4 comments
Open

Failed to Re-Login #246

akatsev opened this issue Dec 25, 2023 · 4 comments

Comments

@akatsev
Copy link

akatsev commented Dec 25, 2023

Hi,

This morning I've got the same picture, but now there are no messages
Couldn't write to log file - java.io.IOException: write beyond end of stream
in the IBC log.
Initially there were lines up to 530 and then I pressed several times OK button on LOGIN FAILED dialog and then lines 531-588 were added. Eventually I closed IBC (line 589)

I hope for your kind help,
Sincerely,
A. Katsev.
IBC-3.18.0_TWS-1026_SUNDAY.txt

@rlktradewright
Copy link
Member

Ok, thanks.

Let me make an observation: there is absolutely no doubt that when a user sets up IBC by following the instructions and the locations and settings described in the User Guide, it just works. It's very simple to set up, there's hardly anything one needs to change, and it's all very straightforward.

So when someone reports that it's not working for them, it's clear to me that they've done something that's causing a problem.

Thus, what we have to find out here is what's different about your setup that is the cause of the problem. The actual way the problem manifests is that around 05:15 to 05:20, your TWS login is invalidated and it wants you to login again. Now, it would probably be possible to amend IBC to literally login again at this point, but I don't want to do that, because you really don't want to be having to do a 2FA login at that time every morning when you run your live account.

After spending a lot of time going over your logfiles and considering all the evidence, I think that I can definitely rule out the following non-standard aspects:

First, I don't think the fact that you're running under Administrator is likely to be the cause. I really do think this is not a good idea, and I would urge you to reconsider that, but I think that's just a distraction here.

Secondly, the fact that you have relocated the built-in Java VM to Program Files\Common Files shouldnb't be an issue. I actually do something very similar myself, so that TWS is installed by a user with administrative privileges, but runs under an ordinary unprivileged user.

The only thing I can see that might be an issue here is that your country is US, but your timezone is UTC. I can't imagine the mechanism by which this might cause the problem, so I'm clutching at straws here. But it's interesting that the time this problem occurs is during the nightly server reset period, so perhaps this arrangement is confusing something n IB's account server.

So here's what I'd like you to do:

  1. Change your TWS timezone to be your normal local timezone for your location, and run it again.

  2. If that doesn't help, then make the foliowing settings in config.ini (these settings are near the end of the file)

    LogStructureScope=all
    LogStructureWhen=activate

    Then run IBC until the 'Login failed' dialogs start happening around 5:15. Attach the logfile to your reply. This will collect a lot of information that will enable me to see exactly what TWS is displaying. Whether this info will actually help is another matter: time will tell...

And if none of this helps, the only thing left to suggest is that you just wipe out your IBC installation, uninstall and reinstall TWS from scratch, and set up IBC again following the instructions exactly.

@akatsev
Copy link
Author

akatsev commented Dec 26, 2023 via email

@rlktradewright
Copy link
Member

You say the problem appears on Sundays.

In that case, maybe you're not aware that you have to restart TWS and do a full logon every Sunday (incluiding 2FA if it's a live account)? You can't just let TWS keep running through the weekend. This is a hard-and-fast IBKR security rule, and IBC can't do anything about it.

So you need to make sure that TWS is shut down and restarted at some point on Sunday. The easiest way to do this is to set the ClosedownAt setting in config.ini. For example

ClosedownAt=15:00

Then restart TWS at some later point (you can automate this with Task Scheduler of course).

I didn't mention this before because: 1. You didn't say that the problem only occurred on Sundays; 2. The logfiles didn't appear to have the right information for this scenario; 3. I assumed that you were aware of the limitations of auto-restart.

So please check this out to make sure you're complying with the rule.

By the way, I urge you to think long and hard about the UTC aspect: the fact that you intend to operate your project in different regions doesn't strike me as being a reason to use UTC: it will create as many problems as it solves. But that's another topic...

@akatsev
Copy link
Author

akatsev commented Dec 27, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants