olbat / dockerfiles

A collection of Dockerfiles
https://hub.docker.com/u/olbat/
GNU General Public License v3.0
134 stars 73 forks source link

Container getting "kernel: __vm_enough_memory: pid: xxxx, comm: cupsd, not enough memory for the allocation" #105

Open dma7 opened 4 months ago

dma7 commented 4 months ago

I try to setup the container on a Fedora 39 host using Portainer.

My compose config:

version: '3.3'
services:
    cupsd:
        image: olbat/cupsd
        container_name: cupsd
        volumes:
            - '/var/run/dbus:/var/run/dbus'
            - '/dev/bus/usb:/dev/bus/usb'
        ports:
            - '631:631'
        privileged: true
        restart: always

When I deploy the stack, Portainer is telling me that it was successful. But when I look into "Containers" section, I see that the container has no port bound which indicates an issue.

docker container ls output is like this

CONTAINER ID   IMAGE                           COMMAND                CREATED          STATUS                          PORTS                                                                                            NAMES
bdd39df5e0d5   olbat/cupsd                     "/usr/sbin/cupsd -f"   11 minutes ago   Restarting (1) 25 seconds ago              

So it seems like it is in a restart loop.

journalctl -b | grep cups is showing 3 messages per PID like this:

Apr 20 18:16:37 xxxx.dip0.t-ipconnect.de kernel: __vm_enough_memory: pid: 7902, comm: cupsd, not enough memory for the allocation
Apr 20 18:16:37 xxxx.dip0.t-ipconnect.de kernel: __vm_enough_memory: pid: 7902, comm: cupsd, not enough memory for the allocation
Apr 20 18:16:37 xxxx.dip0.t-ipconnect.de kernel: __vm_enough_memory: pid: 7902, comm: cupsd, not enough memory for the allocation

Do you have an idea how I could get it to work?

dma7 commented 4 months ago

Ok, I managed to help myself.

The problem is described here.

Starting the container with the additional parameter --ulimit nofile=1024:1024 will do the trick