'New Printer' = hang over network

Bug #165197 reported by zzxtty
18
Affects Status Importance Assigned to Milestone
system-config-printer (Ubuntu)
Fix Released
Medium
Till Kamppeter

Bug Description

Printer configuration is completely unusable in a network environment. Click on 'New Printer' and it will hang for over 10 minutes while it scans the network, it will then return a completely useless list containing hundreds of printers (yes, its a large network). Lets say you wanted to wait 10 minutes to generate this list (which i dont), there should be a way of searching the list for the printer you require. Clicking on 'New printer' should not set it off scanning the network, the user should be given a choice of options, one of these should be 'scan for printers on the local network', fine for a small network, useless for anything else.

Revision history for this message
Nanley Chery (nanoman) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at [WWW] https://wiki.ubuntu.com/Bugs/FindRightPackage. I have classified this bug as a bug in system-config-printer.

Revision history for this message
Tim Waugh (twaugh) wrote :

system-config-printer itself does not scan the network when 'New Printer' is clicked; however, it does ask CUPS for a list of devices, and a list of available PPDs.

What does 'time /usr/sbin/lpinfo -v' say?

This bug reminds me of bug #139335.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Can you do the following:

wget http://www.openprinting.org/download/printing/dnssd
sudo apt-get install avahi-utils
chmod +x dnssd
time ./dnssd
time /usr/lib/cups/backend/snmp

Please tell how long the two programs need and which printers they report.

/usr/lib/cups/backend/snmp is the standard program of CUPS to search for network printers. It does an SNMP broadcast and collects the answers from the printers. dnssd is a replacement for this program written by me which uses mDNS/DNS-SD/Zeroconf/Bonjour for searching for printers on the network. They do not necessarily find the same set of printers, as older printers can only support SNMP and newer only DNS-SD.

If the result of dnssd is more satisfying for you, do

sudo cp dnssd /usr/lib/cups/backend/
sudo chmod -x /usr/lib/cups/backend/snmp

If you are on Hardy, dnssd is already included in the CUPS package (1.3.4-1ubuntu2 or newer). Then you do not need to do the above-mentioned manual download and installation.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

A new system-config-printer package with performance improvements is in place now:

http://www.linux-foundation.org/~till/tmp/ubuntu/hardy/system-config-printer/

Please download and test these packages.

Note that this is not a fix for the bug. Improvements in network scanning performance are still needed. Please also do the performance test of the two scanning methods as I have described in the previous comment.

Revision history for this message
zzxtty (zzxtty) wrote : Re: [Bug 165197] Re: 'New Printer' = hang over network

On 27/11/2007, Tim Waugh <email address hidden> wrote:
> system-config-printer itself does not scan the network when 'New
> Printer' is clicked; however, it does ask CUPS for a list of devices,
> and a list of available PPDs.
>
> What does 'time /usr/sbin/lpinfo -v' say?
>

network socket
network beh
network socket://x.x.x.165
network socket://x.x.x.155
network socket://x.x.x.188
network socket://x.x.x.135
network socket://x.x.x.137
network socket://x.x.x.180
network socket://x.x.x.167
network socket://x.x.x.171
network socket://x.x.x.172
network socket://x.x.x.181
network socket://x.x.x.202
network socket://x.x.x.170
network socket://x.x.x.160
network socket://x.x.x.193
network socket://x.x.x.200
direct canon:/dev/lp0
direct epson:/dev/lp0
direct hal
network socket://x.x.x.145
network socket://x.x.x.152
network socket://x.x.x.168
network socket://x.x.x.177
network socket://x.x.x.144
direct hpfax
network socket://x.x.x.184
network socket://x.x.x.164
network socket://x.x.x.156
network socket://x.x.x.175
network socket://x.x.x.162
network socket://x.x.x.199
network socket://x.x.x.205
network socket://x.x.x.159
network socket://x.x.x.138
network socket://x.x.x.186
network socket://x.x.x.166
network socket://x.x.x.169
network socket://x.x.x.176
network socket://x.x.x.182
network socket://x.x.x.189
network socket://x.x.x.194
network socket://x.x.x.203
network socket://x.x.x.178
direct hp
network http
network ipp
network lpd
direct parallel:/dev/lp0
file cups-pdf:/
direct scsi
network smb
network socket://x.x.x.142
network socket://x.x.x.153

