Bug 213119 - Can't print to networked CUPS printer
Summary: Can't print to networked CUPS printer
Keywords:
Status: CLOSED DUPLICATE of bug 219806
Alias: None
Product: Fedora
Classification: Fedora
Component: gtk2
Version: 6
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact:
URL:
Whiteboard:
: 214415 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-30 21:10 UTC by Frank Cox
Modified: 2007-11-30 22:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-10 14:05:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
strace -s1000 -econnect,send,recv,close -f oowriter 2>strace.log (14.75 KB, text/plain)
2006-12-13 14:39 UTC, Chris Runge
no flags Details
strace.log for ooo writer (103.18 KB, text/plain)
2007-01-04 02:31 UTC, Austin Jackson
no flags Details
/var/log/cups/error_log (60.86 KB, application/octet-stream)
2007-01-04 20:46 UTC, Austin Jackson
no flags Details
CUPS error log (6.39 KB, application/octet-stream)
2007-01-05 19:42 UTC, Chris Runge
no flags Details
strace output (58.61 KB, text/plain)
2007-01-09 22:26 UTC, Chris Runge
no flags Details

Description Frank Cox 2006-10-30 21:10:22 UTC
Description of problem:
I have a local printer and a networked CUPS printer set up on this machine.  I
can print to the remote printer just fine with anything other than
OpenOffice.org.  When I try to print to the remote printer from OpenOffice the
"print" button is greyed out and the only available button is "Options".

I can print a test page to that printer from spadmin.  I can print a test page
from CUPS.  I can print from Gnumeric.

Version-Release number of selected component (if applicable):


How reproducible:
Every time

Steps to Reproduce:
1.Load Openoffice, start new text document
2.Print
3.Select remote cups printer.
  
Actual results:
Print button is not available

Expected results:
Print button is available

Additional info:

Comment 1 Caolan McNamara 2006-10-31 10:41:34 UTC
So the printer *is* listed in the OpenOffice.org print dialog but when you click
one on the line that describes the printer the print button does not become active ?

If you use tools->options->openoffice.org->options and toggle on the checkbox
"use openoffice.org dialog" and then use file->print you will see the
"traditional" print dialog, does that dialog work instead ?

Comment 2 Frank Cox 2006-10-31 15:00:39 UTC
Changing that setting does indeed allow me to print to the remote cups printer
as expected.

Comment 3 Caolan McNamara 2006-10-31 15:13:38 UTC
The dialog is the gtk2 dialog, OOo doesn't do much with it except throw it up,
let the dialog itself fill itself and manage itself until print is clicked and
take the results, so if print remains insensitive for a given printer I suspect
there's some glitch there.

Comment 4 Matthias Clasen 2006-10-31 17:10:13 UTC
The "Print" button becomes sensitive when gtk receives printer details from cups.
If the "Print" button does not becomes sensitive, it looks as if cups fails to
return printer details for the network printer.

Comment 5 Tim Waugh 2006-11-21 09:43:33 UTC
Matthias: do you mean fetching the PPD?  Is there some way to narrow down the
problem to whether this is CUPS or GTK+?

Comment 6 Tim Waugh 2006-11-21 09:47:16 UTC
By the way, we have Python bindings for CUPS, so it should be possible to test
fetching the PPD for a specific printer like this:

