Solved send failed: No buffer space available

My NAS is running FreeBSD 13.2-RELEASE-p9. I rebooted it a couple of days ago and suddenly, the network keeps crashing if certain services are running: When starting Unbound or Avahi, all outgoing and incoming connections immediately fail.

I just tried starting Unbound while leaving a ping to my router running: The ping replies immediately stopped, and a few minutes later, ping started displaying " sendto failed: No buffer space available". Unbound wrote the same message to Syslog.

The output of netstat -m looks fine to me, the "max" values are not reached anywhere:

Code:
3439/3566/7005 mbufs in use (current/cache/total)
560/964/1524/1004414 mbuf clusters in use (current/cache/total/max)
560/964 mbuf+clusters out of packet secondary zone in use (current/cache)
0/1522/1522/502207 4k (page size) jumbo clusters in use (current/cache/total/max)
2063/2252/4315/148802 9k jumbo clusters in use (current/cache/total/max)
0/0/0/83701 16k jumbo clusters in use (current/cache/total/max)
20546K/29175K/49722K bytes allocated to network (current/cache/total)
0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters)
0/0/0 requests for mbufs delayed (mbufs/clusters/mbuf+clusters)
0/0/0 requests for jumbo clusters delayed (4k/9k/16k)
0/0/0 requests for jumbo clusters denied (4k/9k/16k)
0 sendfile syscalls
0 sendfile syscalls completed without I/O request
0 requests for I/O initiated by sendfile
0 pages read by sendfile as part of a request
0 pages were valid at time of a sendfile request
0 pages were valid and substituted to bogus page
0 pages were requested for read ahead by applications
0 pages were read ahead by sendfile
0 times sendfile encountered an already busy page
0 requests for sfbufs denied
0 requests for sfbufs delayed

Executing service netif restart makes everything go back to normal, assuming both Unbound and Avahi are not running.

The board is an Odroid H2 with two Realtek RTL8111G interfaces. They are running in parallel with their own IPs. I understand Realtek NICs don't always work well with FreeBSD, but this whole setup has been fine for years. I have not been able to figure out what suddenly went wrong, I hope someone here can help me. Thanks in advance!
 
To check my understanding, if either Unbound or Avahi, or both are running, you get the buffer error?

Another forum member reported a similar symptom in Thread 84270. In his case, he had two problems. He increased the value of the size of the affected buffer using sysctl(8), and later found he had a routing issue when he ran [CMDnetstat -r[/CMD]. Have you given either of those a shot?

Also, do you recall whether any of the affected applications have been updated recently, or whether you changed their configuration? I've occasionally been bitten by an upgrade to an application (or the OS...) that I then forget to restart, only to find myself in a half-updated state much later.
 
The issue happens if either Unbound or Avahi is running, one of them is enough to cause it. I tried increasing kern.ipc.maxsockbuf to 6291456 (four times its original value), but that didn't help.

netstat -r looks fine to me, and I haven't changed anything about the routing in the last months.

Unbound was last updated in November, and Avahi in October. I restarted both of them and the entire machine in the meantime without issue, so that couldn't have caused it. Apparently there was a patch to pf in December and I did not reboot after installing that. However, the issue still happens if I disable pf, so I don't think that's the cause either.
 
Your NIC is down. Probably a hardware problem.

I see this with a couple of Asus motherboards here. It frequently occurs after reboot. They've been doing this for years. In the worst case the only fix is a hard power off (at the power supply, not just a soft power off), wait 30 seconds, and power on again. It only affects this one model of Asus MB, of which I have two. Another Asus MB model does not have this problem.

On another occasion the problem occurred I had to replace the MB.

You will need to do a bit of sleuthing to determine if this is a transient problem or one that requires replacement of the MB.
 
Do you know which Asus motherboard is affected exactly? Or, more probably more interesting, what NIC it's got?

I am not using anything Asus, it's an Odroid H2 Single-Board-Computer with two Realtek RTL8111Gs.

Edit: Also, if the NIC is down, shouldn't I see that in syslog and ifconfig? Because I don't.
 
I have samewhat similar problem. After upgrading to 14 I've given a try to net/realtek-re-kmod. But after awhile my system almost freezed with errors about ps_bpf_recvbuf and ps_root_recvbuf "No buffer space available" from dhcp daemon and named in /var/log/messages. Although I have plenty of free RAM and a warning in the port's message about memory fragmentation should not have applied to my case (may be I'm wrong, but anyway such driver behaviour is unacceptable in my opinion).
Hope, returning to default FreeBSD re(4) driver solve the issue.
 
Back
Top