After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 429845 - gnome-print sees but won't print to network printer
gnome-print sees but won't print to network printer
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.12.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-04-15 01:35 UTC by alan426
Modified: 2009-06-12 14:29 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Usable printer is greyed out, so it cannot be selected (35.84 KB, image/png)
2008-05-29 02:46 UTC, Lachlan Michael
Details
Using LPR printing is fine. (35.46 KB, image/png)
2008-05-29 02:46 UTC, Lachlan Michael
Details
CUPS setup is fine. (107.69 KB, image/png)
2008-05-29 02:47 UTC, Lachlan Michael
Details
CUPS see the printer alright. (26.23 KB, image/png)
2008-05-29 02:47 UTC, Lachlan Michael
Details
Openoffice sees the printer fine. Printing works (including duplex). (41.89 KB, image/png)
2008-05-29 02:48 UTC, Lachlan Michael
Details
Firefox sees the printer fine. (38.38 KB, image/png)
2008-05-29 02:48 UTC, Lachlan Michael
Details

Description alan426 2007-04-15 01:35:36 UTC
Please describe the problem:
This is Ubuntu Feisty 7.04 beta clean install. Two printers installed, one local and one network via SMB to windows XP box.

gtk-demo and other gnome applications can see and print to the local printer. Network printer appears in dialog box, but 'Print' button is grayed out. Printing works ok with other apps, such as gimp, firefox, and OOo.

Steps to reproduce:
1. Configure as above
2. gtk-demo
3. Select network printer from the list.  You will see Print button greyed out.  Select local printer, Print will be enabled.


Actual results:
Can't print.

Expected results:
Prints.

Does this happen every time?
Yes.

Other information:
Same configure worked fine in 6.10 Edgy.  Something has changed.
Comment 1 Kjartan Maraas 2008-01-29 13:09:43 UTC
Moving all gnome-cups-manager bugs to new product. Filter on Kjartan's spring cleaning.
Comment 2 Lachlan Michael 2008-05-29 02:46:17 UTC
Created attachment 111695 [details]
Usable printer is greyed out, so it cannot be selected
Comment 3 Lachlan Michael 2008-05-29 02:46:46 UTC
Created attachment 111696 [details]
Using LPR printing is fine.
Comment 4 Lachlan Michael 2008-05-29 02:47:15 UTC
Created attachment 111697 [details]
CUPS setup is fine.
Comment 5 Lachlan Michael 2008-05-29 02:47:43 UTC
Created attachment 111698 [details]
CUPS see the printer alright.
Comment 6 Lachlan Michael 2008-05-29 02:48:18 UTC
Created attachment 111699 [details]
Openoffice sees the printer fine. Printing works (including duplex).
Comment 7 Lachlan Michael 2008-05-29 02:48:46 UTC
Created attachment 111700 [details]
Firefox sees the printer fine.
Comment 8 Lachlan Michael 2008-05-29 02:50:51 UTC
I have the same problem (Gnome 2.22.2, FreeBSD). 

Printing works from LPR, but doesn't from a network printer.

Please see the attachments above, particularly #2 (Usable printer is greyed out).
Comment 9 Andrew Ruthven 2008-09-05 06:08:49 UTC
I'm seeing this as well with Debian Lenny and Sid boxes.

