Bug 55264 - New printers take a long time to show up in samba
New printers take a long time to show up in samba
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Arvid Requate
Julia Bremer
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-10-13 17:01 CEST by Christina Scheinig
Modified: 2023-02-01 17:24 CET (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.286
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022101121000353
Bug group (optional): Regression
Max CVSS v3 score:


Attachments
smbcontrol-reload-config.diff (776 bytes, patch)
2022-10-25 12:33 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2022-10-13 17:01:43 CEST
In a customer environment, it takes up to more than an hour, since the printer shows up.

In my simple testenvironment I could reproduce this, but it took only 7 minutes, which is still too long.

This can be watched with the printmanagement in windows, but also with 

rpcclient -c "enumprinters" -UAdministrator%univention localhost
on the server.

So the administration (assigning Windows drivers, setting default settings) is not userfriendly at all, or you can say, it is blocking the daily work.

The has occurred since samba 4.16 in UCS 5
Comment 2 Christina Scheinig univentionstaff 2022-10-20 14:00:55 CEST
Additional information came up
Meanwhile, a deleted printer just won't disappear from Samba. It's out of CUPS, it's out of all Samba configs in /etc/samba/, but it still shows up occasionally in printmanagent.msc and co. The whole thing is so bizarre that yesterday the customer wanted to show all printers of the server 3 times in a row (so within <3 seconds) on a client in Powershell with the "Get-Printer" cmdlet, and sometimes the deleted printer was shown, and sometimes not.
Locally on the server with rpcclient it is shown to me also still
Logfile is in the ticket 2022101121000353 #6
Comment 3 Arvid Requate univentionstaff 2022-10-24 12:27:45 CEST
Did you check if any of the following things help?

* /etc/init.d/samba restart
* smbcontrol smbd reload-config
* smbcontrol smbd reload-printers
* The last two commands also accept a pid instead of "smbd",
  you may check smbstatus to narrow down the smbd child pids
Comment 4 Christina Scheinig univentionstaff 2022-10-24 14:57:42 CEST
(In reply to Arvid Requate from comment #3)
> Did you check if any of the following things help?
> 
> * /etc/init.d/samba restart
> * smbcontrol smbd reload-config
> * smbcontrol smbd reload-printers
> * The last two commands also accept a pid instead of "smbd",
>   you may check smbstatus to narrow down the smbd child pids

In my testenvironment none of this worked to get the printers immediately with 

watch rpcclient -c enumprinters -UAdministrator%univention localhost
Comment 5 Arvid Requate univentionstaff 2022-10-25 12:33:59 CEST
Created attachment 11003 [details]
smbcontrol-reload-config.diff

This change fixed it on my test system. But still, it's weird.
Comment 6 Arvid Requate univentionstaff 2022-10-27 08:49:41 CEST
It's this process that needs a nudge:

smbcontrol samba-bgqd reload-config
Comment 7 Florian Best univentionstaff 2023-01-23 15:16:50 CET
Could it be that the `smbcontrol` lies in different locations on new-installed and upgraded systems?

At least we have:

19 times in /var/log/univention/listener.log:
https://jenkins2022.knut.univention.de/job/UCS-5.0/job/UCS-5.0-2/job/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=slave/ws/test/listener.log
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/cups-printers.py", line 388, in handler
    reload_smbd()
  File "/usr/lib/univention-directory-listener/system/cups-printers.py", line 419, in reload_smbd
    subprocess.call(('/usr/bin/smbcontrol', 'all', 'reload-config'))
  File "/usr/lib/python3.7/subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/smbcontrol': '/usr/bin/smbcontrol'


87 times in /var/log/univention/listener.log:
https://jenkins2022.knut.univention.de/job/UCS-5.0/job/UCS-5.0-2/job/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=slave/ws/test/listener.log
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/cups-printers.py", line 457, in postrun
    reload_smbd()
  File "/usr/lib/univention-directory-listener/system/cups-printers.py", line 419, in reload_smbd
    subprocess.call(('/usr/bin/smbcontrol', 'all', 'reload-config'))
  File "/usr/lib/python3.7/subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/smbcontrol': '/usr/bin/smbcontrol'
Comment 8 Arvid Requate univentionstaff 2023-01-24 09:20:52 CET
af1ca46eaf | Only do samba operations if tools are present
e69327993a | Advisory update
Comment 9 Julia Bremer univentionstaff 2023-01-30 13:41:57 CET
OK: Service samba-bgqd is reloaded
OK: Yaml
Verified