problem accessing shared folders

Bug #363576 reported by James Pakko
2
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I'm having a problem accessing shared folders on other local machines. I'm using Ubuntu 8.04.2. All updates have been applied.

1. Nautilus sees other computers on the network, but when I click on one of them, after a long pause, it just shows a blank window with no shared folders.

2. From the terminal "smbclient //nasdrive/sharedfolder -U username" returns:
timeout connecting to 206.112.100.151:445
timeout connecting to 206.112.100.151:139
Error connecting to 206.112.100.151 (Operation already in progress)
Connection to nasdrive failed (Error NT_STATUS_ACCESS_DENIED)

I have no idea where 206.112.100.151 comes from. It's always this same address, and I have no machines with that IP address.

3. From the terminal, "sudo smbtree" responds correctly. Also, it fixes the other problems, temporarily. Nautilus can now access shared drives. The same smbclient command above now accesses the appropriate folder, with no errors. It's necessary to run smbtree with sudo. Without using sudo, smbtree responds correctly, but it doesn't fix the other problems.

4. After reboot, all the problems return.

5. Both my installed system and the live CD behave the same.

Revision history for this message
Andreas Moog (ampelbein) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Unfortunately we can't fix it without more information.

Please include the information requested at https://wiki.ubuntu.com/DebuggingSamba#samba-client.

affects: ubuntu → samba (Ubuntu)
Changed in samba (Ubuntu):
status: New → Incomplete
Revision history for this message
James Pakko (james-pakko) wrote :

The output of:
dpkg-query -W -f='${Package} ${Version} ${Source} ${Status}\n' | grep samba
is:

libsmbclient 3.0.28a-1ubuntu4.7 samba install ok installed
samba-common 3.0.28a-1ubuntu4.7 samba install ok installed
smbclient 3.0.28a-1ubuntu4.7 samba install ok installed
winbind 3.0.28a-1ubuntu4.7 samba install ok installed

The remote server is a SimpleTech SimpleShare NAS, firmware vers. 1.09. I believe it runs some form of linux. It reports:
 Domain=[GROUP] OS=[Unix] Server=[Samba 3.0.2]

Revision history for this message
James Pakko (james-pakko) wrote :

Also, I thought this worked before in 8.04, but this isn't something I use a lot. I'm not sure when it broke.
Fairly recently, I got a new router and switch. Nothing fancy, just the standard Linksys stuff. Could that cause a problem like this? I'm not having a problem with the windows machines in the house.

Revision history for this message
Andreas Moog (ampelbein) wrote :

Ok, thanks. This looks like bug 350291, marking as duplicate. Please see the other report if there is any information missing.

