Windows clients cannot connect to shared printers

Bug #967410 reported by Tony C.
280
This bug affects 51 people
Affects Status Importance Assigned to Milestone
samba
Fix Released
Medium
samba (Ubuntu)
Fix Released
High
Louis Bouchard
Precise
Fix Released
High
Louis Bouchard
Quantal
Fix Released
High
Louis Bouchard

Bug Description

SRU justification :

It is currently impossible for a USB connected printer shared on Ubuntu 12.04 to be added to a Windows XP / 7 using the "Discover printer" functionality

Impact :

Users cannot use such printers shared by Ubuntu Precise

Fix :

Samba bug #8554 provides a fix for this issue. The fix is part of the Quantal version of Samba (3.6.6)

Test Case : See comment #75 for a detailed description of how to reproduce the bug and confirm the fix

Regression : None expected as the fix is already part of the version used in Quantal

Description of the problem :

Since installing 12.04 I can no longer connect my windows XP clients to my laser printers on the Ubuntu system using samba.
It works on 11.10 using the exact same smb.conf file.
I can see the printers from the windows clients, I can select it, I install the drivers locally from the windows pc. When I click next I get the message "Windows cannot connect to the printer. Either the printer name was typed incorrectly or the specified printer has lost its connection to the sever".

This is a deal breaker for me.

Revision history for this message
James Page (james-page) wrote :

Hi Tony

Thanks for taking the time to report this bug.

If possible, please could you run the following command on the server you are having trouble connecting to:

   sudo apport-collect 967410

If this is not possible then the following log files would be helpful:

  /var/log/samba/log.*

Marking 'Incomplete' pending your response and 'High' until we get more information on what is causing this issue.

Changed in samba (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in samba (Ubuntu):
status: New → Confirmed
Revision history for this message
Tony C. (tonyc-atl-ga) wrote :
Download full text (3.9 KiB)

Using a small test setup. Exactly the same on the 32 or 64 bit versions.

After clearing out the log files and rebooting .
Performing smbclient -L localhost the printers do not show in the listing.

tony@u32:/var/log/samba$ smbclient -L localhost
Enter tony's password:
Domain=[CORPORATE] OS=[Unix] Server=[Samba 3.6.3]

 Sharename Type Comment
 --------- ---- -------
 print$ Disk Printer Drivers
 IPC$ IPC IPC Service (u32 server (Samba,))
 tony Disk Home Directories
Domain=[CORPORATE] OS=[Unix] Server=[Samba 3.6.3]

 Server Comment
 --------- -------
 DECO Denise's DeskTop
 U32 u32 server (Samba)

 Workgroup Master
 --------- -------
 CORPORATE DECO

After manually running
sudo service smbd reload
sudo service smbd restart
smbd stop/waiting
smbd start/running, process 2878

The printers now appear

tony@u32:/var/log/samba$ smbclient -L localhost
Enter tony's password:
Domain=[CORPORATE] OS=[Unix] Server=[Samba 3.6.3]

 Sharename Type Comment
 --------- ---- -------
 print$ Disk Printer Drivers
 IPC$ IPC IPC Service (u32 server (Samba))
 Brother Printer Brother HL5340D
 Brother-HL-5340D-series Printer Brother HL-5340D series
 tony Disk Home Directories
Domain=[CORPORATE] OS=[Unix] Server=[Samba 3.6.3]

 Server Comment
 --------- -------
 DECO Denise's DeskTop
 U32 u32 server (Samba)

 Workgroup Master
 --------- -------
 CORPORATE DECO

At this point, this is what is in the log.smbd file
cat log.smbd

[2012/04/02 13:17:15, 0] smbd/server.c:1051(main)
  smbd version 3.6.3 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2011
[2012/04/02 13:17:15.081522, 0] smbd/server.c:1107(main)
  standard input is not a socket, assuming -D option
[2012/04/02 13:17:15.089590, 0] printing/print_cups.c:110(cups_connect)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2012/04/02 13:17:15.090587, 0] printing/print_cups.c:487(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
[2012/04/02 13:27:39, 0] smbd/server.c:1051(main)
  smbd version 3.6.3 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2011
[2012/04/02 13:27:39.668921, 0] smbd/server.c:1107(main)
  standard input is not a socket, assuming -D option

I now go to the XP machine, open add a new printer, browse for printer.
I can see my Linux box and see the printer.
When I select the printer I can see the Comment and Status is "Ready"
Select next. I says I do not have the correct print drivers do i want to install locally. ( this is correct i did not install them on the linux box )
I select the correct drivers and click next. A 'Connect to Printer' dialog box appears with the message
'Windows cannot connect to the printer. Either the printer name was typed incorrectly or the printer has lost its connection to the server"

At this point the log file looks likes this ( it has not chan...

Read more...

tags: added: rls-mgr-p-tracking
Revision history for this message
Evgeny (evgpiun) wrote :

The same for me. I'm trying to connect from Windows (XP and 7) to a shared printer on Ubuntu Server 12.04. And both on WinXP and Win7 get the same error as others in this thread after drivers installation (in Russian: "Windows не удается подключиться к принтеру. Введено неправильное имя принтера или указанный принтер утерял подключение к серверу").
At the same time, I can add a network printer, using "http://<hostname>:631/printers/<printername>", but it is not convenient for the users.

Revision history for this message
Nick_Hill (nick-nickhill) wrote :

Me too, And the IPP implementation is unreliable for me. This means there is no print option at all over SMB.

Revision history for this message
braddock (braddock) wrote :

Same problem here. From Win XP to a printer on Ubuntu Server 12.04. Same procedure and error message.

Changed in samba (Ubuntu):
assignee: nobody → Aleck (7-admin-santeh-com-ua)
Revision history for this message
Aleck (7-admin-santeh-com-ua) wrote :

Same problem, also in Windows 2008 server and Windows 2003 Server..

Changed in samba (Ubuntu):
assignee: Aleck (7-admin-santeh-com-ua) → nobody
Revision history for this message
Peter L (randomuser72) wrote :

Same problem here. After upgrading server to 12.04 (from 11.10) I cant print using samba from Windows desktops or Ubuntu desktop. From desktop ubuntu it keeps asking me for password when I want to print, but it wont accept any.

Revision history for this message
tenshimsm (msmafra) wrote :

As the problem is the same even installing Ubuntu Precise from scratch, I'll just quote Peter Lehoczký (peto-lehoczky):

"Same problem here. After upgrading server to 12.04 (from 11.10) I cant print using samba from Windows desktops or Ubuntu desktop. From desktop ubuntu it keeps asking me for password when I want to print, but it wont accept any."

Revision history for this message
James Brown (ta2-0) wrote :

I am rather new to Ubuntu. Is it possible to uninstall this version of SAMBA and revert back to an earlier version (Which worked fine) until this bug is fixed? I did the same thing, upgrade from 11.10 to 12.04 and now I cannot use my Linux shared printers on my network. (PCs are using both Vista and XP OS). My configuration and applications are basicly what came with the original Ubuntu install download.

Revision history for this message
Oedipe (oedipe) wrote :

[Kubuntu 12.04 with smbd 3.6.3]

What ever i do and configure, i get a :
"Unable to connect to CUPS server localhost:631 - Connection refused"

That's a absolute "no go" ! Many people are in the same situation. Please do something urgently. Thanks.

Revision history for this message
Deactivated User (deactivated-user-deactivatedaccount) wrote :

I have the same problem here, no matter if I try to connect to a Windows 7 machine or another Ubuntu 12.04 64bits (on Ubuntu still asking for the password), samba just don't work.

Revision history for this message
Oedipe (oedipe) wrote :

That bug is nearly 2 months old, and still remains "Unassigned".... Pfff, viva Linux ! :-(

Revision history for this message
Lisa Nelson (lisa50469) wrote :

Same issue... Tried to install the additional Windows XP support on the WinXP box, but no different.
I can browse the workgroup from Ubuntu 12.04, but not from the Windows XP box.

Revision history for this message
Hennie (diegkol) wrote :

I have the same issue. Windows 7 has installed the HP LJ 2300L and is printing fine. XP "Windows cannot connect to printer..."

I don't want a work-around (and dont want one), I just need to print from 25 printers to this Linux box. Please somebody help!

Revision history for this message
Hennie (diegkol) wrote :

Sorry, I meant XP PCs. I'm so aggitated.

Revision history for this message
Max Bondarev (max-bondarev) wrote :

Looks like smbd starts before cups. Change "start on" parameter in /etc/init/smbd.conf to "start on (local-filesystems and net-device-up and started cups)" solved the problem for me.

Revision history for this message
robbielink (robbielink) wrote :

#17 did not work for me.

Revision history for this message
Nick_Hill (nick-nickhill) wrote :

This bug is somewhat a deal breaker for 12.04 for me. A search on Google will likely show up an array of deal break bugs for Samba 3.6.x. I've been hoping for a fix to come over the last few weeks, but on looking at the upstream release notes, there doesn't seem to be a fix in the pipeline for this, although the most recent update to samba has many, many bug and security fixes.

Perhaps Andrew Tridgell is busy fire fighting at the moment with the 3.6 series. I understand substantial sections have been re-written and obviously not yet mature code.

Perhaps distributions need to do their own code quality control, and perhaps make choices whether to include the latest versions if too buggy.

I'd suggest the previous 3.5 series of Samba should be included in 12.04 repositories, and available by default at least until samba 3.6 is more mature.

I wish I had the time, knowledge and resources to help Andrew Tridgell in his programming efforts on Samba.

Revision history for this message
Daniel S. van Heeckeren (d-vanheeckeren) wrote :

If someone needs a network for attempting to fix this, I offer mine if it will help. 1 Ubuntu 12.04 Server, 2 Ubuntu 12.04 clients, 2 windows 7 clients.

Revision history for this message
David (orlando-dad) wrote :

En Español

Posible solución:

Comando a usar: rpcclient

Se tiene que establecer el nombre de la impresora

Teclear en la terminal del servidor el siguiente comando sin las comillas:
“rpcclient localhost”

les pedirá la clave del usuario samba que administra las impresoras,

pueden verificar el nombre de la impresora con el comando, sin las comillas “enumprinters 5”

Ejemplo si el nombre de la impresora compartida es PDF2

luego de este paso cambian el nombre de la impresora con el comando, sin las comillas
“setprintername PDF2 PDF2”

ir a un maquina cliente, instalar la impresor.

---------------------------------------------------

In Ingles

Possible solution:

Command to use: rpcclient

You have to set the printer name

Type in the terminal server the following command without quotes:
"rpcclient localhost"

Asked the samba user's password that manages printers,

Can verify the name of the printer with the command, without the quotes "enumprinters 5"

Example if the name of the shared printer is PDF2

After this step change the name of the printer with the command, without quotes
"setprintername PDF2 PDF2"

Go to a client machine, install the printer.

Revision history for this message
Florin Andrei (florin-andrei) wrote :

Is there a solution to this problem yet, or should I go through the painful process of re-installing the server again? (this time installing CentOS, since Ubuntu as a server is a joke)

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Has the fix in comment #17 worked for anyone else?

tags: added: rls-q-incoming
Changed in samba (Ubuntu Precise):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
David (orlando-dad) wrote :

fix in comment # 21 worked for me

Revision history for this message
James Brown (ta2-0) wrote :

#21 worked for me too, but really needs a better explanation.

rpcclient needs to be run as superuser - it did not work for me until I changed user to root (su root)

i did not try it, but I think "sudo rpcclient" should work as well if you have enabled root directly.

typing "enumprinters 5" resulted in one listing for each of the printers in my system, but the result for each priner was

printername:[\\LOCALHOST\]
        portname:[]
        attributes:[0x0]
        device_not_selected_timeout:[0x0]
        transmission_retry_timeout:[0x0]

"enumprinters" (without the "5") yielded this with the correct name for each printer:

      flags:[0x800000]
        name:[\\LOCALHOST\HP-LaserJet-1100]
        description:[\\LOCALHOST\HP-LaserJet-1100,,HP LaserJet 1100]
        comment:[HP LaserJet 1100]

typing "setprintername HP-LaserJet-1100 HP-LaserJet-1100" resulte din a success message.

typing "enumprinters 5" now lists the printer with the correct name. and I can connect normally from the Windows clients.

I do not know what the "5" means, but apparantly the upgrade did something to zero out the existing settings.

Revision history for this message
David (orlando-dad) wrote :

Bad Spanish

Disculpen por la mala explicacion en el comment #21.

Bueno, en mi configuración de samba el grupo lpadmin es administrador de impresoras, mi usuario pertenece al grupo lpadmin, por eso funciono para mi sin ser usuario root (opcional agregar "printer admin = @lpadmin" en smb.conf sin las comillas), el usuario root es siempre por defecto administrador de impresoras.

Para una mejor explicacion del comando rpcclient y su uso podemos acudir siempre al man del comando.

Tomado del manual :

"enumprinters [level]
           Execute an EnumPrinters() call. This lists the various installed and share printers. Refer to the MS Platform SDK documentation for more details of the various flags and calling options. Currently supported info levels are 1, 2 and 5."

 "setprintername <printername> <newprintername>
           Set printer name"

----------------------------------------------------------------------------------------------------------------------------------------
Bad English

Sorry for the bad explanation in comment #21

Well, in my samba configuration the group lpadmin is printer manager, my lpadmin user belongs to, so it worked for me without being root user (optional add "printer admin = @lpadmin" in smb.conf without the quotes), the root user is always default printer manager.

For a better explanation of the rpcclient command and its use can always consult the man command.

Taken from the manual:

"enumprinters [level]
           Execute an EnumPrinters() call. This lists the various installed and share printers. Refer to the MS Platform SDK documentation for more details of the various flags and calling options. Currently supported info levels are 1, 2 and 5."

 "setprintername <printername> <newprintername>
           Set printer name"

Revision history for this message
hamishcarpenter (hamish-hamishcarpenter) wrote :

Please also see Bug 990388 which has similar symptons (cannot print from windows to linux after upgrade from 11.10 to 12.04).

The resolution there is about allowing windows client drivers, see comment #5.

Apologies if this isn't the right way to relate bugs, I'm new to launchpad.

Revision history for this message
jmsfnch (jamesfinch) wrote :

Whilst attempting the fix outlined in #21 / #25 / #26 I found this:

root@exabytes:/home/james# rpcclient localhost
Unknown parameter encountered: "lpq"
Ignoring unknown parameter "lpq"
Enter root's password:
rpcclient $> enumprinters
        flags:[0x800000]
        name:[\\LOCALHOST\]
        description:[\\LOCALHOST\,,HP_C4480]
        comment:[HP_C4480]

Am I correct in thinking the printer has somehow lost its name? "name:[\\LOCALHOST\]"

Attempting to change the name regardless results in the error:

rpcclient $> setprintername HP_C4480 HP_C4480
result was WERR_ACCESS_DENIED

The results are the same for both users 'root' and 'james' (a member of lpadmin).

smb.conf contains...
   printer admin = @lpadmin, james

Is anyone able to shed some light on what's happening here? Many thanks.

Revision history for this message
David (orlando-dad) wrote :

I have libpam-smbpass package which will sync the system users to the Samba user database:

         "sudo apt-get install libpam-smbpass"

Revision history for this message
David (orlando-dad) wrote :

restart Samba for the new settings to take effect:

"sudo restart smbd"
"sudo restart nmbd"

Revision history for this message
jmsfnch (jamesfinch) wrote :

Thanks David,

I can confirm libpam-smbpass is already installed and services were restarted after making the change. The results are the same. Full system also rebooted for good measure.

There seems to be something iffy with the permissions: The rpcclient output for "enumprivs" is identical for both a member and non-member of the lpadmin group.

I'm sure your fix will solve my problem, just as soon as I get my permissions in check. Looks like I have a bit of reading to do!

Revision history for this message
David (orlando-dad) wrote :

check group belongs to James with the following command: "groups james"
if james does not belong to group lpadmin add it with the command: "sudo adduser james lpadmin."

leave the session james, log back into the session, for the changes to take effect.

Revision history for this message
David (orlando-dad) wrote :

jmsfnch (jamesfinch), if you still have problems with "WERR_ACCESS_DENIED" added in the section [printers] in "/etc/samba/smb.conf" as follows: valid users = james

Revision history for this message
jmsfnch (jamesfinch) wrote :

Hi David,

Thanks for taking the time to provide further suggestions - I'm sorry I didn't respond sooner (I'm still struggling to find time to read around this subject at the moment).

I can confirm "james" is a member of lpadmin and am still getting the "WERR_ACCESS_DENIED" message, despite following your suggestions.

If you are interested, I have placed some rpcclient output and the active content of smb.comf in the pastebin: http://paste.ubuntu.com/1130972/

KR,
James

Revision history for this message
David (orlando-dad) wrote :

Hi James,
I check your configuration file,
you have two [global] section delete the second, only the [global]

You must replace the section [printers] with the following:

[printers]
    comment = All Printers
    browseable = yes
    path = /var/spool/samba
    printable = yes
    guest ok = yes
    create mask = 0700
    printer admin = @lpadmin
    valid users = james

enumprivs: only lists the existing privileges, does not list the current user's privileges, so I think.

try it and comment.

Revision history for this message
jmsfnch (jamesfinch) wrote :

Hi David,

It's looking good :-)

I made the recommended changes and at first the result was the same. I had also to comment out "read only = yes" from the "[print$]" section - doing so allowed me to successfully set the printer name.

My XP test box can now connect to the renamed printer.

Thanks very much for your help. James.

Revision history for this message
Vindicar (aorlov) wrote :

I've found out that it's possible to add printer via url:
http://printserver.addr:631/printers/Printer_Name
Adding as \\printserver\Printer_Name doesn't work yet.

Revision history for this message
cfchagas (cfchagas) wrote :

I can access all of my network from Ubuntu 12.04 using Samba, but can't even see the Ubuntu machine on the Network listing on my Windows Vista machine.

Revision history for this message
James Page (james-page) wrote :

Reviewing all of the comments on this bug report to-date its looks like there are probably two issues:

1) A potential race condition between cups and samba which means that samba is unable to lookup the list of printers on startup.

This is indicated by the following log messages in /var/log/samba/log.smbd:

[2012/04/02 13:17:15.089590, 0] printing/print_cups.c:110(cups_connect)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2012/04/02 13:17:15.090587, 0] printing/print_cups.c:487(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL

I think we can put in a conditional wait in the upstart configuration file for smbd to ensure that the cups daemon is in a running state before samba starts.

2) A change in behaviour which subsequently causes printing to fail with authentication issues (thats a premise - remains unproven IMHO).

I've tried to reproduce this issue using a Windows XP Client -> Ubuntu 12.10 Server; however I was able to print successfully so we need to dig into this a bit further.

It would be really helpful if the original bug report or anyone still seeing issues could increase the log verbosity by adding:

   log level = 3

to /etc/samba/smb.conf; any additional log information post restart for samba for both the server processes and the client connections would be really helpful.

This second issue might be related to bug 990388 - but its hard to tell at this point in time.

Revision history for this message
James Page (james-page) wrote :

It would be also useful to see the output from:

  net rpc rights list -S <server> -U<username>

for anyone seeing this issue as well.

Thanks

Revision history for this message
James Page (james-page) wrote :
Revision history for this message
James Page (james-page) wrote :

Sorry that should be:

 net rpc rights list -S <server> username

James Page (james-page)
tags: removed: rls-mgr-p-tracking rls-q-incoming
Revision history for this message
Colin Leavett-Brown (crlb) wrote :

I too was running a windows client accessing both file and print shares from samba running under 10.04. Upgraded to 12.04. The client can see and use the file shares but now the print shares. I have set log level = 3. Here's the output from ntp:

crlb@chimpanzee:~$ net rpc rights list -S 192.168.1.11 crlb
Enter crlb's password:
crlb@chimpanzee:~$

I'll attach the logs shortly.

Revision history for this message
Colin Leavett-Brown (crlb) wrote :

That should have read "but not the print shares".

Revision history for this message
Colin Leavett-Brown (crlb) wrote :
Revision history for this message
Colin Leavett-Brown (crlb) wrote :
Revision history for this message
Bortnyák Roland (antivirtel) wrote :

Unfortunately, I can confirm it with 12.04.1 --- can you fix that?!

Revision history for this message
James Page (james-page) wrote :

I've split the cups/samba race bug out into bug 1047262

Revision history for this message
James Page (james-page) wrote :

Hi Colin

Thanks for the extra information; I have a hunch that this might be upstream https://bugzilla.samba.org/show_bug.cgi?id=8769.

Please could you repeat with a log level of 10 - if the log looks exactly the same as in the upstream bug I think we can confirm the issue sufficiently.

However no fix yet upstream if so.

Thanks

Revision history for this message
James Page (james-page) wrote :

Non-admin user:

ubuntu@hendrix:~$ smbclient //127.0.0.1/ip4000r -U ubuntu
Enter ubuntu's password:
Domain=[SHOUSE] OS=[Unix] Server=[Samba 3.6.6]
tree connect failed: NT_STATUS_ACCESS_DENIED

Admin user:

jamespage@hendrix:~/src/ubuntu/quantal$ smbclient //127.0.0.1/ip4000r
Enter jamespage's password:
Domain=[SHOUSE] OS=[Unix] Server=[Samba 3.6.6]
smb: \> print samba_3.6.6-3ubuntu2_source.changes
putting file samba_3.6.6-3ubuntu2_source.changes as samba_3.6.6-3ubuntu2_source.changes (132.8 kb/s) (average 132.8 kb/s)
smb: \> q

Revision history for this message
James Page (james-page) wrote :

Scrub that last comment - forgot to add ubuntu user to samba password file.

Revision history for this message
Colin Leavett-Brown (crlb) wrote :

Set log level = 10, erased the logs, rebooted samba server and client, tried to access both file and print shares. File share access successful. Print share access unsuccessful. Attaching logs.

Revision history for this message
Colin Leavett-Brown (crlb) wrote :
Revision history for this message
Colin Leavett-Brown (crlb) wrote :
Revision history for this message
Colin Leavett-Brown (crlb) wrote :

Well, I needed this to work now. Ubuntu software centre removed samba, installed the deb 3.5.6 package, everthing works great.

Revision history for this message
James Page (james-page) wrote :

Hi Colin

Thanks for providing this additional log data - assuming that the printer you are trying to access is called "merlin" I think these are the pertinent log messages:

  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2012/09/07 07:08:19.643668, 5] ../libcli/security/security_token.c:53(security_token_debug)
  Security token: (NULL)
[2012/09/07 07:08:19.643686, 5] auth/token_util.c:527(debug_unix_user_token)
  UNIX token of user 0
  Primary group is 0 and contains 0 supplementary groups
[2012/09/07 07:08:19.643715, 5] smbd/uid.c:400(change_to_root_user)
  change_to_root_user: now uid=(0,0) gid=(0,0)
[2012/09/07 07:08:19.643739, 4] smbd/reply.c:794(reply_tcon_and_X)
  Client requested device type [LPT1:] for share [MERLIN]
[2012/09/07 07:08:19.643766, 7] param/loadparm.c:9830(lp_servicenumber)
  lp_servicenumber: couldn't find merlin
[2012/09/07 07:08:19.643785, 5] lib/username.c:171(Get_Pwnam_alloc)
  Finding user merlin
[2012/09/07 07:08:19.643803, 5] lib/username.c:116(Get_Pwnam_internals)
  Trying _Get_Pwnam(), username as lowercase is merlin
[2012/09/07 07:08:19.643850, 5] lib/username.c:134(Get_Pwnam_internals)
  Trying _Get_Pwnam(), username as uppercase is MERLIN
[2012/09/07 07:08:19.643900, 5] lib/username.c:143(Get_Pwnam_internals)
  Checking combinations of 0 uppercase letters in merlin
[2012/09/07 07:08:19.643921, 5] lib/username.c:149(Get_Pwnam_internals)
  Get_Pwnam_internals didn't find user [merlin]!
[2012/09/07 07:08:19.643945, 4] auth/user_util.c:361(map_username)
  Scanning username map /etc/samba/smbusers
[2012/09/07 07:08:19.643968, 3] smbd/service.c:343(find_service)
  checking for home directory merlin gave (NULL)
[2012/09/07 07:08:19.643991, 3] smbd/service.c:357(find_service)
  checking whether merlin is a valid printer name...
[2012/09/07 07:08:19.644022, 1] printing/printer_list.c:94(printer_list_get_printer)
  Failed to fetch record!
[2012/09/07 07:08:19.644042, 3] smbd/service.c:371(find_service)
  merlin is not a valid printer name
[2012/09/07 07:08:19.666295, 0] param/loadparm.c:9114(process_usershare_file)
  process_usershare_file: stat of /var/lib/samba/usershares/merlin failed. No such file or directory
[2012/09/07 07:08:19.666354, 3] smbd/service.c:444(find_service)
  find_service() failed to find service merlin
[2012/09/07 07:08:19.666392, 3] smbd/service.c:1307(make_connection)
  win95 (ipv4:192.168.1.12:1025) couldn't find service merlin
[2012/09/07 07:08:19.666440, 3] smbd/error.c:100(error_packet_set)
  error packet at smbd/reply.c(803) cmd=117 (SMBtconX) eclass=1 ecode=67
[2012/09/07 07:08:19.666467, 5] lib/util.c:332(show_msg)

Revision history for this message
James Page (james-page) wrote :

Colin

Are you using the standard install samba configuration?

Revision history for this message
Colin Leavett-Brown (crlb) wrote :

Hello James, Pretty much, just a few minor changes that I've been using for the last 10 years. Merlin is the printer and I'm using the standard printer configuration:

[printers]
        comment = All Printers
        browseable = yes
        path = /var/spool/samba
        printable = yes
        guest ok = yes
; read only = yes
        create mask = 0700

As for the changes, carried over from my Fedora days, I think these are the only ones:

workgroup = MyGroup
   wins support = yes
domain master = yes
local master = yes
preferred master = yes
os level = 65

Revision history for this message
Colin Leavett-Brown (crlb) wrote :

I have also found that installing samba 4rc1 from the Ubuntu software centre has no problem with print and file sharing even though it does give errors during the installation.

Changed in samba (Ubuntu Precise):
status: Confirmed → New
Revision history for this message
papukaija (papukaija) wrote :

Please don't change this bug's status without an explanation. Thanks.

Changed in samba (Ubuntu Precise):
status: New → Confirmed
tags: added: precise quantal
Revision history for this message
Colin Leavett-Brown (crlb) wrote :

Since the last samba updates to precise the two workarounds (installing 3.5.6 deb package or using samba 4RC1 from the software centre) that I mentioned above are no longer effective; 356 will not install, and 4RC1 will not start.

Revision history for this message
rasos (rasos) wrote :

This bug seems to be similar to # 990388. I found an easy workaround in askubuntu (you need to set up your printers again on a precise desktop), which I posted also here: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/990388/comments/15

Revision history for this message
Dikla Oren (diklao) wrote :

Has anyone come across a problem in the opposite direction (windows printing server, local Ubuntu 12.04 machine)? Thanks.

Revision history for this message
Rob (rob-drrob1) wrote :

I have a home mixed network containing Ubuntu 12.04, linux mint 13, windows xp, windows 7 computers.
p5q runs ubuntu 12.04 and has a brother mfc 7860dw printer
p5 runs win xp and has a HP photosmart 6510 printer

u64 runs ubuntu 12.04
LM13 and maya both run linux mint 13 (based on ubuntu 12.04)
dell9 is a dell 9 mini that now runs ubuntu 12.04

From the dell9, I ran
  net rpc rights list -S p5q rob

it asked for my password which I gave.
Then it came back saying Connection failed: NT_STATUS_ACCESS_DENIED

I am able to share the brother printer on p5q using a uri of ipp://192.168.1.6:631/printers/MFC7860DW

But the computers running ubuntu 12.04 or variant cannot see the others using samba.
And to answer the above poster, the ubuntu based machines cannot see the HP printer on the winxp host.

I'm interested in helping to troubleshoot, but don't know how.

Revision history for this message
James D. Robinson (ubu-jdr048) wrote :

Hi to whom it may concern,

At the top of this posting, it states that this bug affects 40 people but judging by the number of google references and comments on the Ubuntu Forums, it affects a great deal than 40. I am referring to the bug where one seems to be unable, to set up a printer attached to a 12.04 server. You see the following error message.

"Windows cannot connect to the printer. Either the printer name was typed incorrectly or the specified printer has lost its connection to the server".

I had this problem on a new server that I had created using Xubuntu 12.04 and which was attached to various windows PCs. Most of these, are running XP Pro. I do not have the problem on a Xubuntu 10.04 server which is attached to the same XP Pro PCs.

The Printer would work locally from the server using USB and another printer of the same type was setup directly on the LAN. This lead, in-fact, to one additional problem. See later.

I eventually managed eventually to get it to work by setting up from the Windows PC to my server using the semi manual approach, of using the syntax

http://192.168.123.98:631/printers/Brother-HL-2270DW-series where 192.168.123.98 is the server address.

Whereas the original printer which was on the Lan, had been set -up under windows as a port name of

BRN001BA97BC2BB

And this was automatically found on the Windows PC's Whereas on the 12.04 Xubuntu server it would not find it so it had to set-up manually as

ipp://192.168.123.52/ ie it's address on the LAN and that seems to be CUPS error.
This printer uses a name of Brother-HL-2270DW_series

NB the slight difference in the name between the DW and series one is an underscore and the other is a hyphen. This was the cause of a few unsuccessful attempts of getting it to work!!!

CUPS was setting up slightly different IDs as seen on the jobs page (CUPS) and show all jobs..

Best Wishes
Jim

Revision history for this message
alfalfa (xxalfalfaxx) wrote :

Hi all,

I'm having trubles adding shared printer from Xp clients.
I got the message "Windows cannot connect to the printer. Either the printer name was typed incorrectly or the specified printer has lost its connection to the sever".
I tried solution @ #21 but when typing enumprinters i get

enumprinters
        flags:[0x800000]
        name:[\\LOCALHOST\]
        description:[\\LOCALHOST\,,Hewlett-Packard_HP_LaserJet_P1005]
        comment:[Hewlett-Packard_HP_LaserJet_P1005]

as @ #28.

Why there is no printer name? How should i set it?

THX

Revision history for this message
Vindicar (aorlov) wrote :

alfalfa, as quick solution, try adding printer using URL (there should be an option for that in "Add pritner" dialog box. URL of printer page is the same it has in CUPS webinterface (most likely it looks like http://printserver.addr:631/printers/Printer_Name ).
It worked for me.

Revision history for this message
MarkosJal (markosjal) wrote :

We all know there are workarounds for this and what surprises me more s that after 8 months NO FIX! I just took my install of ubuntu 12.04 to the latest samba packages from Raring and the problem is still there . I was already running CUPS 1.61. What I did notice is something I did not see before when I ran

cupsaddsmb -H localhost -U root -h localhost -a -v

It returned an error about an invalid printer .

So then I run
rpcclient -U root localhost -c enumdrivers
and
rpcclient -U root localhost -c enumprinters

And only one driver and two printers (one is PDF) . The PDF printer nor driver are anywhere t be fund but the driver for the PDF printer was made available to windows! What gets even weirder is that I cn print to the PDF printer via Samba and a postscript driver! Considering that samba does not even see it as installed thats odd

Is this a samba bug or cups bug?

Revision history for this message
Wayne Hicks (wdhicks) wrote :

The information posted in #21 and #25 above is close but I could not get it to work.

A solution that worked for me is at http://forums.linuxmint.com/viewtopic.php?f=42&t=28397&p=618065#p618065

There were some additional instructions in setting /etc/samba/smb.conf that were needed.

Changed in samba:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Louis Bouchard (louis) wrote :

I do confirm that the steps outlined in the link in comment #69 did allowed me to setup the printer. Moreover, testing the daily development build indicates that the current version in Raring fixes this issue.

I will try to identify the fix so it may be brought to prior versions

Changed in samba (Ubuntu):
assignee: nobody → Louis Bouchard (louis-bouchard)
Louis Bouchard (louis)
Changed in samba (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Louis Bouchard (louis) wrote :

Well after numerous tests, I can no longer reproduce this bug ! I tested the following :

Precise 12.04.1 VM
Precise 12.04 VM
Quantal 12.10 VM
Quantal 12.10 Baremetal
Raring 13.04 VM

From a vanilla install :
• Confirm "Publish shared printers connected to this system" is enabled in PrintTool
• Enable Visibility of printer on network
• Install samba package
• Modify /etc/samba/smb.conf with the following :
[global]
   workgroup = MSHOME
   printing = cups
   printcap name = cups

***Nothing changed in the [printers] section***

$ sudo restart nmbd
$ sudo restart smbd
$ sudo rpcclient localhost -c enumprinters
Enter root's password:
        flags:[0x800000]
        name:[\\LOCALHOST\Photosmart-C5100-series]
        description:[\\LOCALHOST\Photosmart-C5100-series,,HP Photosmart C5100 series]
        comment:[HP Photosmart C5100 series]

Unlike previously, the "name:[...]" value is now complete with server & printer name. This is confirmed by setting up a printer on Windows XP as well.

It would be greatly appreciated if someone affected by this bug could test on an up-to-date system (12.04 preferably) to try to reproduce the bug. My feeling is that the source of the problem was not samba and got recently updated.

But after two complete days of thorough testing, I am not able to reproduce the bug anymore !

Regarding the upstream samba bug (#8769), it is not related to this issue and should be removed as a reference.

Revision history for this message
rickyrockrat (rickyrockrat) wrote :

I've spent something like 10 hours now (debugging from 1000 miles away), and the other party has gone to bed. I just now got my printers to rename.
This works for renaming the printer (where the heck is the name stored??) (var is on an different file system, so my path is different) symbolic links screw things up, by the way.
[global]
   workgroup = WORKGROUP
   printing = cups
   printcap name = cups

[printers]
   comment = All Printers
   browseable = yes
# path = /var/spool/samba
   path = /pub/root/var/spool
   printable = yes
   printer admin = @lpadmin
   guest ok = yes
   ; read only = yes
   create mask = 0700
   valid users = someuser

[print$]
 comment = Printer Drivers
path =/pub/root/var/lib/samba/printers
#path = /var/lib/samba/printers
  browseable = yes
  guest ok = no
# read only = no
  write list = root
I just did an apt-get update, and can confirm I am on the latest samba/cups with 12.04.1. I used the 64bit server install CD.

This bug still exists.
This is bull. I could be developing open source, instead, I'm trying to get samba to print.

Revision history for this message
pippo (claudio-enjoy) wrote :

I have swat , samba 3.6.3 , ubuntu 12.04 server 64 , CUPS 1.5.3
I have printer1 without portname [],

printer 1 and 2 are the same model and I use the same protocol and ppd .

 enumprinters 5
 printername:[\\LOCALHOST\printer1]
 portname:[]
 attributes:[0x1048]
 device_not_selected_timeout:[0x0]
 transmission_retry_timeout:[0x0]

 printername:[\\LOCALHOST\printer2]
 portname:[Samba Printer Port]
 attributes:[0x1048]
 device_not_selected_timeout:[0x0]
 transmission_retry_timeout:[0x0]

 printername:[\\LOCALHOST\printe3]
 portname:[Samba Printer Port]
 attributes:[0x1048]
 device_not_selected_timeout:[0x0]
 transmission_retry_timeout:[0x0]

if I run command :
 enumprinters 2 I can see that :

 servername:[\\LOCALHOST]
 printername:[\\LOCALHOST\print1]
 sharename:[print1]
 portname:[]
 drivername:[print1]
 comment:[print1]
 location:[floor]
 sepfile:[]
 printprocessor:[]
 datatype:[]
 parameters:[]
 attributes:[0x1048]
 priority:[0x0]
 defaultpriority:[0x0]
 starttime:[0x0]
 untiltime:[0x0]
 status:[0x0]
 cjobs:[0x0]
 averageppm:[0x0]

So empty : portname:[] default is : portname:[Samba Printer Port]
 printprocessor:[] default is : printprocessor:[winprint]
  datatype:[]default is : datatype:[RAW]

from windows printer 2-3 works fine , when I try to install on windows 7 in background download the driver but give a error :
"windows cannot connect to the printer print processor does not exist"

Revision history for this message
pippo (claudio-enjoy) wrote :

My solution to reset the rpcclient :

1) Stop Samba

2) Delete files:
/var/lib/samba/registry.tdb
/var/cache/samba/printing/*

4) Restart Samba

yeah !

Louis Bouchard (louis)
Changed in samba (Ubuntu Precise):
assignee: nobody → Louis Bouchard (louis-bouchard)
Revision history for this message
Louis Bouchard (louis) wrote :
Download full text (3.5 KiB)

Okay, after numerous retries (as in at least 20 virtual machines), I think I have identified a systematic way to reproduce the problem.

Test environment
==========
1 virtual machine running Ubuntu 12.04 Precise with USB connected printer [1]
1 virtual machine running Windows XP

1) add the samba package
 $ sudo apt-get install sambe

2) Modify the /etc/samba/smb.conf
 workgroup = MSHOME
uncomment the two following lines :

   printing = cups
   printcap name = cups

3) Go in the "Printers" administration tool and enable sharing
 Server->Settings and enable the checkbox on :
 "Publish shared printers connected to this system"

4) In a terminal, type :
 $ sudo lpstat -a
Deskjet-2510-series accepting requests since Mon Feb 11 11:27:46 2013
 $ sudo rpcclient localhost -Nc enumprinters
No Printers returned.

This confirm that the printer exists but has not been picked up by Samba.

*** IMPORTANT ***

The sequence of event is required otherwise the bug will not occur (which is why I was no longer able to reproduce the problem). The upstream samba bug #8554 had the explanation (https://bugzilla.samba.org/show_bug.cgi?id=8554) :

"... where a newly created CUPS printer would be loaded into smbd with a
broken "printername" of '//LOCALHOST/', i.e. missing the actual share name
(empty in the outgoing spoolss_GetPrinter structure after the initial
OpenPrinterEx rpc command). Maybe this is also the case in 3.6.0. Without
Björns patch this happened whenever the first connect to the new printer share
would be initiated by a non-privileged user logged on to a Windows client (XP
or 7).

The "whenever the first connect to the new printer share would be initiated by a non-privileged user logged on to a Windows client" is important as, if smbd is restarted BEFORE this connection happens, the printer name will come up correctly !

5) Try to add the printer from Windows XP using the dialog until the "Search printer" shows the Precise VM in MSHOME workgroup by double-clicking on the Precise hostname. Nothing should happen.

6) in the terminal type :
 $ sudo restart smbd

7) Double-click on the Precise hostname. The printer should appear. Double-click on the printer. This double-click should trigger the bug and you should see only \\{precise hostname}\ in the Printer field. To confirm that do the following in the terminal :

 $ rpcclient localhost -Nc enumprinters
        flags:[0x800000]
        name:[\\LOCALHOST\]
        description:[\\LOCALHOST\,,HP Deskjet 2510 series]
        comment:[HP Deskjet 2510 series]

The "name" field show that the printer name is missing and only the hostname appear.

Using the following steps, I am able to reproduce the bug systematically.

So from that, I did apply the patch from Samba bug#8554 to the precise-update version of the samba package and it does indeed fixes the issue, using the above method of reproducing the bug.

The one issue to be aware of is that the old entry for the failing printer will remain in Samba's registry.tbd database. In order to reset its value, the printer should be removed from CUPS and recreated, otherwise the previous entry will remain and the printer detection will continue to fail due to the ...

Read more...

Louis Bouchard (louis)
description: updated
Revision history for this message
Louis Bouchard (louis) wrote :

tested on Quantal and confirmed that the proposed fix for Precise is in the source for Quantal. Marking it invalid

Changed in samba (Ubuntu Quantal):
assignee: nobody → Louis Bouchard (louis-bouchard)
status: Confirmed → Invalid
Changed in samba (Ubuntu Precise):
status: Confirmed → In Progress
Changed in samba:
importance: Medium → Unknown
status: Fix Released → Unknown
Changed in samba:
importance: Unknown → Medium
status: Unknown → Fix Released
Changed in samba (Ubuntu Quantal):
status: Invalid → Fix Released
Changed in samba (Ubuntu):
status: In Progress → Fix Released
Changed in samba (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the work, I've merged that fix with the one which was currently waiting in the SRU queue and uploaded a new update with both included

Revision history for this message
rickyrockrat (rickyrockrat) wrote :

Any news on the release of this fix for precise? I'm preparing to set up servers for windows networks, and I need to know what workaround I have to use. 3.6.6 as originally released is not going to go on these servers.

I've made Ubuntu my distro of choice, but this was reported almost a YEAR ago, and Precise is supposed to be a LTS. It really makes one think about CentOS.

If this was a minor bug, it's one thing, but this isn't a minor bug, IMO.

Revision history for this message
Louis Bouchard (louis) wrote :

@rickyrockrat

The updated fix is in the upload queue :

https://launchpad.net/ubuntu/precise/+queue?queue_state=1&queue_text=

While I would advise against it, you can pickup the packaging files and build yourself a PPA (clicking on the arrow symbol beside the package name will expose the packaging files) until it gets uploaded. But it now only a matter of time until it becomes available in -proposed for testing.

Revision history for this message
Louis Bouchard (louis) wrote :

One thing to be aware of that I noticed while testing.

Even with the patch applied, existing printers will not get updated entries in the samba registry. I have found no other way than deleting the registry file completely to get new entries created. I had to do the following :

 $ sudo rm -f /var/lib/samba/registry.tdb
 $ sudo rm -f /var/cache/samba/printing/*
 $ sudo restart smbd
 $ sudo restart nmbd

Maybe there is a smarter way of cleaning it up but I haven't found it

Revision history for this message
Eric Wadsworth (eric-wadhome) wrote :

Thanks for fixing this! I'm looking forward to getting my printer working. I assume that once the fix is released, I'll get it with the standard "apt-get update" and "apt-get upgrade" operation?

Revision history for this message
Louis Bouchard (louis) wrote :

@eric:

Yes, this will happen 7 days after the package gets uploaded into -proposed and tests confirm that no regression are found. It is currently still waiting for upload.

You will receive an update once it gets uploaded and made available for testing.

Revision history for this message
Dave Walker (davewalker) wrote : Please test proposed package

Hello Tony, or anyone else affected,

Accepted samba into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/samba/2:3.6.3-2ubuntu2.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Louis Bouchard (louis) wrote :

Since the bug is difficult to reproduce in a systematic manner, I have tested the version in -proposed twice with successful results. I will mark it as verification-done even if I would like someone else who has the bug to confirm.

Please be aware that if the samba registry is not destroyed and recreated once the new version has been applied, the old erroneous naming of the printer will remain and will still fail on WinXP.

tags: added: verification-done-precise verification-needed-quantal
removed: verification-needed
Louis Bouchard (louis)
tags: added: verification-done
removed: verification-done-precise verification-needed-quantal
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:3.6.3-2ubuntu2.4

---------------
samba (2:3.6.3-2ubuntu2.4) precise; urgency=low

  [ Olly Betts ]
  * Change "net share allowedusers" to use RPC call that works with
    Microsoft Windows 2008 r2. (LP: #1061244)

  [ Louis Bouchard ]
  * Fix issue with Windows XP / 7 (LP: #967410) where a USB
    connected printer shared on Ubuntu cannot be added to Windows
    using the "Find a printer in the directory" functionalty.

  [ Adam Conrad ]
  * Cherrypick patch from upstream to resolve a SIGABRT when passing
    setgroups a -1 gid, fixing samba with 3.5 kernels (LP: #1016895)
 -- Adam Conrad <email address hidden> Tue, 19 Feb 2013 22:22:12 -0700

Changed in samba (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Colin Leavett-Brown (crlb) wrote :

What happened to the fix?

On 2013-03-09 23:20:24 /var/log/apt/history.log shows samba:i386 (3.6.3-2ubuntu2.3) being installed, and I could once again access printer shares from windows. However, this morning, I could not! The history.log shows "2013-03-23 23:27:26 samba:i386 (3.6.3-2ubuntu2.3, 3.6.3-2ubuntu2.4)".

I wanted to downgrade to samba:i386 (3.6.3-2ubuntu2.3) but could not. apt-cache showpkg samba shows:

Provides:
2:3.6.3-2ubuntu2.4 -
2:3.6.3-2ubuntu2.1 -
2:3.6.3-2ubuntu2 -

Do we open a new bug report or continue with this one?

Revision history for this message
Sebastien Bacher (seb128) wrote :

> history.log shows samba:i386 (3.6.3-2ubuntu2.3) being installed, and I could once again access printer shares from windows. However, this morning, I could not! The history.log shows "2013-03-23 23:27:26 samba:i386 (3.6.3-2ubuntu2.3, 3.6.3-2ubuntu2.4)".

that's strange,

https://launchpad.net/ubuntu/+source/samba/2:3.6.3-2ubuntu2.3

only has an upstart script fix,

https://launchpad.net/ubuntu/+source/samba/2:3.6.3-2ubuntu2.4

is the one including the fix

are you sure it was working before and that you were having the issue as described here?

Revision history for this message
Ken R. Gailey (kgailey) wrote :

Post #21 fixed issue for me, had to login as root, but it worked

Revision history for this message
Colin Leavett-Brown (crlb) wrote :

Re #88: Yes, it was working with 3.6.3-2ubuntu2.3 and stopped working with 3.6.3-2ubuntu2.4. However, the problem has changed. Before the fix on any version, the shared printer was not visible to the workgroup, but now they are. And now, when printing from a windows client, I'm getting the following specific error "NT_STATUS_ACCESS_DENIED opening remote spool Test Page". I see others complaining of this new (to me) symptom and so I will follow those bug reports and assume this bug report has been fixed for me even though I still can't print from a windows client.

Revision history for this message
Roman Mandeleil (roman-mandeleil) wrote :

Hi ,

I guess I have a problem connected to this thread:
I installed latest image ubuntu-13.04-desktop-i386.iso,
on the laptop, I have HP printer connected to it and
work well, but when I share it I can see it and connect to
it from windows machine but not send a test page print.

Any Ideas ?

Thank in advance
Roman

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.