real 0m23.048s
user 0m0.016s
sys 0m0.004s

> This bug reminds me of bug #139335.
>
> --
> 'New Printer' = hang over network
> https://bugs.launchpad.net/bugs/165197
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
zzxtty (zzxtty) wrote :
Download full text (13.2 KiB)

On 27/11/2007, Till Kamppeter <email address hidden> wrote:
> Can you do the following:
>
> wget http://www.openprinting.org/download/printing/dnssd
> sudo apt-get install avahi-utils
> chmod +x dnssd
> time ./dnssd
> time /usr/lib/cups/backend/snmp

mort@coffee:~$ time ./dnssd
network socket://x.x.x.160 "Kyocera FS-1030D FS-1030D" "Kyocera
FS-1030D FS-1030D x.x.x.160" "MFG:Kyocera
FS-1030D;MDL:FS-1030D;DES:FS-1030D;CLS:PRINTER;"
network socket://x.x.x.100 "Kyocera FS-1030D FS-1030D" "Kyocera
FS-1030D FS-1030D x.x.x.100" "MFG:Kyocera
FS-1030D;MDL:FS-1030D;DES:FS-1030D;CLS:PRINTER;"
network socket://x.x.x.200 "Kyocera FS-1030D FS-1030D" "Kyocera
FS-1030D FS-1030D x.x.x.200" "MFG:Kyocera
FS-1030D;MDL:FS-1030D;DES:FS-1030D;CLS:PRINTER;"
network socket://x.x.x.193 "Kyocera FS-1030D FS-1030D" "Kyocera
FS-1030D FS-1030D x.x.x.193" "MFG:Kyocera
FS-1030D;MDL:FS-1030D;DES:FS-1030D;CLS:PRINTER;"
network socket://x.x.x.220 "Kyocera FS-1030D FS-1030D" "Kyocera
FS-1030D FS-1030D x.x.x.220" "MFG:Kyocera
FS-1030D;MDL:FS-1030D;DES:FS-1030D;CLS:PRINTER;"
network socket://x.x.x.170 "Kyocera Mita FS-1020D FS-1020D" "Kyocera
Mita FS-1020D FS-1020D x.x.x.170" "MFG:Kyocera Mita
FS-1020D;MDL:FS-1020D;DES:FS-1020D;CLS:PRINTER;"
network socket://x.x.x.229 "Kyocera FS-1030D FS-1030D" "Kyocera
FS-1030D FS-1030D x.x.x.229" "MFG:Kyocera
FS-1030D;MDL:FS-1030D;DES:FS-1030D;CLS:PRINTER;"
network lpd://x.x.x.163 "Samsung ML-2250" "Samsung ML-2250 x.x.x.163"
"MFG:Samsung;MDL:ML-2250;DES:Samsung ML-2250;CLS:PRINTER;"

real 0m6.955s
user 0m0.016s
sys 0m0.016s
mort@coffee:~$

mort@coffee:~$ time /usr/lib/cups/backend/snmp
network socket://x.x.x.135 "Canon iR3035 25.02" "Canon iR3035 25.02
x.x.x.135" ""
network socket://x.x.x.137 "Canon iR5055 13.02" "Canon iR5055 13.02
x.x.x.137" ""
network socket://x.x.x.138 "HP LaserJet 3052" "HP LaserJet 3052 x.x.x.138" ""
network socket://x.x.x.142 "WorkCentre M15 Series" "WorkCentre M15
Series x.x.x.142" ""
network socket://x.x.x.144 "HP Color LaserJet CM1017" "HP Color
LaserJet CM1017 x.x.x.144" ""
network socket://x.x.x.145 "Unknown" "Unknown x.x.x.145" ""
network socket://x.x.x.152 "HP Color LaserJet 3800" "HP Color LaserJet
3800 x.x.x.152" ""
network socket://x.x.x.153 "Xerox WorkCentre Pro 232" "Xerox
WorkCentre Pro 232 x.x.x.153" ""
network socket://x.x.x.155 "Brother MFC-9420CN" "Brother MFC-9420CN
x.x.x.155" ""
network socket://x.x.x.156 "Unknown" "Unknown x.x.x.156" ""
network socket://x.x.x.159 "hp LaserJet 2420" "hp LaserJet 2420 x.x.x.159" ""
network socket://x.x.x.160 "FS-1030D" "FS-1030D x.x.x.160" ""
network socket://x.x.x.162 "hp LaserJet 2300 series" "hp LaserJet 2300
series x.x.x.162" ""
network socket://x.x.x.164 "hp LaserJet 1300n" "hp LaserJet 1300n x.x.x.164" ""
network socket://x.x.x.165 "Brother HL-2700CN series" "Brother
HL-2700CN series x.x.x.165" ""
network socket://x.x.x.166 "hp LaserJet 4250" "hp LaserJet 4250 x.x.x.166" ""
network socket://x.x.x.167 "Dell Laser Printer 3100cn" "Dell Laser
Printer 3100cn x.x.x.167" ""
network socket://x.x.x.168 "hp color LaserJet 5550 " "hp color
LaserJet 5550 x.x.x.168" ""
network socket://x.x.x.169 "hp LaserJet 4250" "hp LaserJet 4250 x.x.x.169" ""
network soc...

