简体   繁体   English

输入字符串包含非ASCII或空字符

[英]The input string contains non-ASCII or null characters

2016-12-02 02:54:39:180 [WARNING] Microsoft.AspNetCore.Server.Kestrel -    Connection processing ended abnormally
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException: The input string contains non-ASCII or null characters.
at Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure.MemoryPoolIteratorExtensions.GetAsciiString(MemoryPoolIterator start, MemoryPoolIterator end)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame.TakeStartLine(SocketInput input)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1.<RequestProcessingAsync>d__2.MoveNext()
2016-12-02 09:17:10:819 [ERROR] Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware - An unhandled exception has occurred: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Gillie.JobCenter.Controllers.WebApi.QuestionnairesController.<SaveConsultant>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.AspNetCore.Mvc.Internal.ObjectMethodExecutor.<CastToObject>d__40`1.MoveNext()

I've got this exception only once, and i can't reproduce. 我只有一次这个例外,我无法重现。 Maybe someone know situations when this error is appears and i will try to reproduce. 也许有人知道出现此错误的情况,我会尝试重现。

Rather than trying to guess at the input that can cause the error, you should probably be using HTTP log files to see what the actual request looked like. 您可能应该使用HTTP日志文件来查看实际请求的外观,而不是试图猜测可能导致错误的输入。 In my experience, staring at code without a really good clue to the source of a problem is unproductive. 根据我的经验,在没有找到问题根源的真正线索的情况下盯着代码是徒劳的。 If you can't easily reproduce the problem, it's unlikely that any amount of guesswork with the code is going to help. 如果你不能轻易地重现问题,那么对代码的任何猜测都不太可能有所帮助。 You should be approaching the problem from the other end: trying to reproduce it. 您应该从另一端接近问题:尝试重现它。 Identify the input that caused the error. 确定导致错误的输入。

EDIT: Have you Googled this error message? 编辑:你有Google搜索此错误消息? It looks like others are having problems with Kestrel giving this message due to some bad cookies from the client. 由于来自客户端的一些错误的cookie,看起来其他人因为Kestrel发出此消息而遇到问题。 It may be a Kestrel bug in cookie handling. 它可能是cookie处理中的红隼错误。 Perhaps just logging information about the cookies would be sufficient to identify the problem, and you would not need to log all the POST data. 也许只记录有关cookie的信息就足以识别问题,您不需要记录所有POST数据。 See https://github.com/aspnet/KestrelHttpServer/issues/949 请参阅https://github.com/aspnet/KestrelHttpServer/issues/949

Are you using an old version of Docker for Windows? 您使用旧版本的Docker for Windows吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM