Errno 105 No buffer space available

I used to run my brewblox on a small production ubuntu 19.02 server accessing the spark over wifi as it is a very reliable platform. I do use a PI for upgrading firmware and testing when needed. Lately I’ve found the spark service on the ubuntu rig is red instead of green - works fine on the pi. I’ve put on the latest software on both and updated the firmware. I spent a little bit of time looking into the problem on the ubuntu server and done a fresh setup. I found the spark is discovered fine if I do a ‘discover’, but the spark service doesn’t come on line if I do an ‘up’ The log files are found here:

https://termbin.com/kbce

I’ve noticed when doing a brewblox-ctl follow that the mdns repeatedly gives an error:

mdns_1 | 2020/05/11 21:44:28 ERROR aiozeroconf.aiozeroconf initializing comm af AddressFamily.AF_INET on interfaces [‘lo’, ‘enp0s4’, ‘hassio’, ‘docker0’, ‘veth0dbcac9’, ‘veth2615881’, ‘veth58dc712’, ‘veth9786a89’, ‘veth9c96474’, ‘veth4283c67’, ‘veth35d8337’, ‘veth0b61487’, ‘veth3676f38’, ‘veth4a3579e’, ‘ztrfyd7lat’, ‘veth0245078’, ‘br-7ca9289e8bbc’, ‘veth50274aa’, ‘veth400abbb’, ‘veth89d5ff2’, ‘vethf8d7282’, ‘veth7bd292e’, ‘veth2dc1515’, ‘vethe1e4390’, ‘vetha8698dc’]: [Errno 105] No buffer space available

On my production ubuntu server, I do also run Home Assistant and some backup software, all as docker containers. I suspect the combination is blowing some limit somewhere, so any advice appreciated.

Your suspicions are correct: after a certain number of docker networks a buffer limit is reached. I managed to reproduce the issue by running

for i in {10..99}; do docker network create --driver bridge br$i; done
docker run --rm -t --network host brewblox/brewblox-mdns:edge

The limit can be increased by running

sudo sysctl -w net.ipv4.igmp_max_memberships=50
sudo sysctl -w net.ipv4.igmp_max_msf=30

Run brewblox-ctl restart afterwards.

The default values are 20 and 10, respectively. sysctl docs mention that igmp_max_memberships should not exceed 5459, so 50 appears to be a reasonable value.

Works perfectly - thanks Bob