Revision history for this message
zzxtty (zzxtty) wrote :

I haven't had any luck installing your system-config-printer update,
the package add program complains about python-support, 'Dependency is
not satisfiable: python-support' .

mort@coffee:~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"
mort@coffee:~$

I think this may be more of a design issue than a bug. As you can see
from the output in previous emails there are lots of printers on the
network, even if you got this list back in seconds (rather than
minutes) its not a great deal of use.

1. you cant search it
2. if you know how to find the printer you want (i'm guessing the only
way to do this is by IP address) then you could have entered the
details manually (and saved yourself 10 minutes)

From my point of view i would prefer there to be an extra step, after
clicking on add printer you should be given a choice of either
automatically listing printers, or manually specifying one.

Chris

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

A Cancel button as described in bug 139335 (now duped) would help here.

Changed in system-config-printer:
importance: Undecided → Low
Revision history for this message
Tim Waugh (twaugh) wrote :

It would not fix the actual problem, which remains a mystery.

Revision history for this message
Tim Waugh (twaugh) wrote :

I've added some debugging output (svn revision 1847) which I think will illuminate this problem. For each remote printer, we apparently now run the CUPS SNMP backend as well as 'hp-makeuri' -- both of these take quite a while to run.

Till, is this strictly necessary? Can we make these run in a background thread or something?

Anyone: can someone please confirm that they are still seeing this problem?

Revision history for this message
Simon Anders (sanders) wrote :

I have precisely the same problem. We have a large LAN here, and if I want to change the printer confuguration, Gutsy's printer configuration hangs for a quarter of an hour. With my laptop, which still runs Dapper, I have no problem at all.

If this is of help, I can provide you with further diagnostics. I'd say this bug is serious, and shouldn't be marked as of 'low' importance.

Revision history for this message
Simon Anders (sanders) wrote :

Let's say that a cancel button is added then were is still one more point: Let's that I want to add a network printer and I know its make and model and its IP address or DNS name. Now, if the user does not want to use the search function (because it does take 15 minutes for a large network) he should be given the option to enter this information manually. Even with a cancel butten, the user would have to type into the URI line something like "socket://myprinter.mycompany.com:9100". At least a hint for the correct format of this URI would be needed, or better, a dialog that asks for IP address or DNS name and a port (defaulting to 9100, or whatever the most common one is).

Revision history for this message
zzxtty (zzxtty) wrote :

Just timed my network scan, it takes 8 minutes, Simon wins.

On a slightly more seriously we have print servers, our format is
"lpd://<server>/<queue name>", if you redesign the interface you are
going to have to walk people though the various stages, I have no idea
what other types of printer configuration you can have.

A short term fix would be to simply have an "add it manually" and
"scan the network" button. I'm guessing that anybody on a large
network will have a sysadmin team that will be able to provided the
device uri. The next stage would be to design a set of interfaces
prompting for manual configuration options.

I would agree that this is slightly higher than low priority,
configuring printers is a very basic need, and I'm guessing that a lot
of people probably are on large networks, think university students...

On 22/01/2008, Simon Anders <email address hidden> wrote:
> Let's say that a cancel button is added then were is still one more
> point: Let's that I want to add a network printer and I know its make
> and model and its IP address or DNS name. Now, if the user does not want
> to use the search function (because it does take 15 minutes for a large
> network) he should be given the option to enter this information
> manually. Even with a cancel butten, the user would have to type into
> the URI line something like "socket://myprinter.mycompany.com:9100". At
> least a hint for the correct format of this URI would be needed, or
> better, a dialog that asks for IP address or DNS name and a port
> (defaulting to 9100, or whatever the most common one is).
>
> --
> 'New Printer' = hang over network
> https://bugs.launchpad.net/bugs/165197
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Tim Waugh (twaugh) wrote :

