Bug 15121 - Printing does not work after Upgrade from 4.16.2 to 4.16.4
Summary: Printing does not work after Upgrade from 4.16.2 to 4.16.4
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Printing (show other bugs)
Version: 4.16.4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: printing-maintainers
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-14 07:29 UTC by Christian Naumer
Modified: 2022-08-19 10:56 UTC (History)
3 users (show)

See Also:


Attachments
Screenshot Windows Print Management Console (14.57 KB, image/png)
2022-07-14 07:29 UTC, Christian Naumer
no flags Details
Screenshot Driver Management (21.85 KB, image/png)
2022-07-14 07:30 UTC, Christian Naumer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Naumer 2022-07-14 07:29:28 UTC
Created attachment 17420 [details]
Screenshot Windows Print Management Console

After the upgrade to 4.16 from 4.15 the Windows Print Management Console does not list printers and drivers. See screenshots attached. If you click on "manage drivers"then all the drivers are listed.

These commands can list printers and drivers without problems.

rpcclient localhost -U "user" -c "enumdrivers"
rpcclient localhost -U "user" -c "enumprinters"

Also Upload of drivers fails. 

On the printserver nothing in the logs stands out.


The system is a Rocky Linux 8.6 with the Sernet packages.

Here is the smb.conf

[global]
        netbios name = Printserver
        server string = Printserver
        security = ADS
        realm = HQ.DOMAIN-IT.DE
        workgroup = DOMAIN-02
        max log size = 50000
        disable netbios = yes
        smb ports = 445
        server min protocol = SMB2
        client min protocol = SMB2
        #log level = 5
        log level = 1 auth_audit:2
        logging =syslog only
        kerberos method = secrets and keytab
        dedicated keytab file = /etc/krb5.keytab
        writeable =YES
        map acl inherit = yes
        store dos attributes = yes
        inherit acls = Yes
        username map = /etc/samba/smbusers
        interfaces = lo eth0
        bind interfaces only = Yes
        ##idmap##
        # Default idmap config used for BUILTIN and local windows accounts/groups
        idmap config *:backend = tdb
        idmap config *:range = 1000000-2000000

        # idmap config for domain DOMAIN-02
        idmap config DOMAIN-02:backend = ad
        idmap config DOMAIN-02:range = 500-65555
        idmap config DOMAIN-02:schema_mode = rfc2307
        idmap config DOMAIN-02:unix_nss_info = yes
        winbind use default domain = Yes
        winbind offline logon = yes
        winbind refresh tickets = yes
        machine password timeout = 604800
        #Printing
        rpc_server:spoolss = external
        rpc_daemon:spoolssd = fork
        spoolss: architecture = Windows x64
        min domain uid = 500

[printers]
       path = /var/spool/samba/
       printable = yes
       printing = cups

[print$]
       path = /srv/samba_printer_drivers/
       read only = no
Comment 1 Christian Naumer 2022-07-14 07:30:08 UTC
Created attachment 17421 [details]
Screenshot Driver Management
Comment 2 Christian Naumer 2022-07-14 12:23:24 UTC
I should also make it clear that printing works without problems.
Comment 3 Louis 2022-08-08 13:41:52 UTC
try in smb.conf:  min domain uid = 0
Comment 4 Christian Naumer 2022-08-08 13:46:18 UTC
Tried that already. I am doing this with a user that is in the Print Operators group and that has the SePrintOperatorPrivilege granted.
Comment 5 Christian Naumer 2022-08-08 13:53:02 UTC
What also might be interesting that an upgrade to 4.16.3 breaks printing completely. Downgrade to 4.15. fixes the printing but not Print Management Console.
Is this working for others?
Comment 6 Christian Naumer 2022-08-17 13:16:46 UTC
So we have setup a test machine (a clone of the original machine) and upgraded to 4.16.4.

Here 4.16:

cn@printsrv-test ~]$ rpcclient printsrv-test -U cn -c "enumprinters"
Password for [DOM-02\cn]:
No printers returned.

[cn@printsrv-test ~]$ smbclient -L printsrv-test
Password for [DOM-02\cn]:

    Sharename       Type      Comment
    ---------       ----      -------
    print$          Disk
    IPC$            IPC       IPC Service (Printsrv-Test)
SMB1 disabled -- no workgroup available


