Neelotpal Nag
Neelotpal Nag

Reputation: 181

OSError 105 : No buffer Space - Zeroconf

I'm using a NanoPi M1 (Allwinner H3 board) & running a Yocto-based OS. On my first encounter with ZeroConf-python,

>>> from zeroconf import Zeroconf, ServiceBrowser
>>> zero = Zeroconf()

I'm getting the error:

File "/usr/lib/python3.5/site-packages/zeroconf.py", line 1523, in __init__
    socket.inet_aton(_MDNS_ADDR) + socket.inet_aton(i))
OSError: [Errno 105] No buffer space available

This error doesn't arise when I run it in Raspbian(on RPI). I've tried to search for fixes to such errors in homeassistant, but none provide a good overview to the real problem, rest-aside the solution.

Upvotes: 2

Views: 3033

Answers (2)

Neelotpal Nag
Neelotpal Nag

Reputation: 181

Update the net/ipv4/igmp_max_memberships value of sysctl to greater than zero. Execute the following commands on the terminal: $ sysctl -w net.ipv4.igmp_max_memberships=20 (or any other value greater than zero) & $ sysctl -w net.ipv4.igmp_max_msf=10

Then, restart the avahi-daemon systemctl restart avahi-daemon

You can verify the existing values of the above keys using 'sysctl net.ipv4.igmp_max_memberships'.

Upvotes: 3

nehtor.t
nehtor.t

Reputation: 609

An addition to the answer of Neelotpal:

This post includes a nice solution proposal with all options to check for this problem:

# Bigger buffers (to make 40Gb more practical). These are maximums, but the     default is unaffected.
net.core.wmem_max=268435456
net.core.rmem_max=268435456
net.core.netdev_max_backlog=10000

# Avoids problems with multicast traffic arriving on non-default interfaces
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.all.rp_filter=0

# Force IGMP v2 (required by CBF switch)
net.ipv4.conf.all.force_igmp_version=2
net.ipv4.conf.default.force_igmp_version=2

# Increase the ARP cache table
net.ipv4.neigh.default.gc_thresh3=4096
net.ipv4.neigh.default.gc_thresh2=2048
net.ipv4.neigh.default.gc_thresh1=1024

# Increase number of multicast groups permitted
net.ipv4.igmp_max_memberships=1024

I don't suggest to just blindly copy these values but to systematically test which one it is that is limiting your resources:

  1. use sysctl <property> to get the currently set value
  2. verify if the property is currently running at the limit by checking system stats
  3. change the configuration as described by Neelotpal with sysctl -w or by changing /etc/sysctl.conf directly and realoading it via sysctl -p

In my case increasing the net.ipv4.igmp_max_memberships did the trick:

  1. I checked the current value with sysctl net.ipv4.igmp_max_memberships which was 20
  2. I checked how many memberships there are with netstat -gn, realizing that my numerous docker containers take up most of that
  3. finally I increased value in syctl.conf, and it worked

And of course it is also good to read up on those properties to understand what they actually do, for example on sysctl-explorer.net.

Upvotes: 3

Related Questions