But this long delay is the result of a bug. The actual time it takes CUPS to report network printers to us is very small, but system-config-printer currently does lots of post-processing to this information, notably running 'hp-makeuri' and the CUPS 'snmp' backend on some things.

If this is really necessary to do it ought to be done in a separate thread with a call-back to update the UI, so that the UI is not blocked. This way, (a) there won't be such a huge delay, just a few moments while CUPS runs its backends, (b) those who know the IP address will be able to select it from the list, or choose the option in the list to specify it, and (c) there will be no need for a cancel button because the UI is no blocked waiting for look-ups to complete.

If it can't be done that way, I will take out the hp-makeuri calls altogether.

Till, I'm still a little unclear on what it is they add -- do we really want to use the 'hp' backend for remote HP printers?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I think the HP support we should re-architecture somewhat.

Currently on each printer hp-makeuri is once called to check whether it is an HP printer and if it is the case it is called again to see whether it has a fax facility, so that HP printers are shown as HPLIP supported and multi-function printers are shown twice, once for their printer part and once for their fax part. Getting the list this way only works with the hp-makeuri calls.

The CUPS SNMP is directly called to determine make and model if a printer is not auto-detected but its IP is entered by hand. The bug is here that the call always happens, also for auto-detected printers. The call needs to be an extra "if" to check whether there is already make/model/device ID info and if so the call should be skipped.

The suggested new way would be, to only poll the device list from CUPS and not doing any call of any network tool to get extra info from the printers (or to have a kind of "detailed printer list" option for the old behaviour). Now when the user selects a detected printer entry the extra information only for this printer will be polled using snmp and hp-makeuri. If it turns out now that the printer is a fax-capable multi-function device, there can be two possible architectures:

1. A pop-up appears asking whether the user wants to set up the printer or the fax

2. The printer wizard gets continued for setting up the printer, after that the printer wizard goes through its steps again for the fax, either beginning with the model/driver step (as the URI is already known) or even only doing the queue name/description/location step (as there is only one PPD for the fax). If the wizard repeats steps for the fax queue, it must be clearly shown that it is about the fax queue now.

WDYT about doing it this way?

Revision history for this message
Tim Waugh (twaugh) wrote :

Yes, much better. I think option 1 is better, although it might be nicer to have a separate wizard screen for asking which mode to configure rather than a pop-up.

Revision history for this message
William F Pearson (wfpearson) wrote :

If i get a vote for the fix, I would much rather have separate wizards
and manual configuration. I also think the difference between local
and network printers should be distinguished. I'f I'm trying to
install a local photo printer the utility shouldn't need to scan the
network at all. The ability to export and import settings would be
great for deployment, but that's a bit beyond the scope of the bug.

Changed in system-config-printer:
assignee: nobody → till-kamppeter
importance: Low → Medium
milestone: none → ubuntu-8.04
status: Confirmed → In Progress
Changed in system-config-printer:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package system-config-printer - 0.7.81+svn1976-0ubuntu4