Here 4.15:
[cn@printsrv-test ~]$ rpcclient printserver -U "cn" -c "enumprinters"
Password for [DOM-02\cn]:
    flags:[0x800000]
    name:[\\PRINTSERVER\XXX-MFP]
    description:[\\PRINTSERVER\XXX-MFP,XXXX PCL6 UniversalDriver VX.XX,XXXX XXXX XXX XXXX PCL X]
    comment:[XXXX XXX XX XXX PCL X]

[cn@printsrv-test ~]$ smbclient -L printserver
Password for [DOM-02\cn]:

    Sharename       Type      Comment
    ---------       ----      -------
    print$          Disk
    IPC$            IPC       IPC Service (Printserver)
    XXX-MFP        Printer   XXXX XXX XX XXX PCL X
    
SMB1 disabled -- no workgroup available


According to the Wiki some things change for 4.16 (https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Print_Server)

And we have set this with regards to spoolss:
    # for 4.15 only these
        rpc_server:spoolss = external
        rpc_daemon:spoolssd = fork
    spoolss: architecture = Windows x64
        # additionally for Samba 4.16
        rpcd_spoolss:idle_seconds=300
        rpcd_spoolss:num_workers = 10

But still no joy. No printing from Windows and no printers listed with RPC client or smbclient. The commands above were run as normal user. Running them as Administrator does also not work (min domain uid = 0 is set).
Comment 7 Christian Naumer 2022-08-17 13:18:03 UTC
Also confirmed on the mailing list:

https://lists.samba.org/archive/samba/2022-August/241571.html

Printing on 4.16.4 does not work.
Comment 8 Christian Naumer 2022-08-18 11:01:37 UTC
So after some more trials I can say if I define every printer in the smb.conf. It is just the "auto detection" which is apparently not working. I also increased  rpcd_spoolss:idle_seconds to 600 and still no printers. As we only have 9 printers I don't think a timeout is the issue here.
Comment 9 Andreas Schneider 2022-08-18 14:21:20 UTC
If you start smbd you need to trigger an rpc command in order to start rpc-spoolss. Once rpc-spoolss is started it scans cups for printers. The first time the command wont return anything as the printers list needs to be filled. Once it has been filled you should always get printers returned.

You can use 'rpcclient ncacn_np:server -c 'enumprinters' to trigger the scanning. If you call it a second time after waiting a few seconds you should get printers returned.

If not please provide log with log level = 10.
Comment 10 Christian Naumer 2022-08-18 18:52:13 UTC
(In reply to Andreas Schneider from comment #9)
Even after waiting for some time after the first command it does not work. I'll attach the lvl 10 debug logs.
Comment 11 Christian Naumer 2022-08-18 18:54:12 UTC
I'll send the logs to you asn@samba.org  because they may contain sensitive information.
Comment 12 Andreas Schneider 2022-08-19 08:58:52 UTC
Looks like it can't open the printers_list.tdb because of invalid options for tdb_open()

[2022/08/19 08:39:55,  1, pid=13956, effective(0, 0), real(0, 0)] ../../lib/tdb_wrap/tdb_wrap.c:65(tdb_wrap_log)
  tdb(/var/cache/samba/printer_list.tdb): tdb_mutex_open_ok[/var/cache/samba/printer_list.tdb]: Can use mutexes only with MUTEX_LOCKING or NOLOCK
[2022/08/19 08:39:55,  3, pid=13956, effective(0, 0), real(0, 0)] ../../lib/dbwrap/dbwrap_tdb.c:484(db_open_tdb)
  Could not open tdb: Invalid argument
[2022/08/19 08:39:55,  0, pid=13956, effective(0, 0), real(0, 0)] ../../source3/printing/printer_list.c:58(get_printer_list_db)
  get_printer_list_db: Failed to open printer_list.tdb


Volker any idea?
Comment 13 Volker Lendecke 2022-08-19 09:55:27 UTC
(In reply to Andreas Schneider from comment #12)

> tdb_mutex_open_ok[/var/cache/samba/printer_list.tdb]: Can use mutexes only
> with MUTEX_LOCKING or NOLOCK

This message means that the existing printer_list.tdb has mutexes in its database format. I can't explain how this got there, but removing the existing file should get us across this particular error.

Volker
Comment 14 Andreas Schneider 2022-08-19 10:56:32 UTC
SOLUTION:

rm -f /var/cache/samba/printer_list.tdb

or

find /var -name printer_list.tdb -delete