[GH-ISSUE #136] too many open connections on socket after 3 hours of running the client #84

Open
opened 2026-05-05 11:00:16 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @tylkomat on GitHub (Aug 28, 2021).
Original GitHub issue: https://github.com/mmatczuk/go-http-tunnel/issues/136

After 3 hours of running the client I get the following errors in the log (replaced IPs and Ports with placeholders)

proxy TCP level 1 msg TCP keepalive for tunneled connection failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err file tcp 127.0.0.1:33662->LOCAL_IP_PORT: fcntl: too many open files
proxy TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files
proxy TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files
TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files
TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files
proxy TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files
http: proxy error: dial tcp LOCAL2_IP_PORT: socket: too many open files

I configured two tunnels which are called quite often, the http tunnelevery 5 minutes and the tcp every couple of seconds. This is my config:

server_addr: TUNNEL_IP_PORT
tls_crt: TLS_CRT
tls_key: TLS_KEY
root_ca: ROOT_CRT
tunnels:
  tunnel1:
    proto: tcp
    addr: LOCAL_IP_PORT
    remote_addr: REMOTE_IP_PORT

  tunnel2:
    proto: http
    addr: LOCAL2_IP_PORT
    host: HOST_ADDR

backoff:
  interval: 10s
  multiplier: 1.5
  max_interval: 30m
  max_time: 0

Any idea what could be causing this?

Originally created by @tylkomat on GitHub (Aug 28, 2021). Original GitHub issue: https://github.com/mmatczuk/go-http-tunnel/issues/136 After 3 hours of running the client I get the following errors in the log (replaced IPs and Ports with placeholders) ``` proxy TCP level 1 msg TCP keepalive for tunneled connection failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err file tcp 127.0.0.1:33662->LOCAL_IP_PORT: fcntl: too many open files proxy TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files proxy TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files proxy TCP level 0 msg dial failed target LOCAL_IP_PORT ctrlMsg &{proxy REMOTE_IP_PORT tcp TUNNEL_IP_PORT} err dial tcp LOCAL_IP_PORT: socket: too many open files http: proxy error: dial tcp LOCAL2_IP_PORT: socket: too many open files ``` I configured two tunnels which are called quite often, the http tunnelevery 5 minutes and the tcp every couple of seconds. This is my config: ``` server_addr: TUNNEL_IP_PORT tls_crt: TLS_CRT tls_key: TLS_KEY root_ca: ROOT_CRT tunnels: tunnel1: proto: tcp addr: LOCAL_IP_PORT remote_addr: REMOTE_IP_PORT tunnel2: proto: http addr: LOCAL2_IP_PORT host: HOST_ADDR backoff: interval: 10s multiplier: 1.5 max_interval: 30m max_time: 0 ``` Any idea what could be causing this?
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/go-http-tunnel#84
No description provided.