Can't get cups to work on new system, segmentation fault for cups

I have problems using cups printing on my new PC. I have installed budgie as DE. On my old PCs everything works fine with cups. Same OS (manjaro budgie). Both systems are updated.

Here is my problem:

cups and all necessary packages are installed. cups services/socket and path are activated and started with any errors. When I go to localhost:631 I see the cups start page. When I click on admin or printers I get an error on page: internal server error.

The cups.service shows no errors. Same for socket or path.

The cups/error.log shows that the cgi (here printer, but admin also) crashes with signal 11:

D [01/Aug/2023:16:33:31 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [01/Aug/2023:16:33:31 +0200] [Client 77] Server address is "[v1.::1]".
D [01/Aug/2023:16:33:31 +0200] [Client 77] Accepted from localhost:49464 (IPv6)
D [01/Aug/2023:16:33:31 +0200] [Client 77] Waiting for request.
D [01/Aug/2023:16:33:31 +0200] Expiring subscriptions...
D [01/Aug/2023:16:33:31 +0200] cupsdAddCert: Adding certificate for PID 0
D [01/Aug/2023:16:33:31 +0200] Report: clients=1
D [01/Aug/2023:16:33:31 +0200] Report: jobs=0
D [01/Aug/2023:16:33:31 +0200] Report: jobs-active=0
D [01/Aug/2023:16:33:31 +0200] Report: printers=0
D [01/Aug/2023:16:33:31 +0200] Report: stringpool-string-count=336
D [01/Aug/2023:16:33:31 +0200] Report: stringpool-alloc-bytes=5200
D [01/Aug/2023:16:33:31 +0200] Report: stringpool-total-bytes=5632
D [01/Aug/2023:16:33:32 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Active clients"
D [01/Aug/2023:16:33:32 +0200] [Client 78] Server address is "[v1.::1]".
D [01/Aug/2023:16:33:32 +0200] [Client 78] Accepted from localhost:49474 (IPv6)
D [01/Aug/2023:16:33:32 +0200] [Client 78] Waiting for request.
D [01/Aug/2023:16:33:32 +0200] Expiring subscriptions...
D [01/Aug/2023:16:33:32 +0200] [Client 77] GET /printers/ HTTP/1.1
D [01/Aug/2023:16:33:32 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Active clients"
D [01/Aug/2023:16:33:32 +0200] [Client 77] Read: status=200, state=3
D [01/Aug/2023:16:33:32 +0200] [Client 77] Authorized as "root" using Basic.
D [01/Aug/2023:16:33:32 +0200] [Client 77] Processing GET /printers/
D [01/Aug/2023:16:33:32 +0200] [CGI] argv[0] = "/usr/lib/cups/cgi-bin/printers.cgi"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[0] = "CUPS_CACHEDIR=/var/cache/cups"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[1] = "CUPS_DATADIR=/usr/share/cups"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[2] = "CUPS_DOCROOT=/usr/share/cups/doc"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[3] = "CUPS_REQUESTROOT=/var/spool/cups"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[4] = "CUPS_SERVERBIN=/usr/lib/cups"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[5] = "CUPS_SERVERROOT=/etc/cups"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[6] = "CUPS_STATEDIR=/run/cups"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[7] = "HOME=/var/spool/cups/tmp"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[8] = "PATH=/usr/lib/cups/filter:/usr/bin:/usr/bin:/bin:/usr/bin"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[9] = "SERVER_ADMIN=root@medma0198"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[10] = "SOFTWARE=CUPS/2.4.6"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[11] = "TMPDIR=/var/spool/cups/tmp"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[12] = "USER=root"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[13] = "CUPS_MAX_MESSAGE=2047"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[14] = "CUPS_SERVER=/run/cups/cups.sock"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[15] = "CUPS_ENCRYPTION=IfRequested"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[16] = "IPP_PORT=631"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[17] = "AUTH_TYPE=Basic"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[18] = "LANG=de_DE.UTF8"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[19] = "REDIRECT_STATUS=1"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[20] = "GATEWAY_INTERFACE=CGI/1.1"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[21] = "SERVER_NAME=localhost"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[22] = "SERVER_PORT=631"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[23] = "REMOTE_ADDR=[v1.::1]"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[24] = "REMOTE_HOST=localhost"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[25] = "SCRIPT_NAME=/printers/"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[26] = "SCRIPT_FILENAME=/usr/share/cups/doc/printers/"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[27] = "REMOTE_USER=root"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[28] = "SERVER_PROTOCOL=HTTP/1.1"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[29] = "HTTP_USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[30] = "HTTP_REFERER=http://localhost:631/"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[31] = "REQUEST_METHOD=GET"
D [01/Aug/2023:16:33:32 +0200] [CGI] envp[32] = "QUERY_STRING="
D [01/Aug/2023:16:33:32 +0200] cupsdAddCert: Adding certificate for PID 54851
D [01/Aug/2023:16:33:32 +0200] [CGI] Started /usr/lib/cups/cgi-bin/printers.cgi (PID 54851)
I [01/Aug/2023:16:33:32 +0200] [Client 77] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=54851, file=16)
D [01/Aug/2023:16:33:32 +0200] [Client 77] Waiting for CGI data.
D [01/Aug/2023:16:33:32 +0200] [Client 77] CGI data ready to be sent.
D [01/Aug/2023:16:33:32 +0200] PID 54851 (/usr/lib/cups/cgi-bin/printers.cgi) crashed on signal 11.
D [01/Aug/2023:16:33:32 +0200] [Client 77] con->http=0x55854f1e3700
D [01/Aug/2023:16:33:32 +0200] [Client 77] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=2147483647, response=(nil)(), pipe_pid=54851, file=16
D [01/Aug/2023:16:33:32 +0200] [Client 77] Waiting for CGI data.
D [01/Aug/2023:16:33:32 +0200] [Client 77] cupsdSendHeader: code=500, type="text/html", auth_type=0
D [01/Aug/2023:16:33:32 +0200] [Client 77] Waiting for request.
D [01/Aug/2023:16:33:32 +0200] [Client 77] Closing because Keep-Alive is disabled.
D [01/Aug/2023:16:33:32 +0200] [Client 77] Closing connection.
D [01/Aug/2023:16:33:32 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [01/Aug/2023:16:33:33 +0200] Expiring subscriptions...

journalctl -p 3 -xb shows a segmentation fault for cups-exec:

Aug 01 15:41:23 medma0198 systemd-coredump[45166]: [🡕] Process 45164 (cups-exec) of user 0 dumped core.
                                                   Stack trace of thread 45164:
                                                   #0  0x00005654543fa182 n/a (cups-exec + 0x1182)
                                                   #1  0x00007fdeaf34a850 n/a (libc.so.6 + 0x23850)
                                                   #2  0x00007fdeaf34a90a __libc_start_main (libc.so.6 + 0x2390a)
                                                   #3  0x00005654543fa315 n/a (cups-exec + 0x1315)
                                                   ELF object binary architecture: AMD x86-64
                                                   

coredumpctl info cups-exec shows:

>           PID: 42784 (cups-exec)
           UID: 0 (root)
           GID: 209 (209)
        Signal: 11 (SEGV)
     Timestamp: Tue 2023-08-01 15:32:05 CEST (25min ago)
  Command Line: /usr/lib/cups/daemon/cups-exec -g 209 -n 0 -u 209 none /usr/lib/cups/cgi-bin/admin.cgi /usr/lib/cups/cgi-bin/admin.cgi
    Executable: /usr/lib/cups/daemon/cups-exec
 Control Group: /system.slice/cups.service
          Unit: cups.service
         Slice: system.slice
       Boot ID: 080f70d4195a473285708f949b8ba37a
    Machine ID: b88aa95f4c094bdab1e48cae813b5909
      Hostname: medma0198
       Storage: /var/lib/systemd/coredump/core.cups-exec.0.080f70d4195a473285708f949b8ba37a.42784.1690896725000000.zst (present)
  Size on Disk: 38.4K
       Message: Process 42784 (cups-exec) of user 0 dumped core.
                
                Stack trace of thread 42784:
                #0  0x0000560b9eaf2182 n/a (cups-exec + 0x1182)
                #1  0x00007f6dafb43850 n/a (libc.so.6 + 0x23850)
                #2  0x00007f6dafb4390a __libc_start_main (libc.so.6 + 0x2390a)
                #3  0x0000560b9eaf2315 n/a (cups-exec + 0x1315)
                ELF object binary architecture: AMD x86-64

When I run the command line ‘/usr/lib/cups/daemon/cups-exec -g 209 -n 0 -u 209 none /usr/lib/cups/cgi-bin/admin.cgi /usr/lib/cups/cgi-bin/admin.cgi’ as normal user, I get no errors.

When I run this as sudo or root, I get a segmentation fault error.

I run gdb:

gdb -ex=r --args /usr/lib/cups/daemon/cups-exec -g 209 -n 0 -u 209 none /usr/lib/cups/daemon/cups-driverd /usr/lib/cups/daemon/cups-driverd list 12 0 requested-attributes=all

run and backtrace:

 0x0000555555555182 in ?? ()
#1  0x00007ffff7dc7850 in __libc_start_call_main (main=main@entry=0x555555555020, argc=argc@entry=14, argv=argv@entry=0x7fffffffdf48) at ../sysdeps/nptl/libc_start_call_main.h:58
#2  0x00007ffff7dc790a in __libc_start_main_impl (main=0x555555555020, argc=14, argv=0x7fffffffdf48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffffffdf38) at ../csu/libc-start.c:360
#3  0x0000555555555315 in ?? ()

Here I stuck. I have no idea how to work with this information. Did someone has an idea what this means? How to proceed?

Thanks in advance

OK, I have found a solution. I have no idea why, when installing cups, the systemd-sysusers hook do not create the group cups with gid 209 in /etc/group and it not create the user cups. I have manually added them and now it works.

sudo groupadd -g 209 cups
sudo useradd -u 209 -g 209 -c Cups\ helper\ user -d / -s /usr/bin/nologin cups

So my problem ist still the fact, that systemd-users do not create the users. I opened for it a new topic. And this can be closed. Solved

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.