Changed in samba (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
James Pakko (james-pakko) wrote :

Yes that looks similar. One difference is, I don't have a problem with smbtree, that works fine. My problem only affects Nautilus and smbclient.

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

Deduplicating until we are sure it's the same bug.
It looks like a name resolution issue: querying "nasdrive" on the windows network returns 206.112.100.151 for some reason, then you get a timeout accessing that unknown IP. Running smbtree sends a local broadcast to which the nasdrive responds and then the computer caches that information, until next reboot or cache timeout.

Could you attach the information requested at:
https://wiki.ubuntu.com/DebuggingSamba#samba-client

Additionally:
- Please attach your /etc/samba/smb.conf file
- What does "ping nasdrive" return ?
- What does "grep hosts /etc/nsswitch.conf" return ?
- Does "smbclient //nasdrive/sharedfolder -R bcast -U username" work ?
- Please send the output of "smbclient -d4 //nasdrive/sharedfolder -U username"

Changed in samba (Ubuntu):
status: Invalid → Incomplete
Revision history for this message
James Pakko (james-pakko) wrote :

>>Could you attach the information requested at:
>>https://wiki.ubuntu.com/DebuggingSamba#samba-client
I've already done that, to the best of my ability. Please be specific if there's something missing.

$ ping nasdrive
PING nasdrive (206.112.100.151) 56(84) bytes of data.

$ grep hosts /etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

Does "smbclient //nasdrive/sharedfolder -R bcast -U username" work ?
Yes, this works.

$ smbclient -d4 //nasdrive/sharedfolder -U username
lp_load: refreshing parameters
Initialising global parameters
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
doing parameter workgroup = GROUP
doing parameter server string = %h server (Samba, Ubuntu)
doing parameter dns proxy = no
doing parameter log file = /var/log/samba/log.%m
doing parameter max log size = 1000
doing parameter syslog = 0
doing parameter panic action = /usr/share/samba/panic-action %d
doing parameter encrypt passwords = true
doing parameter passdb backend = tdbsam
doing parameter obey pam restrictions = yes
doing parameter invalid users = root
doing parameter unix password sync = yes
doing parameter passwd program = /usr/bin/passwd %u
doing parameter passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
doing parameter pam password change = yes
doing parameter map to guest = bad user
doing parameter socket options = TCP_NODELAY
doing parameter usershare allow guests = yes
pm_process() returned Yes
added interface ip=192.168.1.3 bcast=192.168.1.255 nmask=255.255.255.0
Client started (version 3.0.28a).
tdb(unnamed): tdb_open_ex: could not open file /var/run/samba/gencache.tdb: Permission denied
resolve_lmhosts: Attempting lmhosts lookup for name nasdrive<0x20>
startlmhosts: Can't open lmhosts file /etc/samba/lmhosts. Error was No such file or directory
resolve_wins: Attempting wins lookup for name nasdrive<0x20>
resolve_wins: WINS server resolution selected and no WINS servers listed.
resolve_hosts: Attempting host lookup for name nasdrive<0x20>
Connecting to 206.112.100.151 at port 445
timeout connecting to 206.112.100.151:445
Connecting to 206.112.100.151 at port 139
timeout connecting to 206.112.100.151:139
Error connecting to 206.112.100.151 (Operation already in progress)
Connection to nasdrive failed (Error NT_STATUS_ACCESS_DENIED)

Revision history for this message
James Pakko (james-pakko) wrote :

Sorry, my ping response was incomplete.

$ ping nasdrive
PING nasdrive (206.112.100.151) 56(84) bytes of data.
(Here it just paused until I got impatient and typed ctrl-C)

--- nasdrive ping statistics ---
12 packets transmitted, 0 received, 100% packet loss, time 10999ms

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

Thanks for the extra info. I think there is no bug here.
When you use libsmbclient (by smbclient or nautilus) to access "//nasdrive/public" it must first resolve nasdrive to an IP address. It does so by several methods, trying by default in that order: lmhosts, host, wins, bcast. In your case it first tries to find "nasdrive" in /etc/samba/lmhosts but it's not there. Then it tries classic name resolution... and there it finds a match: nasdrive = 206.112.100.151.

So it means something in your name resolution (/etc/hosts file, DNS...) resolves "nasdrive" as "206.112.100.151". For example you're using OpenDNS and it is kind enough to answer something completely wrong based on its search engine. In all cases, it's not a bug in samba.

Solutions to fixing it include:
- rename "nasdrive" to something your name resolution won't find
- fix your name resolution so that "ping nasdrive" doesn't go to 206.112.100.151
- add nasdrive to your lmhosts file
- changing "name resolve order" in /etc/samba/smb.conf so that bcast appears before host and the nasdrive name is found by broadcast rather than host resolution (noisy and wrong, like what Windows does)

Changed in samba (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
James Pakko (james-pakko) wrote :

Thanks, that was very helpful. I changed /etc/samba/smb.conf to include:
   name resolve order = lmhosts bcast host wins
and it works now.

One more question: in the response above to smbclient -d4 there is a line that says:
tdb(unnamed): tdb_open_ex: could not open file /var/run/samba/gencache.tdb: Permission denied

This looks like a bad thing. Is this bad?

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

No. It just means your call to smbclient won't result in any information being cached systemwide for the other users, which is normal when calling smbclient as a normal user.

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

Other bug subscribers

Bug attachments

Remote bug watches

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