dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

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

Open dma7 opened this issue 10 months ago • 1 comments

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 avatar Apr 20 '24 16:04 dma7

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

dma7 avatar Apr 20 '24 20:04 dma7