Bug 2355 - cups 1.1.17 RedHat EL 3 ES and samba cannot remove job
Summary: cups 1.1.17 RedHat EL 3 ES and samba cannot remove job
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Printing (show other bugs)
Version: 3.0.11
Hardware: All Linux
: P3 normal
Target Milestone: none
Assignee: Gerald (Jerry) Carter (dead mail address)
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-17 08:12 UTC by spurnelle
Modified: 2005-08-24 10:19 UTC (History)
0 users

See Also:


Attachments
windows printer status when printer begin to print (359.41 KB, image/bmp)
2005-03-08 01:19 UTC, spurnelle
no flags Details
five second after (357.64 KB, image/bmp)
2005-03-08 01:19 UTC, spurnelle
no flags Details
the samba log (195.35 KB, application/x-gzip)
2005-03-08 01:34 UTC, spurnelle
no flags Details
use bsd style commands for default printing = cups but !defined(HAVE_CUPS) (937 bytes, patch)
2005-03-08 13:59 UTC, Gerald (Jerry) Carter (dead mail address)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description spurnelle 2005-02-17 08:12:36 UTC
I configured my samba 3.0.11 with

 printing = cups
 printcap = /etc/printcap

 when In try to remove a job which are printing, I
 have a acces deny. But when I look in cups log :

[17/Feb/2005:09:49:13 +0100] cancel_job: job #2478080 doesn't exist!

If I execute lpq -P xxxx, I see that the 2478080 is the size of file to print.

I tryed with 1.1.23, I have the same problem
Comment 1 spurnelle 2005-02-18 08:44:48 UTC
Other information when I look the printer status on the client.  I see a first
time the correct tittle of the document which printing but with long document I
see after some refresh command (F5) that the title become the date of printing.
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-03-07 16:14:14 UTC
I can't reproduce this using 3.0.12pre2-SVN-build-5657.

This is what I see from cups' lpq 

$ lpq -PQ1
Q1 is not ready
Rank    Owner   Job     File(s)                         Total Size
1st     jerry   9       smbprn.00000008 Test Page       17408 bytes
2nd     jerry   10      smbprn.00000009 Test Page       17408 bytes
3rd     jerry   11      smbprn.00000010 Test Page       17408 bytes

Can you also include the output from `smbd -b | grep CUPS`?

Thanks.
Comment 3 Gerald (Jerry) Carter (dead mail address) 2005-03-07 16:58:47 UTC
what client (OS and server pack) are you testing from?

btw...my test server is running cups 1.1.21
Comment 4 spurnelle 2005-03-08 01:19:05 UTC
Created attachment 1015 [details]
windows printer status when printer begin to print
Comment 5 spurnelle 2005-03-08 01:19:48 UTC
Created attachment 1016 [details]
five second after
Comment 6 spurnelle 2005-03-08 01:25:57 UTC
from comment #2
[root@cortest root]# /usr/local/samba/sbin/smbd -b | grep CUPS
   HAVE_CUPS

from comment #3
what client (OS and server pack) are you testing from?
windows 2000 SP4

----------------------
A test : 

[root@cortest root]# lpq -P qsys1
qsys1 is ready and printing
Rank    Owner   Job     File(s)                         Total Size
active  root    1598    smbprn.00000057.G68WtU          8547328 bytes

When I try do delete from windows box
E [08/Mar/2005:09:04:39 +0100] cancel_job: job #8547328 doesn't exist!
Comment 7 spurnelle 2005-03-08 01:34:11 UTC
Created attachment 1017 [details]
the samba log

