omnisharp-roslyn icon indicating copy to clipboard operation
omnisharp-roslyn copied to clipboard

System.NullReferenceException throw in v1.37.12 to v1.37.16 when access /checkreadystatus endpoint

Open xiguichen opened this issue 3 years ago • 4 comments

Roslyn currently have problem when access /checkreadystatus endpoint, following exception will be throw

System.NullReferenceException HResult=0x80004003 Source=Microsoft.AspNetCore.Server.Kestrel.Core StackTrace: at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.CreateResponseHeader(Boolean appCompleted) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.InitializeResponseAsync(Int32 firstWriteByteCount) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.WriteAsync(ReadOnlyMemory`1 data, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponseStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count) at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.IO.StreamWriter.Dispose(Boolean disposing) at System.IO.TextWriter.Dispose() at OmniSharp.Http.Middleware.MiddlewareExtensions.WriteJson(HttpResponse response, Object value) in C:\Users\xiguic\develop\omnisharp-roslyn\src\OmniSharp.Http\Middleware\MiddlewareExtensions.cs:line 20

This exception was originally thrown at this call stack: [External Code] OmniSharp.Http.Middleware.MiddlewareExtensions.WriteJson(Microsoft.AspNetCore.Http.HttpResponse, object) in MiddlewareExtensions.cs

The problem was first introduced in v1.37.12.

Can someone help to fix?

xiguichen avatar Oct 30 '21 10:10 xiguichen

I am seeing this error too. I am guess it is the same issue as this, but the fix there doesn't appear to be applicable to .NET Framework.

mispencer avatar Nov 16 '21 14:11 mispencer

This appears to be caused by the upgrade to ASP.NET Core 2.2.0. Downgrading back to 2.1.1 like I have done in this branch in my fork appears to solve this issue, but likely causes other issues and upgrading to a newer version would be a more proper solution anyway.

mispencer avatar Nov 16 '21 17:11 mispencer

This continues to be a blocking issue for our use case.

mispencer avatar Mar 30 '22 15:03 mispencer

This continues to block us upgrading.

puremourning avatar Aug 13 '22 16:08 puremourning