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

System.Exception: 'Illegal leading byte in message: 51' #92

Closed
lovettchris opened this issue Jul 27, 2019 · 1 comment
Closed

System.Exception: 'Illegal leading byte in message: 51' #92

lovettchris opened this issue Jul 27, 2019 · 1 comment

Comments

@lovettchris
Copy link
Member

lovettchris commented Jul 27, 2019

Somehow my client is getting out of sync on the stream with the ImmortalCoordinator.

In debugging I find this code in Importal.cs:

int commitID = this._ambrosiaReceiveFromStream.ReadIntFixed();
bytesToRead = this._ambrosiaReceiveFromStream.ReadIntFixed();
long checkBytes = this._ambrosiaReceiveFromStream.ReadLongFixed();
long writeSeqID = this._ambrosiaReceiveFromStream.ReadLongFixed();

matches this code in ImmortalCoordinator.Committer.Commit:

_workStream.Write(buf, 0, length);

When I check the stream they are both using the same socket (inverse) port numbers for LocalPort and RemotePort so I'm sure this is the same socket, and when I step over the _workStream.Write call the commitID arrives in my client app. But a weird thing then happens, the bytesToRead seems to skip ahead 4 bytes missing the actual bytesToRead and throwing the stream out of sync resulting in reaching the error case:

var s = String.Format("Illegal leading byte in message: {0}", firstByte);

I have no idea why this is happening, very reproducible. But just once today, it didn't happen and my client/server were working perfectly. Also this is all running on localhost, same box, so unlikely to be network weirdness. Also the HelloWorld app works perfectly every time. Any ideas?

@lovettchris
Copy link
Member Author

Found the problem. I was building ambrosia latest bits locally, but every time I 'regenerated' my immportals_Generated project, the code generator was moving that library back to Nuget package 1.0.8 which is not compatible.

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

1 participant