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
974 stars 174 forks source link

TWS restart issue in TWS Paper trading #231

Closed special007r closed 5 months ago

special007r commented 9 months ago

I started using IBC in Production first and never faced this issue. But now I am using with paper trading and almost everyday I encounter an issue where TWS wont start or restart after the daily schedule for example..... these are the errors that cause it and I dont know how to avoid it please? 2023-10-04 17:02:23:764 IBC: Getting main window 2023-10-04 17:02:23:764 IBC: Creating main window future 2023-10-04 17:02:29:407 IBC: detected frame entitled: Login; event=Activated 2023-10-04 17:02:29:409 IBC: detected frame entitled: Login; event=Focused 2023-10-04 17:02:29:409 IBC: detected frame entitled: Login; event=Opened 2023-10-04 17:02:29:410 IBC: Login dialog WINDOW_OPENED: LoginState is LOGGED_OUT 2023-10-04 17:02:29:412 IBC: detected frame entitled: Login; event=Lost focus 2023-10-04 17:02:29:413 IBC: detected frame entitled: Login; event=Deactivated 2023-10-04 17:02:29:413 IBC: detected dialog entitled: Re-login is required; event=Activated 2023-10-04 17:02:29:443 IBC: detected dialog entitled: Re-login is required; event=Focused 2023-10-04 17:02:29:444 IBC: detected dialog entitled: Re-login is required; event=Opened 2023-10-04 17:02:29:444 IBC: Re-login to session 2023-10-04 17:02:29:444 IBC: Click button: Re-login 2023-10-04 17:02:29:538 IBC: detected dialog entitled: Re-login is required; event=Lost focus 2023-10-04 17:02:29:539 IBC: detected dialog entitled: Re-login is required; event=Deactivated 2023-10-04 17:02:29:539 IBC: detected frame entitled: Login; event=Activated 2023-10-04 17:02:29:542 IBC: detected frame entitled: Login; event=Focused 2023-10-04 17:02:29:542 IBC: detected dialog entitled: Re-login is required; event=Closed 2023-10-04 17:02:29:750 IBC: detected frame entitled: Login; event=Lost focus 2023-10-04 17:02:29:751 IBC: detected frame entitled: Login; event=Deactivated 2023-10-04 17:02:29:751 IBC: detected dialog entitled: Login failed; event=Activated 2023-10-04 17:02:29:753 IBC: detected dialog entitled: Login failed; event=Focused 2023-10-04 17:02:29:754 IBC: detected dialog entitled: Login failed; event=Opened 2023-10-04 17:02:29:754 IBC: Login failed 2023-10-04 17:02:38:304 IBC: detected dialog entitled: Login failed; event=Lost focus 2023-10-04 17:02:38:304 IBC: detected dialog entitled: Login failed; event=Deactivated 2023-10-04 17:02:47:422 IBC: detected dialog entitled: Login failed; event=Activated 2023-10-04 17:02:47:425 IBC: detected dialog entitled: Login failed; event=Focused 2023-10-04 17:02:47:577 IBC: detected dialog entitled: Login failed; event=Lost focus 2023-10-04 17:02:47:578 IBC: detected dialog entitled: Login failed; event=Deactivated

IBKR_failed_login_demo

Gets stuck at the login screen and even manually I it wont work and have to restart IBC actually for it to work..

rlktradewright commented 9 months ago

Please reply with your IBC logfile ATTACHED - don't quote it. The whole log, extracts like the one above are not helpful.

special007r commented 9 months ago

Thansks, please find the full log attached IBC-3.18.0_TWS-1025_WEDNESDAY.txt

special007r commented 9 months ago

