16

I have a Go application with both http (on port 80) and https (on port 443) enabled.

I keep getting lots of these 3 kinds of error:

  • http2: server: error reading preface from client 79.49.31.60:37993: timeout waiting for client preface

  • http: TLS handshake error from 151.38.29.250:44235: EOF

  • http: TLS handshake error from 2.239.197.163:6742: read tcp x.xxx.xxx.xxx:443->2.239.197.163:6742: i/o timeout

can anyone explain what these refer to?

Note that: all these requests are coming from mobile browsers (on Android and iOS devices)

Daniele B
  • 19,801
  • 29
  • 115
  • 173
  • 2
    if these clients aren't yours, just ignore them. Poorly behaving clients, timeouts, and disconnects on the Internet are nothing new or unexpected. – JimB Sep 17 '16 at 13:40

1 Answers1

13
http2: server: error reading preface from client 79.49.31.60:37993: timeout waiting for client preface

This means that the client failed to send the http2 connection preface (https://www.rfc-editor.org/rfc/rfc7540#section-3.5) before the server timed out.

http: TLS handshake error from 151.38.29.250:44235: EOF

This means that while the server and the client were performing the TLS handshake, the server saw the connection being closed, aka EOF.

http: TLS handshake error from 2.239.197.163:6742: read tcp x.xxx.xxx.xxx:443->2.239.197.163:6742: i/o timeout

This means that while the server was waiting to read from the client during the TLS handshake, the client didn't send anything before closing the connection.

As @JimB pointed out, those are perfectly normal to see. If you think the timeouts are kicking in too soon, you can define custom ones by defining a custom net.http.Transport: https://golang.org/pkg/net/http/#Transport, and set higher values for timeouts.

Community
  • 1
  • 1
Frederik Deweerdt
  • 4,943
  • 2
  • 29
  • 31
  • 1
    Frederik, thanks for your valuable explanation. Considering that all these requests are coming from mobile browsers (on Android and iOS devices), do you see some specific reasons for this? Many thanks – Daniele B Sep 17 '16 at 16:45
  • Yes, mobile connections tend to have higher RTTs, lower bandwidth and see more packet loss. – Frederik Deweerdt Sep 17 '16 at 16:46
  • Have seen these errors pop up more often when the user's internet connection is too slow and the app build is too big. – Karan Jun 12 '19 at 01:16