In the last line, just before printer cahe expired you can the the jobid which
is incorrect
Comment 8 Gerald (Jerry) Carter (dead mail address) 2005-03-08 07:40:08 UTC
I see what you mean in the logs.  This is *so* strange.
I have no explanation for this currently.
Comment 9 Gerald (Jerry) Carter (dead mail address) 2005-03-08 10:02:55 UTC
More notes: only the jobid and document name are incorrect.
The other fields in the job_info_2 structure are ok.
Comment 10 Gerald (Jerry) Carter (dead mail address) 2005-03-08 12:21:33 UTC
stephane,  can you confirm that this issue first popped up 
in 3.0.11 and did not exist in 3.0.x <= 3.0.10 ?
Comment 11 Gerald (Jerry) Carter (dead mail address) 2005-03-08 12:32:56 UTC
I just noticed something that is even more strange. 
smbd is built against the cups libraries, but I still 
see this:

  Running the command `/usr/bin/lp -d 'qsys1' smbprn.00000057.G68WtU; 
  rm smbprn.00000057.G68WtU' gave 0

smbd should show something like:

  cups_job_submit(9, 0x831e7e0 (-1))
  cups server left to default localhost

Are you sure that you are running the smbd you think you are?
That default print command is defined in inir_print_values()
when HAVE_CUPS is not defined.

`smbd -V` and the output from `smbclient -L localhost -N | grep Server`
should match (e.g. Server=[Samba 3.0.12pre2-SVN-build-5657]).


Comment 12 Gerald (Jerry) Carter (dead mail address) 2005-03-08 13:31:17 UTC
ha!  I reproduced it using a WIndows 98SE client.  
Comment 13 Gerald (Jerry) Carter (dead mail address) 2005-03-08 13:59:04 UTC
Created attachment 1018 [details]
use bsd style commands for default printing = cups but !defined(HAVE_CUPS)
Comment 14 Gerald (Jerry) Carter (dead mail address) 2005-03-08 14:02:29 UTC
ok.  I found the issue.  

(a) the smbd that is running is *not* the smbd in
/usr/local/samba/sbin/

(b) the 'print command', et. al. defaults we were using 
when 'printing = cups' but !defined(HAVE_CUPS) were wrong
for the lpq parsing routines.  

The resolution is to either apply the patch attached with 
this report or just manually set the printing commands to

    lpq command = /usr/bin/lpq -P'%p'
    lprm command = /usr/bin/lprm -P'%p' %j
    print command = /usr/bin/lpr -P'%p' %s; /bin/rm -f %s

Comment 15 spurnelle 2005-03-09 01:34:40 UTC
(In reply to comment #11)
> I just noticed something that is even more strange. 
> smbd is built against the cups libraries, but I still 
> see this:

It's a script making by me for try to resolve the problem, the objectif was to
try to know the jobid from the job filename.  It's doesn't work.  

>   Running the command `/usr/bin/lp -d 'qsys1' smbprn.00000057.G68WtU; 
>   rm smbprn.00000057.G68WtU' gave 0
> 
> smbd should show something like:
> 
>   cups_job_submit(9, 0x831e7e0 (-1))
>   cups server left to default localhost

But in smb.conf, I see : For printing = CUPS : If SAMBA is compiled against
libcups, then printcap = cups uses the CUPS API to submit jobs, etc. Otherwise
it maps to the System V commands with the -oraw option for printing, i.e. it
uses lp -c -d%p -oraw; rm %s. With printing = cups, and if SAMBA is compiled
against libcups, any manually set print command will be ignored.

> Are you sure that you are running the smbd you think you are?
> That default print command is defined in inir_print_values()
> when HAVE_CUPS is not defined.
> 
> `smbd -V` and the output from `smbclient -L localhost -N | grep Server`
> should match (e.g. Server=[Samba 3.0.12pre2-SVN-build-5657]).
> 

Comment 16 spurnelle 2005-03-09 03:26:45 UTC
It's seems to work fine
But the job it's not directly removed from the kob list on windows client
Comment 17 Gerald (Jerry) Carter (dead mail address) 2005-03-09 06:55:18 UTC
I have more fixes in place to maintain closer cache 
consistency.  Should be working better in the latest SAMBA_3_0
svn tree.
Comment 18 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:19:06 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.