also something weird happened below around midnight and in the morning it was stuck at login still so I was disconnected since mid night ( full log attached in previous reply ): 2023-10-05 00:15:24:964 IBC: detected frame entitled: DU6180387 Interactive Brokers (Simulated Trading); event=Deactivated 2023-10-05 00:24:37,141 JTS-IASession-1 ERROR Attempted to append to non-started appender d 2023-10-05 00:24:37,141 NIA-Output-Queue-1 ERROR Attempted to append to non-started appender d 2023-10-05 00:24:37,211 NIA-Output-Queue-1 ERROR Attempted to append to non-started appender d 2023-10-05 00:24:37,213 JTS-IASession-1 ERROR Attempted to append to non-started appender d AWT-EventQueue-0: Couldn't write to log file - java.io.IOException: write beyond end of stream AWT-EventQueue-0: Couldn't write to log file - java.io.IOException: write beyond end of stream JTS-EMsgPacer-190: Couldn't write to log file - java.io.IOException: write beyond end of stream 2023-10-05 00:32:06:878 IBC: detected window: type=javax.swing.JWindow; event=Opened 2023-10-05 00:32:18:409 IBC: detected window: type=javax.swing.JWindow; event=Closed 2023-10-05 00:32:18:410 IBC: detected window: type=javax.swing.SwingUtilities$SharedOwnerFrame; event=Closed 2023-10-05 00:49:58:640 IBC: detected window: type=javax.swing.JWindow; event=Opened 2023-10-05 00:50:08:830 IBC: detected window: type=javax.swing.JWindow; event=Closed 2023-10-05 00:50:08:831 IBC: detected window: type=javax.swing.SwingUtilities$SharedOwnerFrame; event=Closed 2023-10-05 01:38:00:201 IBC: detected window: type=javax.swing.JWindow; event=Opened 2023-10-05 01:38:10:327 IBC: detected window: type=javax.swing.JWindow; event=Closed 2023-10-05 01:38:10:327 IBC: detected window: type=javax.swing.SwingUtilities$SharedOwnerFrame; event=Closed 2023-10-05 01:43:10,647 JTS-IASession-1 ERROR Attempted to append to non-started appender d 2023-10-05 01:51:34,021 NIA-Output-Queue-1 ERROR Attempted to append to non-started appender d 2023-10-05 02:05:21:883 IBC: detected frame entitled: Connecting to server...; event=Activated 2023-10-05 02:05:21:886 IBC: detected frame entitled: Connecting to server...; event=Focused 2023-10-05 02:05:21:886 IBC: detected frame entitled: Connecting to server...; event=Opened 2023-10-05 02:05:23,837 NIA-Output-Queue-1 ERROR Attempted to append to non-started appender d 2023-10-05 02:07:07:279 IBC: detected frame entitled: Attempt 7: Authenticating...; event=Lost focus 2023-10-05 02:07:07:279 IBC: detected frame entitled: Attempt 7: Authenticating...; event=Deactivated 2023-10-05 02:07:07:279 IBC: detected dialog entitled: Re-login is required; event=Activated 2023-10-05 02:07:07:283 IBC: detected dialog entitled: Re-login is required; event=Focused 2023-10-05 02:07:07:283 IBC: detected dialog entitled: Re-login is required; event=Opened 2023-10-05 02:07:07:284 IBC: Re-login to session 2023-10-05 02:07:07:284 IBC: Click button: Re-login 2023-10-05 02:07:07:372 IBC: detected dialog entitled: Re-login is required; event=Closed 2023-10-05 02:07:07:373 IBC: detected dialog entitled: Re-login is required; event=Lost focus 2023-10-05 02:07:07:373 IBC: detected dialog entitled: Re-login is required; event=Deactivated 2023-10-05 02:07:07:373 IBC: detected frame entitled: Attempt 7: Authenticating...; event=Activated 2023-10-05 02:07:07:374 IBC: detected frame entitled: Attempt 7: Authenticating...; event=Focused 2023-10-05 02:07:07:587 IBC: detected frame entitled: Attempt 7: server error, will retry in seconds...; event=Lost focus 2023-10-05 02:07:07:587 IBC: detected frame entitled: Attempt 7: server error, will retry in seconds...; event=Deactivated 2023-10-05 02:07:07:587 IBC: detected dialog entitled: Login failed; event=Activated 2023-10-05 02:07:07:590 IBC: detected dialog entitled: Login failed; event=Focused 2023-10-05 02:07:07:590 IBC: detected dialog entitled: Login failed; event=Opened 2023-10-05 02:07:07:590 IBC: Login failed 2023-10-05 07:04:58:320 IBC: detected dialog entitled: Login failed; event=Lost focus 2023-10-05 07:04:58:321 IBC: detected dialog entitled: Login failed; event=Deactivated 2023-10-05 07:04:58:321 IBC: detected frame entitled: DU6180387 Interactive Brokers (Simulated Trading); event=Activated 2023-10-05 07:04:58:324 IBC: detected frame entitled: DU6180387 Interactive Brokers (Simulated Trading); event=Focused 2023-10-05 07:04:58:325 IBC: detected dialog entitled: Login failed; event=Closed 2023-10-05 07:04:58:702 IBC: detected frame entitled: DU6180387 Interactive Brokers (Simulated Trading); event=Lost focus 2023-10-05 07:04:58:702 IBC: detected frame entitled: DU6180387 Interactive Brokers (Simulated Trading); event=Deactivated 2023-10-05 07:04:58:703 IBC: detected dialog entitled: Re-login is required; event=Activated 2023-10-05 07:04:58:707 IBC: detected dialog entitled: Re-login is required; event=Focused 2023-10-05 07:04:58:707 IBC: detected dialog entitled: Re-login is required; event=Opened 2023-10-05 07:04:58:708 IBC: Re-login to session 2023-10-05 07:04:58:708 IBC: Click button: Re-login

rlktradewright commented 9 months ago

The log file is full of messages like this:

JTS-CCPDispatcherS2-38: Couldn't write to log file - java.io.IOException: write beyond end of stream

These messages are created by TWS, not by IBC. Clearly there is something that TWS is unhappy about: perhaps you've run out of disk space?

I really can't do anything with this until you get TWS working properly. Please check to see if you are indeed short of space, and if so clear some space on the drive.

If that is not the problem, the only thing I can suggest is to download and install the latest version of TWS 10.25, which is 10.25.1j, and see if that helps.

special007r commented 9 months ago

Thanks, I just realised something that I was using my Prod username/password and not sure if thats an issue. I just started using my demo username ( which IB does give a diffferent one it seems although the prod worked too ).. not sure if some 2FA related issue as there is none in paper/demo but will try also your suggestions and see if its any better... will let you know what i find.. thanks alot

rlktradewright commented 9 months ago

Well, you've got TradingMode=paper in config.ini, so if you use your live account's username and password with that I can imagine it would cause problems. But I'd be surprised if that was the cause of all the Java messages.

Actually I just tried my live account credentials with TradingMode=paper and it just logged me in fine to the paper trading account. I'd forgotten about that.

special007r commented 9 months ago

Yes correct it does log me fine too but then either during the daily restart, it fails or sometimes randomly not sure probably if connection is lost or something.. definitely there is something specific to paper trading mode... I only started using Paper trading as I need to test something for about a month.. prior to this I only used Production with IBC and never had an issue for over a year or so... anyway will let you know if I find anything.. thanks again