Cannot retreive share list if samba client and server have the same hostname

Bug #338411 reported by komputes
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Confirmed
Low
Unassigned
Declined for Karmic by Mathias Gug

Bug Description

Binary package hint: samba

samba 2:3.3.1-1ubuntu1
ubuntu 9.04 (alpha5-20090304)

Samba client and server both have the same hostname. This makes it impossible for the client to resolve to the server. The end result is that the client is shown the following error:

==
Unable to mount location
Failed to retrieve share list from server
==

Changing the client's hostname is a workaround to this issue. (Modify /etc/hostname /etc/hosts)
Connecting to the server by IP address *WITH* share name is another workarround.

Revision history for this message
Steve Langasek (vorlon) wrote :

It's self-evidently impossible to have two machines on the network using the same name and be able to distinguish between them when trying to connect using that name. The problem is that when there's a NetBIOS name collision affecting workgroup browsing, the user isn't given any feedback that this is the case. So what you wind up with 50% of the time (or more) is that the local system has a different idea of the name mapping than every other machine on the network.

With MDNS, avahi automatically resolves name collisions by calculating a new name for itself (e.g., foo.local -> foo-1.local). I don't think this is appropriate for NetBIOS, but we do need some feedback channel from nmbd that lets the user know there's a namespace collision.

Changed in samba:
status: New → Confirmed
Revision history for this message
Bjorn Nilsson (ewook) wrote :

This is just like Steve says not a bug, it's a faulty setup.

Revision history for this message
Steve Langasek (vorlon) wrote :

I didn't say that it wasn't a bug, I said that the solution is not going to involve making it possible for two machines to use the same name on the network. It is still definitely a bug that Ubuntu silently fails when there's an NBNS name collision.

komputes (komputes)
description: updated
Revision history for this message
komputes (komputes) wrote :

Sorry if the bug description was not clear. The reason for staring this bug is not an attempt to fix this flaw in the smb protocol, but to have Ubuntu fail gracefully, while providing an error which helps the user diagnose, understand and correct the issue.

The error should attempt to explain the issue:
==
Failed to retrieve share list from server. It is possible the server you are attempting to browse has the same hostname as you (or another node). To avoid this collision, please change hostnames on your network to be unique. Optionally, you can connect to the remote share by IP address in "Places > Connect to server" to circumvent the issue.
==

Revision history for this message
Matthew McGowan (mmcg069) wrote :

I just had this error on Juanty... i am not sure why because there are four computers on the network and mine is the only one called matthew-desktop, anyways i followed the workaround in this thread and things are ok now.

I think if the error prompt for this type of issue should be the following:

==
<b>Ubuntu is unable to connect to %some-computer.</b>
It is possible the hostname %my-hostname is already in use on the network. A hostname is a unique name that identifies your system on a Local Area Network (LAN). To connect to %some-computer please enter a new and unique hostname:

New Hostname (example: matthew-desktop2):
 _______________________
[_______________________]

[Cancel] [Continue] <- Continue should become sensitive only when a new and unique hostname is entered
==

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 338411] Re: Cannot retreive share list if samba client and server have the same hostname

On Sun, Mar 29, 2009 at 02:53:10AM -0000, mmnz wrote:
> I just had this error on Juanty... i am not sure why because there are
> four computers on the network and mine is the only one called matthew-

Then you didn't have this error, you had an unrelated problem that results
in the same generic error message.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

sabarigr (sabarigr)
Changed in samba (Ubuntu):
status: Confirmed → Incomplete
Steve Langasek (vorlon)
Changed in samba (Ubuntu):
status: Incomplete → Confirmed
NoWay (engen)
description: updated
Revision history for this message
NoWay (engen) wrote :

I am running UbuntuServer 9.10 and Ubuntu Client 9.10. I am 100% sure that I do not have the same hostname on the network. The funny thing is that my network has been running without any kind of problems for more than a month, but yesterday I got the following message when the client tried to access the file server: Could not open location 'smb://[servername]' followed by "Failed to retrieve share list from the server"

Revision history for this message
Thierry Carrez (ttx) wrote :

@NoWay: if you are 100% sure that you don't have the same hostname on the network, then it's not the same bug. Please open a separate one. Checking that "ping [servername]" or accessing "smb://ip.of.server" succeeds would be a plus.

Changed in samba (Ubuntu):
importance: Undecided → Low
Revision history for this message
Bjorn Nilsson (ewook) wrote :

@Steve and @David, sorry for missinterperting, and thank you for clarifying.

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

Other bug subscribers

Remote bug watches

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