如何修复 Azure 函数"inotify limit"错误



我正在尝试运行一个持久实体,我在这个问题中最初描述过这个实体。在试图解决这个问题的过程中,我在运行了几次后开始出现以下错误。

The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.

以下是错误的完整日志。有人能告诉我可能的原因并解决吗?

user:func1$ func start -p 8080
Found Python version 3.6.9 (python3).
Azure Functions Core Tools
Core Tools Version:       4.0.3971 Commit hash: d0775d487c93ebd49e9c1166d5c3c01f3c76eaaf  (64-bit)
Function Runtime Version: 4.0.1.16815

Functions:
Entityfn: entityTrigger
KWhCalculator: activityTrigger
Orch: orchestrationTrigger
Starter: eventHubTrigger
For detailed output, run func with --verbose flag.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 POST http://127.0.0.1:44825/AzureFunctionsRpcMessages.FunctionRpc/EventStream application/grpc -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'gRPC - /AzureFunctionsRpcMessages.FunctionRpc/EventStream'
[2022-01-24T10:58:42.582Z] Worker process started and initialized.
[2022-01-24T10:58:47.753Z] Host lock lease acquired by instance ID '000000000000000000000000A845906C'.
[2022-01-24T10:58:47.833Z] A host error has occurred during startup operation '9803b89f-6cf1-4fe1-a482-075e770a9fea'.
[2022-01-24T10:58:47.833Z] System.IO.FileSystem.Watcher: The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'gRPC - /AzureFunctionsRpcMessages.FunctionRpc/EventStream'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/2 POST http://127.0.0.1:44825/AzureFunctionsRpcMessages.FunctionRpc/EventStream application/grpc - - 200 - application/grpc 5879.0529ms
info: Grpc.AspNetCore.Server.ServerCallHandler[14]
Error reading message.
System.IO.IOException: The request stream was aborted.
---> Microsoft.AspNetCore.Connections.ConnectionAbortedException: The HTTP/2 connection faulted.
--- End of inner exception stack trace ---
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at System.IO.Pipelines.Pipe.DefaultPipeReader.GetResult(Int16 token)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2MessageBody.ReadAsync(CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at Grpc.AspNetCore.Server.Internal.PipeExtensions.ReadStreamMessageAsync[T](PipeReader input, HttpContextServerCallContext serverCallContext, Func`2 deserializer, CancellationToken cancellationToken)
info: Microsoft.AspNetCore.Server.Kestrel[32]
Connection id "0HMEV51U1VS7R", Request id "0HMEV51U1VS7R:00000001": the application completed without reading the entire request body.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 POST http://127.0.0.1:44825/AzureFunctionsRpcMessages.FunctionRpc/EventStream application/grpc -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'gRPC - /AzureFunctionsRpcMessages.FunctionRpc/EventStream'
[2022-01-24T10:58:49.902Z] Worker process started and initialized.
[2022-01-24T10:58:55.521Z] Host lock lease acquired by instance ID '000000000000000000000000A845906C'.
[2022-01-24T10:58:55.578Z] A host error has occurred during startup operation '3b77fea3-afd0-427c-9d79-3175d7f0b815'.
[2022-01-24T10:58:55.578Z] System.IO.FileSystem.Watcher: The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'gRPC - /AzureFunctionsRpcMessages.FunctionRpc/EventStream'
info: Grpc.AspNetCore.Server.ServerCallHandler[14]
Error reading message.
System.IO.IOException: The request stream was aborted.
---> Microsoft.AspNetCore.Connections.ConnectionAbortedException: The HTTP/2 connection faulted.
--- End of inner exception stack trace ---
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2MessageBody.ReadAsync(CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at Grpc.AspNetCore.Server.Internal.PipeExtensions.ReadStreamMessageAsync[T](PipeReader input, HttpContextServerCallContext serverCallContext, Func`2 deserializer, CancellationToken cancellationToken)
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/2 POST http://127.0.0.1:44825/AzureFunctionsRpcMessages.FunctionRpc/EventStream application/grpc - - 200 - application/grpc 6153.6504ms
info: Microsoft.AspNetCore.Server.Kestrel[32]
Connection id "0HMEV51U1VS7S", Request id "0HMEV51U1VS7S:00000001": the application completed without reading the entire request body.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 POST http://127.0.0.1:44825/AzureFunctionsRpcMessages.FunctionRpc/EventStream application/grpc -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'gRPC - /AzureFunctionsRpcMessages.FunctionRpc/EventStream'

重新启动VS代码并创建新的Azure Function项目没有帮助。

修复:我重新启动了我的系统,错误消失了。

原因:不确定,但看起来长时间在本地运行长JSON消息可能会在端口上打开很多侦听器

最新更新