---------------
system-config-printer (0.7.81+svn1976-0ubuntu4) hardy; urgency=low

  * debian/patches/15_hpfax_queue_for_network_printer_and_hpfax2.patch:
    system-config-printer was not able any more to create fax queues
    for network-connected HP multi-function devices after fixing
    LP: #165197. This is fixed by this patch. The patch also removes
    the newline character from the end of HPLIP URIs for network
    print and fax queues and it also adds support for HP's new fax
    device class "HP Fax 2" (HP LaserJet M2727),
  * debian/patches/17_model-name-cleanup-improvements.patch: Fixed and
    improved filtering of driver information from printer model names
    to clean list of printer models. Now more types of version numbers
    are removed and model names are not so easily broken, like for
    example "PSC" was converted to "C" (LP: #205107).
  * debian/patches/20_laserjet-1200-1300-no-postscript.patch: For HP LaserJet
    12xx/13xx prefer HPIJS over PostScript, as they do not have enough
    memory to render complex graphics with their on-board PostScript
    interpreter. This is a workaround for the time being until HP fixes
    this in the HPLIP-generated PPDs (LP: #172550).

 -- Till Kamppeter <email address hidden> Sun, 23 Mar 2008 23:59:37 +0100

Changed in system-config-printer:
status: Fix Committed → Fix Released
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Tim, I have now implemented option (1) with a simple pop-up dialog (also upstream in the SVN). Feel free to convert this into a wizard page, perhaps with check boxes and not radio buttons and when both check boxes are checked the wizard could set up the printer and the fax, as I suggested in option (2).

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

If it still takes too long and you do not intend to print via Bluetooth, deactivate the Bluetooth backend with

sudo chmod -x /usr/lib/cups/backend/bluetooth

and try again (and report a bug in bluez-cups).

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Bluetooth problem reported as bug 206579.

Revision history for this message
Raffi Enficiaud (raffi-enficiaud-x) wrote :
Download full text (16.0 KiB)

Hello all,

I am experiencing a lot of trouble with the "add printer" functionality. I am on a large network also, running Maverick 64bits (in French, so the exact translation may be inaccurate) and with latest updates. The "scan for lan printer" option is inactivated.

When I click "add new printer", I do not know why, but the dialog get stuck if I wait too long (let say 5/7 sec). It seems that the backend is scanning for the network printer, even if I did not ask to (I know the name of the printer). So what I tried is to add the printer "as fast as I could". I am really not asking for this functionality, but I do not know how to inactivate it. It seems that the dialog scans ALWAYS the network. I give some log below, which shows that the net scanning is experiencing some packet errors.

In the next dialog, asking to choose the printer type, same phenomena: get frozen if I wait too long to make my choice (the "looking for drivers" dialog). It seems that the part that freezes the first dialog is still running, and possibly freeze the backend somehow (while I guess the scanning should stop once the printer is chosen). Again I tried to add a generic printer "as fast as I could".

And again for the drivers type (say PCL 6e generic). Ok then I have a dummy printer, that I am able to reconfigure somehow.

I restarted avahi, same things occur.
Here is the log just after restarting avahi. The dialog open during the network exchanges was the "looking for drivers" (I killed it after 30mn).

Regards,
Raffi

Nov 25 10:17:24 lavande avahi-daemon[896]: Got SIGTERM, quitting.
Nov 25 10:17:24 lavande avahi-daemon[896]: Leaving mDNS multicast group on interface eth0.IPv6 with address 2001:660:3013:3:222:19ff:fe16:f040.
Nov 25 10:17:24 lavande avahi-daemon[896]: Leaving mDNS multicast group on interface eth0.IPv4 with address 128.93.24.44.
Nov 25 10:17:24 lavande avahi-daemon[896]: avahi-daemon 0.6.27 exiting.
Nov 25 10:17:24 lavande init: avahi-daemon main process ended, respawning
Nov 25 10:17:24 lavande avahi-daemon[18769]: Found user 'avahi' (UID 104) and group 'avahi' (GID 109).
Nov 25 10:17:24 lavande avahi-daemon[18769]: Successfully dropped root privileges.
Nov 25 10:17:24 lavande avahi-daemon[18769]: avahi-daemon 0.6.27 starting up.
Nov 25 10:17:24 lavande avahi-daemon[18769]: Successfully called chroot().
Nov 25 10:17:24 lavande avahi-daemon[18769]: Successfully dropped remaining capabilities.
Nov 25 10:17:24 lavande avahi-daemon[18769]: No service file found in /etc/avahi/services.
Nov 25 10:17:24 lavande avahi-daemon[18769]: Joining mDNS multicast group on interface eth0.IPv6 with address 2001:660:3013:3:222:19ff:fe16:f040.
Nov 25 10:17:24 lavande avahi-daemon[18769]: New relevant interface eth0.IPv6 for mDNS.
Nov 25 10:17:24 lavande avahi-daemon[18769]: Joining mDNS multicast group on interface eth0.IPv4 with address 128.93.24.44.
Nov 25 10:17:24 lavande avahi-daemon[18769]: New relevant interface eth0.IPv4 for mDNS.
Nov 25 10:17:24 lavande avahi-daemon[18769]: Network interface enumeration completed.
Nov 25 10:17:24 lavande avahi-daemon[18769]: Registering new address record for 2001:660:3013:3:222:19ff:fe16:f040 on eth0.*.
Nov 25 10:17:24 lav...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.