Recently, Google Chrome is giving me these errors in the console window:
GET http://localhost:8080/event-stream?channel=home,events&t=1500371276974 net::ERR_INVALID_CHUNKED_ENCODING
ServerEvents Client won’t work either.
The strange thing is, if i run my application on regular .net 4.5 instead of by Mono Runtime, i don’t have these errors.
Also: should i use the Safari browser, is does work again. (regardless of host)
Which version of ServiceStack are you using? What operating system do you use to run mono? How do you run mono (xsp, self-hosting, fast-cgi)? And on which OS do you open chrome browser?
Also can you provide a standalone solution which we can run and see the issue?
Which version of ServiceStack are you using? 4.5.12
What operating system do you use to run mono? Both Mono on Mac as Mono on Linux
How do you run mono (xsp, self-hosting, fast-cgi)? Self hosting (AppSelfHostBase)
And on which OS do you open chrome browser? Both Windows and Mac Osx
Also can you provide a standalone solution which we can run and see the issue? I can see if i can put something together…
If I refresh the page I get the error ERR_INVALID_CHUNKED_ENCODING but only once, because connection is interrupted. After couple of seconds, it is restored and I get message events without errors like as before reload.
Maybe you have some proxy settings in chrome? And do you have this issue only in chrome? Do Firefox or IE/Edge raise this error?
Well, if i refresh the page; it seems to be hanging in this error loop or something , it won’t come out of. Also you can see there is a onConnect message everytime,so the connection looks like its being dropped or something.
I don’t get it… i will search some more on Chrome. I don’t have proxy settings, it happens on all Chrome browsers i tried so far. (Mac/Windows on Parallels) etc…
I was able to reproduce this issue when app and chrome both run on mono at OS X. I am trying to determine is it a mono or chrome issue and how it can be avoided.
Hey a lot of stability and performance issues are due to Mono and aren’t fixable within the framework, you should be planning your migration to .NET Core.
From what I found by analyzing packets between chrome and the running sample HttpListener on mono does not always correctly end the chunk when send it to the client. It sometimes adds the length of the next chunk to the end of the current chunk and then connection is dropped. Most of browser ignores these erroneous data, but chrome is more strict and assumes that the new chunk is started and should be completed in this connection. When it does not receive the data it shows this error message.
If switch from AppSelfHostBase to XSP the error is gone and ServerEvents works correctly with chrome on OS X. I’d recommend to switch to nginx+hyperfastcgi from AppSelfHost if you can’t move to .NET Core yet.