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

Underrun error on COMPLETED_ORDER: End of message reached. Please report to https://github.com/stoqey/ib - code: 505 - reqId: -1 #223

Open
icocoding opened this issue Sep 21, 2024 · 1 comment

Comments

@icocoding
Copy link

readStr(): string {

In IB Gateway 10.19, an error occurred in orderDecoder.readShareholder() because the string has ended.

In the Decoder.readStr() method, if the string is no longer available, it should not throw an exception; instead, it should return null or an empty string.
Additionally, in the Decoder.readBool() method, it should return a default value if the boolean is not available.

@LimePixel
Copy link

LimePixel commented Oct 28, 2024

``I have also received this error on IB Gateway 10.19.

EDIT: It has started happening since the 29/10/2024 and hasn't stopped.
In my case what appears to be happening is an extra field has been added to the message received by the COMPLETED_ORDER API. My orders usually have combo legs on the contract so this extra field pushes everything up:
;;;731155060|1,732397574|-1,732829836|-1,734264089|1;4;731155060

this.contract.comboLegsDescription = this.decoder.readStr();

This causes the comboLegsDescription to be blank and the next field comboLegsCount to be the description.
const comboLegsCount = this.decoder.readInt();

It decodes it as 731155060 and therefore expects to find 731155060 comboLegs. This causes the appearance of an UnderrunError.
To get everything working again I updated line 3081:
this.contract.comboLegsDescription = this.decoder.readStr() || this.decoder.readStr();
which fixed the comboLegsDescription and got things running again.
I would love to work out why this has started happening and what could possibly have caused it. Is there a way to check if there have been updates on IB's side?

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