$ python
Python 2.4.4 (#1, Oct 23 2006, 13:58:18) 
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cups
>>> c=cups.Connection()
>>> c.getPPD('deskjet')
'/tmp/4562cab2a3b2b'
>>>
$ cat /tmp/4562cab2a3b2b

..to fetch the PPD for 'deskjet' (a networked printer in this case).

Comment 7 Matthias Clasen 2006-11-21 12:45:09 UTC
Yes, "receiving the details" here means getting the ppd back in response to a
cups_request_ppd() call. It is possible that the cups code in gtkcupsutils.c
needs to ignore some errors. 

Comment 8 Tim Waugh 2006-11-21 13:00:26 UTC
So, Frank, if you run this from a terminal window what does it say?:

python -c "import cups;c=cups.Connection();print c.getPPD('deskjet')"

Replace deskjet with the name of the queue you tried to click on in the dialog.


Comment 9 Frank Cox 2006-11-21 15:31:36 UTC
 python -c "import cups;c=cups.Connection();print c.getPPD('Samsung')"
/tmp/45631b9a8d3a2


Comment 10 Tim Waugh 2006-11-21 18:23:31 UTC
Then CUPS is working fine, and the problem (whatever it is) is somewhere in the
GTK+ print dialog.

Matthias: is there some way to get debugging information from that dialog?

Comment 11 Anne 2006-11-21 19:50:07 UTC
Apparently this fix is not available if you run kde.  However, I have not got 
my printers (remote) working with OOo.  I added the fully qualified servername 
to /etc/cups/client.conf.  I understand that it causes problems if you have 
both local and remote printers, but if you only have remote printers it may 
work for you.

Comment 12 Tim Waugh 2006-11-23 11:07:37 UTC
Some discussion which started on the fedora-list mailing list uncovered an error
'server-error-internal-error' which cupsGetPPD2() might return.  However, this
only comes from trying to fetch a PPD for a queue not known to that server. 
That seems unlikely to be the cause of this bug, since CUPS_GET_PRINTERS
obviously returned that queue name in its response if it's there in the GUI to
click on.  In any case, I have filed a bug upstream about this (STR #2122),
since the error ought to be client-error-not-found instead.

So the next step should be to get some debugging information from the GTK+
dialog I think.

Comment 13 Tim Waugh 2006-11-23 17:27:02 UTC
Frank, What does this command say, as root?:

grep -i browseshortnames /etc/cups/cupsd.conf


Comment 15 Frank Cox 2006-11-23 17:35:12 UTC
su -c "grep -i browseshortnames /etc/cups/cupsd.conf"
Password: 
# BrowseShortNames: whether or not to use "short" names for remote printers
#BrowseShortNames Yes


Comment 16 Tim Waugh 2006-11-23 17:37:49 UTC
That's from the FC6 machine, the same one as you're trying to print from
OpenOffice.org on?

What about 'lpstat -s'?

Comment 17 Frank Cox 2006-11-23 18:11:26 UTC
> That's from the FC6 machine, the same one as you're trying to print from
> OpenOffice.org on?

Yes.

> What about 'lpstat -s'?

lpstat -s
system default destination: Samsung
device for hp_color_LaserJet_2550_series:
hal:///org/freedesktop/Hal/devices/usb_device_3f0_1c17_00CNGKG37479_if0_printer_noserial
device for HP_color_LaserJet_2550_series_USB_00CNGKG37479_HPLIP:
hp:/usb/hp_color_LaserJet_2550_series?serial=00CNGKG37479
device for printer: ipp://mutt.melvilletheatre.net:631/printers/printer
device for Samsung: ipp://mutt/printers/printer


Comment 18 Tim Waugh 2006-11-23 18:15:28 UTC
Okay, then bug #217017 is a separate issue.

Comment 19 Matthias Clasen 2006-12-02 02:52:19 UTC
*** Bug 214415 has been marked as a duplicate of this bug. ***

Comment 20 Tim Waugh 2006-12-06 14:16:38 UTC
A 'strace -s1000 -econnect,sendto,recvfrom -f oowriter' log would probably help
to narrow down the problem.

Comment 21 Tim Waugh 2006-12-13 11:40:32 UTC
..or, for x86 arch:

strace -s1000 -econnect,send,recv,close -f oowriter 2>strace.log

Can anyone help with this?

Comment 22 Chris Runge 2006-12-13 14:39:13 UTC
Created attachment 143519 [details]
strace -s1000 -econnect,send,recv,close -f oowriter 2>strace.log

Comment 23 Tim Waugh 2006-12-13 14:41:36 UTC
Chris: did you try and print something here?

Comment 24 Chris Runge 2006-12-13 14:49:59 UTC
Yes. I started OpenOffice, brought up the print dialog (with the greyed-out
Print button), then ran the command.

Admittedly, the "document" was empty. Do you want me to retry with an actual
document with content?

Comment 25 Tim Waugh 2006-12-13 15:04:46 UTC
No, an empty document should be fine.

But run the command first, or we don't get to see why the button is greyed out.
 Did you attach strace to the running process or something?

Comment 26 Austin Jackson 2007-01-04 02:31:40 UTC
Created attachment 144761 [details]
strace.log for ooo writer

Comment 27 Austin Jackson 2007-01-04 02:33:27 UTC
Here is my strace.log from the command above.

1. Ran command, writer opened
2. typed some junk text
3. File -> Print to USB connected printer
4. Button greyed out when printer selected
5. Clicked Cancel
6. Closed writer

Comment 28 Tim Waugh 2007-01-04 10:50:50 UTC
[pid  7307] connect(39, {sa_family=AF_INET, sin_port=htons(631),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)

This looks like CUPS isn't running.  What does '/sbin/service cups status' say?


Comment 29 Austin Jackson 2007-01-04 16:08:00 UTC
Nope, it is running:

cupsd (pid 1909) is running...

Comment 30 Tim Waugh 2007-01-04 16:13:28 UTC
What does this say, as root?:

grep -E '^(Listen|Port)' /etc/cups/cupsd.conf


Comment 31 Austin Jackson 2007-01-04 16:16:19 UTC
Listen localhost:631
Listen /var/run/cups/cups.sock

Comment 32 Tim Waugh 2007-01-04 16:34:50 UTC
What does 'netstat -ntlp | grep -w 631' say, again as root?

Comment 33 Austin Jackson 2007-01-04 20:23:10 UTC
Nothing.

Comment 34 Tim Waugh 2007-01-04 20:33:48 UTC
Can you attach /var/log/cups/error_log?  Use bzip2 on it if it is very large.

Comment 35 Austin Jackson 2007-01-04 20:46:31 UTC
Created attachment 144840 [details]
/var/log/cups/error_log

Interesting error in there about not being able to bind a socket...

Comment 36 Tim Waugh 2007-01-05 10:49:15 UTC
E [07/Dec/2006:19:27:29 -0500] Unable to bind socket for address 127.0.0.1:631 -
 Cannot assign requested address.

That's *really* unexpected.  What does '/sbin/ifconfig lo' say?

Comment 37 Austin Jackson 2007-01-05 11:56:02 UTC
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:21096 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21096 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:6183390 (5.8 MiB)  TX bytes:6183390 (5.8 MiB)


I have turned off the ipv6 services and have vmware server installed and running
as a service.  Might that have anything to do with it?

Comment 38 Rex Dieter 2007-01-05 14:58:43 UTC
Some fc6 boxes I've seen get some bogus stuff into /etc/hosts regarding ipv6 and
localhost.  Could you post it's contents?

Comment 39 Austin Jackson 2007-01-05 15:04:52 UTC
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost

Comment 40 Rex Dieter 2007-01-05 15:10:11 UTC
Looks fine.   For giggles, you could try to turn off/disable vmware, and then
try to restart cups.

Comment 41 Austin Jackson 2007-01-05 15:44:41 UTC
Amazingly, that did it.  Changing the service startup order so vmware server
starts after cups solves the problem for me.  What configuration in vmware would
be causing this?

Comment 42 Rex Dieter 2007-01-05 15:51:57 UTC
Dunno, but it makes it pretty clear that this is (highly) likely a vmware issue,
and not a bug in fedora (gtk2/openoffice.org/cups).

Comment 43 Austin Jackson 2007-01-05 15:56:52 UTC
Agreed.  Thank you for your help Rex and Tim.

Comment 44 Chris Runge 2007-01-05 19:32:35 UTC
FWIW I have the problem and I'm not running VMware.

Comment 45 Rex Dieter 2007-01-05 19:37:08 UTC
Chris,
$ netstat -ntlp | grep -w 631
$ grep localhost /etc/hosts

Comment 46 Chris Runge 2007-01-05 19:39:32 UTC
I appeared to be adding my output at the same time at Rex was asking for it :)

# grep -E '^(Listen|Port)' /etc/cups/cupsd.conf
Listen localhost:631
Listen /var/run/cups/cups.sock

# netstat -ntlp | grep -w 631
tcp        0      0 127.0.0.1:631               0.0.0.0:*                  
LISTEN      2565/cupsd     
     
# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               t60p.crunge.redhat t60p localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6


Comment 47 Chris Runge 2007-01-05 19:42:20 UTC
Created attachment 144923 [details]
CUPS error log

Comment 48 Rex Dieter 2007-01-05 19:51:43 UTC
Your problem appears to be different than Austin's.   cups is at least accepting
(some) jobs:
I [05/Jan/2007:12:39:28 -0500] Job 35 queued on "caterpillar" by "crunge".
I [05/Jan/2007:12:39:28 -0500] Started backend /usr/lib/cups/backend/ipp (PID
18571) for job 35.
N [05/Jan/2007:12:39:32 -0500] [Job 35] Print file accepted - job ID 19230.

Comment 49 Chris Runge 2007-01-05 20:18:43 UTC
True. My problem(s) are:

(1) I can't print with evince or with OO2.org (when using the default print
dialog). The "Print" button is not selectable.
(2) Despite setting a default printer, every time the system is rebooted I need
to go into system-config-printer and do it again. (Perhaps unrelated to (1)).

Comment 50 Tim Waugh 2007-01-05 23:58:35 UTC
Chris: please read comment #25.  Your strace output wasn't any help because I
couldn't see the point where you printed something.

Comment 51 Austin Jackson 2007-01-08 20:44:02 UTC
I am back.  The Vmware fix resolved issues I had printing to a locally connected
USB printer via CUPS, but I just noticed I still cannot print to a networked
cups printer with the same symptoms (print button grayed out for those printers).

Comment 52 Tim Waugh 2007-01-09 10:32:04 UTC
So please start again from comment #20. :-)  I'd like to see the strace output.

Comment 53 Chris Runge 2007-01-09 22:26:24 UTC
Created attachment 145203 [details]
strace output

Sorry for the delay.

Steps:
(1) strace -s1000 -econnect,send,recv,close -f oowriter 2>strace.log (which
launced oowriter)
(2) tried to printer to a networked cups printer
(3) closed oowriter and attached the logt

I hope this helps.

Comment 54 Chris Runge 2007-01-09 22:27:54 UTC
/sigh/ sorry about the spelling mistakes in the last post... let me know if
anything isn't clear

Comment 55 Tim Waugh 2007-01-10 09:44:24 UTC
[pid 13087] recv(39, "HTTP/1.1 404 Not Found\r\nDate: Tue, 09 Jan 2007 22:23:35
GMT\r\nServer: CUPS/1.1\r\nContent-Language: en_US\r\nUpgrade:
TLS/1.0,HTTP/1.1\r\nConnection: close\r\nContent-Type:
text/html\r\nContent-Length: 138\r\n\r\n<HTML><HEAD><TITLE>404 Not
Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested resource was not found
on this server.</BODY></HTML>\n", 2048, 0) = 336

** (VCLSalFrame:13087): WARNING **: Error result: HTTP Error in GET Success

Is caterpillar a raw queue?  There doesn't seem to be a PPD for it on the server.

Comment 56 Chris Runge 2007-01-10 13:41:33 UTC
Yes. According to system-config-printer it is a "Local Raw Printer on
ns1.iad.redhat.com"

It does work with other printing applications like Firefox and when using
Openoffice.org dialogs for save/print (which isn't the default).

Comment 57 Tim Waugh 2007-01-10 14:05:20 UTC
In that case, this boils down to bug #219806.

*** This bug has been marked as a duplicate of 219806 ***


Note You need to log in before you can comment on or make changes to this bug.