The most frustrating thing is that the button is greyed out, but there is no indication as to why it is disabled.
Comment 10 Philippe Chaintreuil 2009-04-20 16:06:30 UTC
Is everyone seeing this problem using IP6 perchance?  And is everyone having this issue via CUPS?  (ie, Speak up if you're on an IP4 only system or if you're having this problem and don't use CUPS.)
Comment 11 Philippe Chaintreuil 2009-04-20 16:17:33 UTC
I'm seeing the following line in my CUPS log (/var/log/cups/error_log) every time I select a printer that has a greyed out "Print" button:

---------------------------------------------------------------------
W [20/Apr/2009:12:08:57 -0400] Request from "localhost" using invalid Host: field "::1"
---------------------------------------------------------------------

That's with "LogLevel Info"; "LogLevel debug" gives a little more information:

---------------------------------------------------------------------
D [20/Apr/2009:12:08:57 -0400] cupsdAcceptClient: 11 from localhost:631 (IPv6)
D [20/Apr/2009:12:08:57 -0400] cupsdReadClient: 11 GET /printers/ricoh_aficio_2035e.ppd HTTP/1.1
D [20/Apr/2009:12:08:57 -0400] cupsdAuthorize: No authentication data provided.
W [20/Apr/2009:12:08:57 -0400] Request from "localhost" using invalid Host: field "::1"
D [20/Apr/2009:12:08:57 -0400] cupsdSendError: 11 code=400 (Bad Request)
D [20/Apr/2009:12:08:57 -0400] cupsdCloseClient: 11
---------------------------------------------------------------------

You can ignore the "No authentication data provided" I'm pretty sure.  The transaction before is getting the list of printers and it works just fine even with that same line.
Comment 12 Philippe Chaintreuil 2009-04-20 16:40:44 UTC
Okay, I think I may have found a hack to fix this.

I added the line:

---------------------------------------------------
HostNameLookups Double
---------------------------------------------------

to my /etc/cups/cupsd.conf near the top (after my "LogLevel" line).

This tells cups to do a reverse lookup and to make sure it's not an invalid hostname.

http://www.cups.org/doc-1.1/sam.html#HostNameLookups

By default this is set to "Off", for performance reasons.  Setting it to "On" would probably work as well as I think just the conversion from "::1" to "localhost" is what's fixing it, but "Double" is probably a little more secure from spoofing, etc.


I don't know if this is a GTK bug (is it being sent wrong?) or if it's a CUPS bug (should CUPS handle the "::1" better?)....  I'm also curious if this is just the fix for me, or if it's the fix for everyone who had the problem.


P.S.  I'm running CUPS 1.3.10.
Comment 13 Philippe Chaintreuil 2009-04-21 21:30:53 UTC
I reported an upstream bug, they say the ip6 loopback string is invalid and marked the bug "WONT FIX".

http://www.cups.org/str.php?L3162

They say that the RFC says "::1" is not the proper loopback and it should be "[::1]" instead.
Comment 14 Matthias Clasen 2009-04-21 22:23:18 UTC
::1 is a perfectly fine ipv6 address. The fact that it needs to be used as [::1] in urls and http headers is a different matter. 

We need to figure out how the ::1 ends up in the http request that is rejected by cups.
Comment 15 Philippe Chaintreuil 2009-04-22 12:37:15 UTC
> We need to figure out how the ::1 ends up in the http request that is
> rejected by cups.

**Sigh.**  I was hoping you knew.
Comment 16 Martin von Gagern 2009-04-22 18:52:10 UTC
Found the cause, it's httpSeparateURI from CUPS: http://cups.org/str.php?L3164

cups_request_printer_list_cb() at gtkprintbackendcups.c:1324 calls that with a valid URL like "ipp://[::1]:631/printers/foo" and will receive a host name like "::1" in return. It will simply pass that name to httpConnectEncrypt() where it will be stored as the host name, causing the problematic header to be set upon the next invocation of httpClearFields.
Comment 17 Matthias Clasen 2009-04-22 19:02:57 UTC
Hmm, time to reopen the cups bug :-)
Of course, we should work around it in our code too...
Comment 18 Philippe Chaintreuil 2009-04-22 20:35:34 UTC
Good find Martin!
Comment 19 Martin von Gagern 2009-04-22 21:40:11 UTC
(In reply to comment #17)
> Of course, we should work around it in our code too...

Upstream writes (in http://www.cups.org/str.php?L3164):

  The GNOME folks should NOT be reconnecting to spool directly to the server
  reported in the printer-uri-supported attribute - all jobs can and should
  go through the local server.

So that's probably the direction to take, in order to use CUPS as its devs meant it to be used, and avoid future trouble.
Comment 20 Eric Siegel 2009-06-10 04:01:04 UTC
(In reply to comment #12)
> Okay, I think I may have found a hack to fix this.
> 
> I added the line:
> 
> ---------------------------------------------------
> HostNameLookups Double
> ---------------------------------------------------
> 
> to my /etc/cups/cupsd.conf near the top (after my "LogLevel" line).
> 
> This tells cups to do a reverse lookup and to make sure it's not an invalid
> hostname.
> 
> http://www.cups.org/doc-1.1/sam.html#HostNameLookups
> 
> By default this is set to "Off", for performance reasons.  Setting it to "On"
> would probably work as well as I think just the conversion from "::1" to
> "localhost" is what's fixing it, but "Double" is probably a little more secure
> from spoofing, etc.
> 
> 
> I don't know if this is a GTK bug (is it being sent wrong?) or if it's a CUPS
> bug (should CUPS handle the "::1" better?)....  I'm also curious if this is
> just the fix for me, or if it's the fix for everyone who had the problem.
> 
> 
> P.S.  I'm running CUPS 1.3.10.
> 

Wow, that fixed my problem.  All apps could print to my remote printer except GTK apps, where the print button was greyed out.  HostNameLookups Double fixed it.
Comment 21 Lachlan Michael 2009-06-12 03:55:19 UTC
I'm not sure what was fixed but in 2.26.2 this issue is fixed for me. Yay!

As far as I am concerned, this bug can be closed.

Note I did not edit cupsd.conf as mentioned in Comment#12.
Comment 22 Martin von Gagern 2009-06-12 08:47:29 UTC
If this bug report here is closed, a new report should be created to track the issue from comment #19.
Unless someone believes that has been addressed as well, and can point out the changeset which fixed this. I don't think it has been taken care of yet.
Comment 23 Matthias Clasen 2009-06-12 13:41:57 UTC
thanks for letting us know
Comment 24 Martin von Gagern 2009-06-12 14:29:13 UTC
(In reply to comment #22)
> If this bug report here is closed, a new report should be created to track the
> issue from comment #19.

Filed bug #585565 for this.