Bug 11271 - Windows 7 does not access Samba print share
Summary: Windows 7 does not access Samba print share
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Printing (show other bugs)
Version: 4.1.17
Hardware: x64 Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: printing-maintainers
QA Contact: Samba QA Contact
Depends on:
Reported: 2015-05-11 19:53 UTC by Roger Howard
Modified: 2015-07-31 09:03 UTC (History)
3 users (show)

See Also:

smb.conf file (1.30 KB, text/plain)
2015-05-11 19:53 UTC, Roger Howard
no flags Details
samba log files (62.64 KB, text/plain)
2015-07-21 17:09 UTC, Roger Howard
no flags Details
samba tdb files (15.62 KB, application/octet-stream)
2015-07-21 17:11 UTC, Roger Howard
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Howard 2015-05-11 19:53:39 UTC
Created attachment 11042 [details]
smb.conf file

Windows 7 fails in an attempt to send a print job to a share \\LYNX\rp with the error "The procedure number is out of range." The job originates in a simple batch script, and the printer share is defined in an smb.conf file on a machine recently upgraded to Debian Jessie. Things worked before the upgrade on Samba version 3.6.6 

The samba log file reports connection to the printer with no error comment, then a subsequent disconnect. A zero-length print file is left in the /tmp directory used in definition of the print share.

The system was also exhibiting behaviour described in bug 10604, but that problem was fixed by removing winbind which is not needed for a simple workgroup standalone server.
Comment 1 Andreas Schneider 2015-05-18 12:21:29 UTC
I'm sorry bug Samba 3.6 is EOL, see https://wiki.samba.org/index.php/Samba_Release_Planning
Comment 2 Roger Howard 2015-05-18 14:06:40 UTC
The bug exists in the latest version of Samba provided by the Debian Jessie i.e. release 4.1.17

Samba 3.6.6 worked OK.
Comment 3 Roger Howard 2015-06-17 16:58:08 UTC
I do not expect bugs to be fixed instantly, but I do find it somewhat frustrating that the only response to this bug report is a comment that Samba 3.6 is EOL. The bug has been introduced in Samba 4. In attempts to access a print share from Windows, I get the comment "The procedure number is out of range." Microsoft state categorically that this is due to changes in the application:

"Contact the supplier of the running distributed application. There is a version control problem in the application that can only be fixed by the application supplier (procedures were added to an .IDL file without changing the version number)."

Something has been changed in Samba 4, and I suspect there is a simple smb.conf file fix for it. I would appreciate beking told what it is.
Comment 4 Aurélien Aptel 2015-07-20 10:28:32 UTC
I've tried reproducing the bug using a Win7 vm and a raw printer on my linux box.

I'm using samba 4.1.18 with cups. The test printer was added like this:

# lpadmin -p myrawprint -E -v file:///tmp/print_file

On the win7 box I was able to add \\linuxbox\myrawprint (using Generic\Text driver) successfully and print the test page which appeared in /tmp/print_file.

I'm using the default smb.conf with the generic printer share that automatically handles the system printers. Here are the global and printer related parts, maybe that can help you. In any case, logs from the samba server and/or a tcpdump could be really helpful.

        workgroup = WORKGROUP
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = No
        netbios name = AAPTELPC
        wins server = 
        wins support = No
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = Yes
        guest ok = Yes
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775
Comment 5 Roger Howard 2015-07-20 17:16:41 UTC
(In reply to Aurélien Aptel from comment #4)
My printer works fine, but is old enough to need a parallel port connection, so I use a parallel port/usb adapter and connect it as /dev/usb/lp0 

cups did not handle the connection properly (repeatedly disconnecting) so I reverted to much simpler bsd printing; that works well as I have only one printer.

The printer rp on the linux box lynx is a share defined in the smb.conf file I attached to my original report for this bug. The simplest test from windows 7 is to use the command "copy testfile \\lynx\rp"; this works on a linux box that has not been upgraded to debian 8, but it does not work on debian 8. That upgrade moved from samba 3.6 to 4.1

At log level 3 there is little useful information, other than reporting the connection to service rp on lynx, but there are about 3000 lines if I go to log level 10; would it be useful to provide that?
Comment 6 Aurélien Aptel 2015-07-21 12:24:25 UTC
Can you upload the verbose log file and a tcpdump of the exchange? You can use RawCap[1] on Windows.

1: http://www.netresec.com/?page=RawCap
Comment 7 Andreas Schneider 2015-07-21 12:55:05 UTC
I suggest to read:

Comment 8 Roger Howard 2015-07-21 17:09:37 UTC
Created attachment 11279 [details]
samba log files
Comment 9 Roger Howard 2015-07-21 17:11:33 UTC
Created attachment 11280 [details]
samba tdb files
Comment 10 Roger Howard 2015-07-21 17:27:27 UTC
Attached are samba logs and tdb files in compressed tar format. The system consists of a subnet with 3-bit address space and fixed IP addresses. The DNS records are maintained by the ISP who is connected by ADSL.

The machine lynx runs completely up to date Debian jessie and is attached to the printer by a parallel port/usb adapter. The windows machine runs WIndows 7 professional, and when the command "copy testfile \\lynx\rp" is entered, responds with the message "The procedure number is out of range." No printing is done, but a zero-length file is left in /tmp, he directory specified by the print share rp.

I have a second Debian machine which has not been updated from wheezy, as I can use it as an indirect route to the printer. The three machines share file systems using nfs and samba, and there is no problem with accessing samba shares on windows. Windows shares can be mounted on the linux machines without any problem, though the upgrade did require a syntax change in the mount command.

All machines have the same users, with the same passwords; there is no "admin" user on Windows 7, and user roger has admin capabilities there.
Comment 11 Roger Howard 2015-07-28 15:35:52 UTC
The problem was the line "disable spoolss = yes" in smb.conf

This line was originally included as a suggestion from a HOWTO, supposedly needed to prevent samba from loading all the printers listed in /etc/printcap; this was obviously wrong, but did not cause any problems with samba 3.6.6 and only showed up after the upgrade to samba 4.1 made in Debian jessie.

In future I will not believe everything I read in HOWTO files.