Increase Received Buffer Size for Tunnel on Docker

I have set up a tunnel to allow external access to my HomeAssistant instance via NGINX. This was working for a few days, but now I get a 400: Bad Request error.

TLDR; I tried updating the buffer sizes as instructed which hasn’t worked. Any suggestions to fix this 400 Bad Request error would be much appreciated.

Long Version…
All services are running as docker containers on Ubuntu 22.04.

The Tunnel container logs (accessed via Portainer) contain the following

failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See /quic-go/quic-go/wiki/UDP-Receive-Buffer-Size for details.

Visiting the provided link leads to After a bit of additional research, I found this link which suggested I entered the following commands into the host machine

sudo sysctl -w net.core.rmem_max=3000000
sudo sysctl -w net.core.rmem_default=3000000
sudo sysctl -w net.core.wmem_max=3000000
sudo sysctl -w net.core.wmem_default=3000000

(I added a bit extra just in case)

These settings seem to have saved. When I run the below:

sudo sysctl -a | grep net.core

the results include the following lines

net.core.rmem_default = 3000000
net.core.rmem_max = 3000000
net.core.wmem_default = 3000000
net.core.wmem_max = 3000000

I then restarted the tunnel container but still no joy.
I then increased the values to 4000000 and restarted the container but get the same error.

The tunnel config is as follows

config="{\"ingress\":[{\"hostname\":\"\", \"originRequest\":{\"disableChunkedEncoding\":false, \"noHappyEyeballs\":true}, \"service\":\"http://XXX.XXX.XX.XX:XX\"}, {\"service\":\"http_status:404\"}], \"warp-routing\":{\"enabled\":false}}" version=6

Any ideas or suggestions would be much appreciated.

Thank you!

1 Like