Kestrelhttpserver: Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe

Created on 8 Mar 2017  路  18Comments  路  Source: aspnet/KestrelHttpServer

Getting error hosted on linx, project is created in .net core API.
Connection id ""0HL35565198KS"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe

1 - Ready bug

Most helpful comment

@somsekhar I don't think I understand the fix. Where did you add a using block? Somewhere in your server code or did you make a client change?

All 18 comments

@somsekhar Do you get this every time you run your app or did you just see it once? Also, could you share the stack trace if possible?

Also, a test app on GitHub which repros this issue would be helpful.

Also, what version of the Kestrel package did you see this error with?

We are using Kestrel": "1.1.0"
I could see this most of the times, application is hanging and showing continuously loading

Error is
2017-03-22T03:11:05.5821980+05:30 [INF] Connection id ""0HL3G7878E9L1"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe

I'm also facing this issue.
Running in ubuntu 16.04, with nginx reverse-proxy.
supervisor doesn't restart the process after this error occurs because it doesn't crash - just freezes.
So each time I have to manually close it.

@somsekhar @Nucs Are either or both of you using unix socket with the nginx reverse proxy?

Found the issue
When connection is not getting closed this issue is coming
Getting continues requests and existing connections were opened,
after adding using block for the custom connection string issue got resolved.

@somsekhar I don't think I understand the fix. Where did you add a using block? Somewhere in your server code or did you make a client change?

I'm also getting this error on Ubuntu :( some assets fail to load on the web page and then I get a bunch of 502s and then the server crashes.

@halter73, I dunno exactly what you are asking but I hope this answers:
Let me know how can I help further.

server {
        server_name *.website.com website-rz.com;

        location / {
            proxy_pass      http://localhost:5000;
            proxy_cache_bypass      $http_upgrade;
            proxy_redirect          off;
            proxy_set_header        Host $host;
            proxy_http_version      1.1;
            proxy_set_header        Upgrade $http_upgrade;
            proxy_set_header        Connection keep-alive;

            client_max_body_size    10m;
            client_body_buffer_size 128k;
            proxy_connect_timeout   90;
            proxy_send_timeout      90;
            proxy_read_timeout      90;
            proxy_buffers           32 4k;
            proxy_set_header        X-Real-IP       $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        }
}


server {
        server_name *.website2.com website2.com;

        location / {
            proxy_pass      http://localhost:4000;
            proxy_cache_bypass      $http_upgrade;
            proxy_redirect          off;
            proxy_set_header        Host $host;
            proxy_http_version      1.1;
            proxy_set_header        Upgrade $http_upgrade;
            proxy_set_header        Connection keep-alive;

            client_max_body_size    10m;
            client_body_buffer_size 128k;
            proxy_connect_timeout   90;
            proxy_send_timeout      90;
            proxy_read_timeout      90;
            proxy_buffers           32 4k;
            proxy_set_header        X-Real-IP       $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        }
}

What exactly in that config resolved the issue?

@cesarbs It didn't, I posted it as a reply to "Are either or both of you using unix socket with the nginx reverse proxy?"

Client disconnects cause this error.

@muratg So will this message appear whenever the client disconnects? If so - the logging level should be reduced to INFO or even DEBUG.

I'm having the same error on official microsoft/dotnet:1.1.1-runtime docker image and result is as @CYBERRRR describes, server crashes (no longer responds successfully to any subsequent requests). Specifically in my case, my outgoing connections from the app to the SQL (for just the 1 docker container in the cluster of many VM hosts) fails and it gets taken out of the load balanced group as it's deemed unhealthy as no requests can be handled by that one container.

I can confirm that when this happens, it only effects the 1 container throwing the Error -32 EPIPE broken pipe error and server is unable to serve any requests once the first of these errors appear.

So it seems to fit the 'client disconnects' as the reason for error messages, but in my case I think there is a different cause. Just thought I'd further describe what I'm seeing in case others are having the same experience.

Do you have any idea why the outgoing SQL connections are failing? Why do you think this is related to the EPIPE error?

@halter73 still investigating, but just highlighting (probably not very well), this error can come up for various reasons and the 'client disconnects' is (potentially) more a symptom of another problem. Again, just putting my experiences here as this is the only visible error in my case and others may have the same experience and find this thread.

Just leaving this here incase others are seeing lots of Error -32 EPIPE broken pipe errors randomly in AWS ECS. I upgraded from Docker 1.12.4 to 17.0.3 (AWS ECS Optimized Image 2017-03-f) and after a few days the dropping of network access has not yet returned.

Other reading I did seemed to indicate this was a bad update to a Docker containers internal IP tables causing this outage and subsequently lots of Error -32 EPIPE broken pipe errors in the logs.

Was this page helpful?
0 / 5 - 0 ratings