Bug 9745 - 4.0.5 git does not print from Windows 7.
Summary: 4.0.5 git does not print from Windows 7.
Status: RESOLVED INVALID
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: printing (show other bugs)
Version: unspecified
Hardware: x86 Linux
: P5 major (vote)
Target Milestone: ---
Assignee: printing-maintainers
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-27 16:55 UTC by steve (retry timeout exceeded; no DNS MX or A record)
Modified: 2013-09-04 09:41 UTC (History)
3 users (show)

See Also:


Attachments
wireshark and level 10 debug from DC during a print job from a w7 client (3.64 MB, application/x-tar)
2013-03-27 16:55 UTC, steve (retry timeout exceeded; no DNS MX or A record)
no flags Details
cupsd.conf (6.78 KB, application/octet-stream)
2013-04-03 07:47 UTC, steve (retry timeout exceeded; no DNS MX or A record)
no flags Details
log 10 of /usr/local/samba/var/log.smbd (3.59 MB, text/plain)
2013-05-23 15:34 UTC, steve (retry timeout exceeded; no DNS MX or A record)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description steve (retry timeout exceeded; no DNS MX or A record) 2013-03-27 16:55:05 UTC
Created attachment 8689 [details]
wireshark and level 10 debug from DC during a print job from a w7 client

I installed the printer HP Deskjet F2800 in W7 using the HP f2200 series driver with which it worked with 4.0.0. It was installed successfully. I used the method at:
http://wiki.samba.org/index.php/Samba4/HOWTO#Step_13:_Setup_a_Printer_share

1. It does not appear in windows explorer.
2. It seems to accept print jobs.
3. The job appears and then disappears as if it's been printed. 
4. Nothing is printed.

The printer prints OK from the DC and from remote Linux clients connected to the domain.

- - -
Version 4.0.5-GIT-9ec44d4

smb.conf
[printers]
    comment = All Printers
    path = /usr/local/samba/var/spool
    browseable = Yes
    read only = No
        printable = Yes

[print$]
    comment = Point and Print Printer Drivers
    path = /usr/local/samba/var/print
    read only = No

testparm
[printers]
        comment = All Printers
        path = /usr/local/samba/var/spool
        read only = No
        printable = Yes
        print ok = Yes
        browseable = No

[print$]
        comment = Point and Print Printer Drivers
        path = /usr/local/samba/var/print
        read only = No
Comment 1 David Disseldorp 2013-03-27 17:05:03 UTC
Comment on attachment 8689 [details]
wireshark and level 10 debug from DC during a print job from a w7 client

