Docker-Nagios icon indicating copy to clipboard operation
Docker-Nagios copied to clipboard

Error: Failed to create IO broker set: Cannot allocate memory

Open manugu87 opened this issue 2 years ago • 7 comments

docker pull jasonrivers/nagios:latest docker run --name nagios4 -p 0.0.0.0:8080:80 jasonrivers/nagios:latest

I don´t found any resolution, ¿can you help me?

Started runsvdir, PID is 11 checking permissions for nagios & nagiosgraph rsyslogd: [origin software="rsyslogd" swVersion="8.2001.0" x-pid="19" x-info="https://www.rsyslog.com"] start

Nagios Core 4.4.6 Copyright (c) 2009-present Nagios Core Development Team and Community Contributors Copyright (c) 1999-2009 Ethan Galstad Last Modified: 2020-04-28 License: GPL

Website: https://www.nagios.org Error: Failed to create IO broker set: Cannot allocate memory

manugu87 avatar Jun 28 '22 10:06 manugu87

change ulimit for docker container: --ulimit nofile=:

anobhask avatar Sep 03 '22 08:09 anobhask

On my system nofile is already unlimited, but I got the same error running docker on PhotonOS. Running docker on another Ubuntu maschine, nagios works fine. Any other idea?

tukey42 avatar Dec 05 '22 18:12 tukey42

Changing the ulimit didn't work for me either. I think docker might have changed something recently which is breaking the container. I'm using Arch Linux my versions below.

$ docker version
Client:
 Version:           23.0.1
 API version:       1.42
 Go version:        go1.20
 Git commit:        a5ee5b1dfc
 Built:             Sat Feb 11 13:58:04 2023
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          23.0.1
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.20
  Git commit:       bc3805a0a0
  Built:            Sat Feb 11 13:58:04 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.6.18
  GitCommit:        2456e983eb9e37e47538f59ea18f2043c9a73640.m
 runc:
  Version:          1.1.4
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
$ uname -a
Linux xxx 5.15.94-1-lts #1 SMP Wed, 15 Feb 2023 07:09:02 +0000 x86_64 GNU/Linux

I am building Nagios in Docker from master but I also tried a release from back in April with the same results.

mariaa144 avatar Feb 21 '23 03:02 mariaa144

Sorry, I forgot to post my solution of the issue. The problem is, that NOFILE is much too high and nagios tries to allocate an array of this size and fails. I just added "--ulimit nofile=32768:32768" to my docker run command and that works for me.

tukey42 avatar Feb 21 '23 09:02 tukey42

Setting the ulimits nofile worked for me once I applied it to the correct container. Bravo!

In my docker-compose.yml I did:

   ulimits:
      nofile:
        soft: 32768
        hard: 32768

mariaa144 avatar Feb 21 '23 15:02 mariaa144

The solution in this topic should be on the main page of this project !

pathia avatar Mar 09 '24 19:03 pathia