Bug 213119 - Can't print to networked CUPS printer
Can't print to networked CUPS printer
Status: CLOSED DUPLICATE of bug 219806
Product: Fedora
Classification: Fedora
Component: gtk2 (Show other bugs)
6
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Matthias Clasen
:
: 214415 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-30 16:10 EST by Frank Cox
Modified: 2007-11-30 17:11 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-10 09:05:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Frank Cox 2006-10-30 16:10:22 EST
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 05:41:34 EST
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 10:00:39 EST
Changing that setting does indeed allow me to print to the remote cups printer
as expected.
Comment 3 Caolan McNamara 2006-10-31 10:13:38 EST
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 12:10:13 EST
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 04:43:33 EST
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 04:47:16 EST
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 07:45:09 EST
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 08:00:26 EST
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 10:31:36 EST
 python -c "import cups;c=cups.Connection();print c.getPPD('Samsung')"
/tmp/45631b9a8d3a2
Comment 10 Tim Waugh 2006-11-21 13:23:31 EST
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 14:50:07 EST
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 06:07:37 EST
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 12:27:02 EST
Frank, What does this command say, as root?:

grep -i browseshortnames /etc/cups/cupsd.conf
Comment 15 Frank Cox 2006-11-23 12:35:12 EST
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 12:37:49 EST
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 13:11:26 EST
> 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 13:15:28 EST
Okay, then bug #217017 is a separate issue.
Comment 19 Matthias Clasen 2006-12-01 21:52:19 EST
*** Bug 214415 has been marked as a duplicate of this bug. ***
Comment 20 Tim Waugh 2006-12-06 09:16:38 EST
A 'strace -s1000 -econnect,sendto,recvfrom -f oowriter' log would probably help
to narrow down the problem.
Comment 21 Tim Waugh 2006-12-13 06:40:32 EST
..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 09:39:13 EST
Created attachment 143519 [details]
strace -s1000 -econnect,send,recv,close -f oowriter 2>strace.log
Comment 23 Tim Waugh 2006-12-13 09:41:36 EST
Chris: did you try and print something here?
Comment 24 Chris Runge 2006-12-13 09:49:59 EST
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 10:04:46 EST
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-03 21:31:40 EST
Created attachment 144761 [details]
strace.log for ooo writer
Comment 27 Austin Jackson 2007-01-03 21:33:27 EST
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 05:50:50 EST
[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 11:08:00 EST
Nope, it is running:

cupsd (pid 1909) is running...
Comment 30 Tim Waugh 2007-01-04 11:13:28 EST
What does this say, as root?:

grep -E '^(Listen|Port)' /etc/cups/cupsd.conf
Comment 31 Austin Jackson 2007-01-04 11:16:19 EST
Listen localhost:631
Listen /var/run/cups/cups.sock
Comment 32 Tim Waugh 2007-01-04 11:34:50 EST
What does 'netstat -ntlp | grep -w 631' say, again as root?
Comment 33 Austin Jackson 2007-01-04 15:23:10 EST
Nothing.
Comment 34 Tim Waugh 2007-01-04 15:33:48 EST
Can you attach /var/log/cups/error_log?  Use bzip2 on it if it is very large.
Comment 35 Austin Jackson 2007-01-04 15:46:31 EST
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 05:49:15 EST
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 06:56:02 EST
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 09:58:43 EST
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 10:04:52 EST
# 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 10:10:11 EST
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 10:44:41 EST
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 10:51:57 EST
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 10:56:52 EST
Agreed.  Thank you for your help Rex and Tim.
Comment 44 Chris Runge 2007-01-05 14:32:35 EST
FWIW I have the problem and I'm not running VMware.
Comment 45 Rex Dieter 2007-01-05 14:37:08 EST
Chris,
$ netstat -ntlp | grep -w 631
$ grep localhost /etc/hosts
Comment 46 Chris Runge 2007-01-05 14:39:32 EST
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 14:42:20 EST
Created attachment 144923 [details]
CUPS error log
Comment 48 Rex Dieter 2007-01-05 14:51:43 EST
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 15:18:43 EST
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 18:58:35 EST
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 15:44:02 EST
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 05:32:04 EST
So please start again from comment #20. :-)  I'd like to see the strace output.
Comment 53 Chris Runge 2007-01-09 17:26:24 EST
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 17:27:54 EST
/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 04:44:24 EST
[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 08:41:33 EST
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 09:05:20 EST
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.