Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot start CUPS service in docker container, cups.socket is missing

I have a docker image (from eclipse-temurin:17-jre-focal) where I install CUPS and start that image via compose file. This image works fine on Azure Ubuntu VM's, but on a physical NUC server running ESXi and CentOS 9 as host OS, the CUPS service won't start. In fact none of the available CUPS images starts up.

The error:

X [15/Dec/2022:11:28:12 +0000] cupsdDoSelect() failed - Bad address!
X [15/Dec/2022:11:28:12 +0000] Listeners[0] = 4
X [15/Dec/2022:11:28:12 +0000] Listeners[1] = 5
X [15/Dec/2022:11:28:12 +0000] Listeners[2] = 6
X [15/Dec/2022:11:28:12 +0000] CGIPipes[0] = 7
E [15/Dec/2022:11:28:12 +0000] Scheduler shutting down due to program error.

After a lot of searching it seems this error related somehow to a missing cups.socket from /var/run/.

Reinstalling CUPS in the container, while doesn't shows any error, does not work either. What can be the cause and how could I solve this?

like image 544
voloszad Avatar asked Oct 27 '25 03:10

voloszad


2 Answers

TL;DR: I had the same issue and solved it by downgrading my version of Docker.

I'm using Manjaro Linux and after tinkering for long time with no success, I tried downgrading the Docker version from version 23.0.1 (this one seem to cause the issue) to version 20.10.23. After a restart of the system the issue does not appear anymore.

In case this is a general problem with this version of Docker, we might want to report it back to Docker? To reconstruct the issue:

docker run -dt --name my-docker ubuntu
docker exec -it my-cups bash
apt update && apt upgrade
apt install cups less
service cups start
less /var/log/cups/error_log
like image 130
MyBeta Avatar answered Oct 29 '25 19:10

MyBeta


This seems to be an issue with Docker 23.x setting the NOFILE limit to unlimited which cups cannot handle.

The issue is known and reported on the docker and containerd issue trackers:

  • https://github.com/containerd/containerd/issues/6707
  • https://github.com/containerd/containerd/pull/7566
  • https://github.com/moby/moby/issues/38814

Possible temporary fix;

To fix this with a systemd unit:

  1. Create a directory at /etc/systemd/system/cups.service.d
  2. Create a file in that directory named limits.conf
  3. Add to the file:

limits.conf:

[Service]
LimitNOFILE=65536

Then run "systemctl daemon-reload && systemctl restart cups"

like image 31
Christian Stewart Avatar answered Oct 29 '25 18:10

Christian Stewart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!