Doesn't look like the client is sending a print job to the server - the only traffic in the network trace is a connect(IPC$) followed by a FSCTL_DFS_GET_REFERRALS request.
Comment 2 David Disseldorp 2013-03-27 17:26:01 UTC
How are you attempting to submit print jobs to the server, is the printer connected to the windows client?
Please attach level 10 logs for the smbd file server, which is responsible for handling print job traffic. Your attachment appears to only include logs for the parent Samba process.
Comment 3 steve (retry timeout exceeded; no DNS MX or A record) 2013-03-27 17:37:25 UTC
(In reply to comment #2)
> How are you attempting to submit print jobs to the server, is the printer
> connected to the windows client?
> Please attach level 10 logs for the smbd file server, which is responsible for
> handling print job traffic. Your attachment appears to only include logs for
> the parent Samba process.

The DC and the file server are the same installation on the same box.

The printer is attached to the DC/file server. This is a test box with a W7 client on virtualbox.

I initiated the samba process as:
samba -i -d10 > d10-printer-trace

d10-printer-trace is what I included in the .tar.

To send a job to the printer I created a text file whilst logged in as Administrator on the w7 client. I then selected file > Print and chose the printer I had just installed.
Cheers.
Comment 4 David Disseldorp 2013-03-27 17:45:13 UTC
(In reply to comment #3)

> I initiated the samba process as:
> samba -i -d10 > d10-printer-trace
> 
> d10-printer-trace is what I included in the .tar.

This does not capture the smbd logs. They are likely logged separately to /var/log/samba/. The path can be confirmed by running:
smbd --build-options|grep -i log
Comment 5 steve (retry timeout exceeded; no DNS MX or A record) 2013-03-27 19:24:42 UTC
(In reply to comment #4)
> (In reply to comment #3)
> 
> > I initiated the samba process as:
> > samba -i -d10 > d10-printer-trace
> > 
> > d10-printer-trace is what I included in the .tar.
> 
> This does not capture the smbd logs. They are likely logged separately to
> /var/log/samba/. The path can be confirmed by running:
> smbd --build-options|grep -i log

Hi. OK
smbd --build-options|grep -i log
   LOGFILEBASE: /usr/local/samba/var
   HAVE_SYS_SYSLOG_H
   HAVE_LASTLOG_H
   HAVE_SYSLOG_H
   HAVE_LBER_LOG_PRINT_FN
   HAVE_PAM_VSYSLOG
   HAVE_SYSLOG
   HAVE_VSYSLOG
   WITH_SYSLOG

Here is log.samba and log.smbd from var:
http://dl.dropbox.com/u/45150875/samba-smbd.tar

Thanks.
Comment 6 steve (retry timeout exceeded; no DNS MX or A record) 2013-03-31 06:26:10 UTC
Hi
I added:
print ok = Yes
to smb.conf and I now get another error:

/usr/local/samba/sbin/smbd: _spoolss_OpenPrinterEx: Cannot open a printer handle for printer \\hh1

\\hh1 is the hostname of the DC. But it's not where the printer drivers are to be found that windows copied to:
\\hh1\print$\W32X86\3
nor is it in:
\\hh1\printers
where I'd expect it to be.

The:
browseable = No
on the share [printers] makes the share invisible in windows explorer. Correct? In that case, I'll not be able to choose the printer and select the driver as per the wiki. Just a thought. Cheers, Steve
Comment 7 steve (retry timeout exceeded; no DNS MX or A record) 2013-04-03 07:47:43 UTC
Created attachment 8717 [details]
cupsd.conf

Since I get 'Access Denied' (after the driver has been successfully copied to the print$ share from w7) I was wondering if the cups config was something to do with this.

We can however print fine from Linux clients joined to the domain.
Comment 8 steve (retry timeout exceeded; no DNS MX or A record) 2013-05-04 07:13:59 UTC
(In reply to comment #6)
> Hi
> I added:
> print ok = Yes
> to smb.conf and I now get another error:
> 
> /usr/local/samba/sbin/smbd: _spoolss_OpenPrinterEx: Cannot open a printer
> handle for printer \\hh1
> 
> \\hh1 is the hostname of the DC. But it's not where the printer drivers are to
> be found that windows copied to:
> \\hh1\print$\W32X86\3
> nor is it in:
> \\hh1\printers
> where I'd expect it to be.
> 
> The:
> browseable = No
> on the share [printers] makes the share invisible in windows explorer. Correct?
> In that case, I'll not be able to choose the printer and select the driver as
> per the wiki. Just a thought. Cheers, Steve

Just tested with:
browseable = Yes

No difference. The printer does not show in windowes explorer.
Comment 9 Gerry Reno 2013-05-13 20:03:52 UTC
Adding my comments from the Samba users list on 2013/05/13:

I'm setting up cups printing with Samba 4.0.5.

I downloaded both the windows drivers and the postscript drivers and put them into /usr/share/cups/drivers/.

I configured cups through the web interface.  Created a printer and printed a test page.

I edited smb.conf and put in the necessary entries for cups printing:

    [global]
            ...
            load printers = yes
            printing = cups
            printcap name = cups
            ...

    [printers]
            comment = All Printers
            path = /srv/share/spool
            browseable = Yes
            read only = No
            printable = Yes

    [print$]
            comment = Point and Print Printer Drivers
            path = /srv/share/print
            browseable = Yes
            read only = No
            write list = root

Checked the permissions on files and target directories:

    # ls -l /usr/share/cups/drivers/
    total 2348
    -rw-r--r-- 1 root root     803 May 13 12:02 cups6.inf
    -rw-r--r-- 1 root root      72 May 13 12:02 cups6.ini
    -rw-r--r-- 1 root root   12568 May 13 12:02 cupsps6.dll
    -rw-r--r-- 1 root root   13672 May 13 12:02 cupsui6.dll
    -rwxr-xr-x 1 root root  728576 May 13 15:01 ps5ui.dll
    -rwxr-xr-x 1 root root  543232 May 13 15:01 pscript5.dll
    -rwxr-xr-x 1 root root   26038 May 13 15:01 pscript.hlp
    -rwxr-xr-x 1 root root 1060548 May 13 15:01 pscript.ntf
    #
    # ls -l /srv/share/print
    /srv/share/print:
    total 32
    drwxr-xr-x 2 root root 4096 May 12 23:13 COLOR
    drwxr-xr-x 2 root root 4096 May 12 23:13 IA64
    drwxr-xr-x 2 root root 4096 May 12 23:13 W32ALPHA
    drwxr-xr-x 2 root root 4096 May 12 23:13 W32MIPS
    drwxr-xr-x 2 root root 4096 May 12 23:13 W32PPC
    drwxr-xr-x 2 root root 4096 May 12 23:13 W32X86
    drwxr-xr-x 2 root root 4096 May 12 23:13 WIN40
    drwxr-xr-x 2 root root 4096 May 12 23:13 x64


Then ran cupsaddsmb to install the drivers into Samba:

    # PATH=/usr/local/samba/bin:$PATH cupsaddsmb -v -H localhost -U root -a
    Password for root required to access localhost via SAMBA:
    Running command: smbclient //localhost/print$ -N -A /tmp/cupsjExFEC -c 'mkdir W32X86;put /tmp/cupshtyLSS
    W32X86/Cups-PDF.ppd;put /usr/share/cups/drivers/ps5ui.dll W32X86/ps5ui.dll;put /usr/share/cups/drivers/pscript.hlp
    W32X86/pscript.hlp;put /usr/share/cups/drivers/pscript.ntf W32X86/pscript.ntf;put
    /usr/share/cups/drivers/pscript5.dll W32X86/pscript5.dll'
    Domain=[XXXXXXXXXXX] OS=[Unix] Server=[Samba 4.0.5]
    NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
    NT_STATUS_ACCESS_DENIED opening remote file \W32X86/Cups-PDF.ppd
    NT_STATUS_ACCESS_DENIED opening remote file \W32X86/ps5ui.dll
    NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript.hlp
    NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript.ntf
    NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript5.dll


And I end up getting access errors.

All the permissions look right.  I can manually create files in the directories as root.  I made sure that root user was
in smbpasswd.
Comment 10 Gerry Reno 2013-05-14 11:59:38 UTC
I'm moving the status on this bug from UNCONFIRMED back to NEW as my comments show that I was able to confirm that there are access/permissions problems in Samba 4.0.5 that are preventing printing from working properly in 4.0.5.
Comment 11 Tim Vangehugten 2013-05-22 11:40:38 UTC
Printing works again in SAMBA 4.0.6
Comment 12 steve (retry timeout exceeded; no DNS MX or A record) 2013-05-22 20:02:53 UTC
(In reply to comment #11)
> Printing works again in SAMBA 4.0.6

I don't agree. I just tried it and I get the same: 'Access is denied' just after what appears to have copied the driver files to the print$ share.

No printer is installed.
Comment 13 Gerry Reno 2013-05-22 23:08:28 UTC
I don't agree either.  Printing still not working.

Still getting the same errors as before when trying to install the CUPS drivers.

I've opened a new bug, as my scenario might be different since I'm not testing with Win7:

https://bugzilla.samba.org/show_bug.cgi?id=9901
Comment 14 Andreas Schneider 2013-05-23 12:58:52 UTC
Could someone please provide a debug level 10 log file of smbd. The one attached is from AD and not the file/printserver daemon.

https://www.samba.org/~asn/reporting_samba_bugs.txt
Comment 15 steve (retry timeout exceeded; no DNS MX or A record) 2013-05-23 15:01:08 UTC
(In reply to comment #14)
> Could someone please provide a debug level 10 log file of smbd. The one
> attached is from AD and not the file/printserver daemon.
> 
> https://www.samba.org/~asn/reporting_samba_bugs.txt

This setup has only samba running. It is both the AD and the print server. How do I separate the smbd log from the samba log?
Comment 16 steve (retry timeout exceeded; no DNS MX or A record) 2013-05-23 15:34:21 UTC
Created attachment 8912 [details]
log 10 of /usr/local/samba/var/log.smbd

deleted /usr/local/samba/var/log.smbd
ran samba
smbcontrol smbd debug 10
installed the printer driver on an xp box
attempted to print a text file from the same box

Thanks
Comment 17 steve (retry timeout exceeded; no DNS MX or A record) 2013-05-23 15:37:06 UTC
I performed the printer installation using the Administrator account with:

hh1:/home/steve # samba-tool group listmembers Print\ Operators
Administrator
hh1:/home/steve # net rpc rights grant Administrator SePrintOperatorPrivilege -UAdministrator
Enter Administrator's password:
Successfully granted rights.
Comment 18 steve (retry timeout exceeded; no DNS MX or A record) 2013-06-09 10:49:30 UTC
I found my error:

smb.conf has to look like this

[printers]
     path = /var/spool/samba
     printable = yes
     printing = CUPS

[print$]
     path = /srv/samba/Printer_drivers
     comment = Printer Drivers
     writeable = yes

[hpdeskjetf2200series]
     path = /var/spool/samba/
     browseable = yes
     printable = yes
     printer name = hpdeskjetf2200series
#printer name = "HP Deskjet F2200 series"

Note the commented out line.

The wiki entry has been changed since this bugzilla. I followed:
https://wiki.samba.org/index.php/Samba_as_a_print_server

Tested with xp.
Thanks