Discussion:
[Samba] tree connect failed: NT_STATUS_BAD_NETWORK_NAME
Dominic Gamble
15 years ago
Permalink
Hi,

I can't get access to any shares when running "smbclient //DUCK/test -U
Dominic". I'm getting the message:
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

I'm pretty sure it's authenticating properly as it says "session setup ok"
in the debug output. If I enter the wrong password I get:
"session setup failed: NT_STATUS_LOGON_FAILURE"

I'm running CentOS 5.4 with the following samba packages

samba-common-3.0.33-3.15.el5_4.1
samba-3.0.33-3.15.el5_4.1
samba-swat-3.0.33-3.15.el5_4.1
samba-client-3.0.33-3.15.el5_4.1

My samba setup uses LDAP for authentication. All logging seems to indicate
that authentication and LDAP is working well.

My /etc/samba/smb.conf was generated with SWAT and has the following shares:

[tmp]
comment = temporary files
path = /tmp
hosts allow =
hosts deny =

[test]
comment = test files
path = /test
hosts allow =
hosts deny =


Both shares contain a file called myfile.txt.

When I connect to the "tmp" share, I don't get the "tree connect failed:
NT_STATUS_BAD_NETWORK_NAME", but I can't list any files:

[root at duck cache]# smbclient //DUCK/tmp -U dominic
Password:
Domain=[ORANDA] OS=[Unix] Server=[Samba 3.0.33-3.15.el5_4.1]
smb: \> ls
. D 0 Mon Dec 28 04:02:13 2009
.. D 0 Sun Dec 27 21:16:53 2009

36224 blocks of size 8388608. 34082 blocks available
smb: \>

When I connect to the "test" share I get the "tree connect failed:
NT_STATUS_BAD_NETWORK_NAME":
[root at duck cache]# smbclient //DUCK/test -U dominic
Password:
Domain=[ORANDA] OS=[Unix] Server=[Samba 3.0.33-3.15.el5_4.1]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

The permissions on the /tmp and /test folders are the same:

drwxrwxrwt 2 root root 4096 Dec 27 21:35 test
drwxrwxrwt 4 root root 4096 Dec 28 04:02 tmp

There are no complex acls on them either:

[root at duck /]# getfacl tmp
# file: tmp
# owner: root
# group: root
user::rwx
group::rwx
other::rwx

[root at duck /]# getfacl test
# file: test
# owner: root
# group: root
user::rwx
group::rwx
other::rwx

I've tried getting more debug info by setting log levels to 10 in both
smb.conf and using the -d10 parameter on the command line, but it gives me
nothing useful in the logs or in the output.

I've been through 'The Samba Checklist'
(http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/diagnosis.html)
and had no other problems.

Here is the rest of my smb.conf:

[global]
workgroup = ORANDA
server string = Duck
passdb backend = ldapsam:ldap://localhost/
pam password change = Yes
passwd program = /usr/sbin/smbldap-passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n
*all*authentication*tokens*updated*
unix password sync = Yes
log level = 10
log file = /var/log/samba/log.%m
load printers = No
printcap name = /dev/null
disable spoolss = Yes
add user script = /usr/sbin/smbldap-useradd -m "%u"
delete user script = /usr/sbin/smbldap-userdel "%u"
add group script = /usr/sbin/smbldap-groupadd -p "%g"
delete group script = /usr/sbin/smbldap-groupdel "%g"
add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
delete user from group script = /usr/sbin/smbldap-groupmod -x "%u"
"%g"
set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
add machine script = /usr/sbin/smbldap-useradd -w "%u"
logon script = login.cmd
logon path = \\%N\profiles\%U
logon drive = H:
domain logons = Yes
os level = 127
wins support = Yes
ldap admin dn = cn=admin,dc=oranda,dc=internal
ldap delete dn = Yes
ldap group suffix = ou=Group
ldap idmap suffix = ou=Idmap
ldap machine suffix = ou=Computers
ldap passwd sync = Yes
ldap suffix = dc=oranda,dc=internal
ldap user suffix = ou=People
panic action = /usr/share/samba/panic-action %d
admin users = dominic
hosts allow = 192.168.10., 127.
hosts deny = ALL
printing = bsd
print command = lpr -r -P'%p' %s
lpq command = lpq -P'%p'
lprm command = lprm -P'%p' %j
use client driver = Yes

This has had me stumped for 3 days straight now and I don't know what else I
can try. Samba just isn't giving me any more clues.

I've found lots of other posts like mine through google with no replies to
them. Does anyone have any ideas of what to do next?

I would greatly appreciate if someone could point me in the right direction.

Best regards,
Dominic.
Michael Adam
15 years ago
Permalink
Hi Dominic,
Post by Dominic Gamble
Hi,
I can't get access to any shares when running "smbclient //DUCK/test -U
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
I'm pretty sure it's authenticating properly as it says "session setup ok"
"session setup failed: NT_STATUS_LOGON_FAILURE"
This is correct.
...
This is strange.

There should be some logging around such a BAD_NETWORK_NAME.
So could you please do the following?

* stop samba services (smbd, nmbd, winbindd)
* remove (or comment out) the line "log file = /var/log/samba/log.%m"
from your smb.conf
* leave the log level at 10 globally
* remove the log files under /var/log/samba
* start samba services
* do the failing connect to the share "test"
* post /var/log/samba/log.smbd here

Cheers - Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba/attachments/20091228/bfe71f69/attachment.pgp>
Rob Townley
15 years ago
Permalink
Post by Michael Adam
Hi Dominic,
Post by Dominic Gamble
Hi,
I can't get access to any shares when running "smbclient //DUCK/test -U
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
I'm pretty sure it's authenticating properly as it says "session setup ok"
"session setup failed: NT_STATUS_LOGON_FAILURE"
This is correct.
Starting from a fresh boot up, try to use the /test share first, does it work?
Does /tmp then fail?
If so, look under /var/cache/samba/

i don't remember exactly what i came across the
NT_STATUS_BAD_NETWORK_NAME error on CentOS 5.4 and what i did to fix
it, but do remember it wasn't what i expected.
...
Dominic Gamble
15 years ago
Permalink
Hi Rob,

After a reboot, everything works (both the /test share and the /tmp share,
and it now shows the files in them). It doesn't make any sense, but THANK
YOU!

I used chkconfig to ensure that both smb and ldap started at runlevels 3 and
5, and then rebooted.

I don't know how many times I restarted smb and slapd, and I don't quite
understand why a full reboot was required, but there you go!

Best regards,
Dominic.

-----Original Message-----
From: samba-bounces at lists.samba.org [mailto:samba-bounces at lists.samba.org]
On Behalf Of Rob Townley
Sent: Tuesday, 29 December 2009 4:45 AM
To: samba at lists.samba.org
Subject: Re: [Samba] tree connect failed: NT_STATUS_BAD_NETWORK_NAME
Post by Michael Adam
Hi Dominic,
Post by Dominic Gamble
Hi,
I can't get access to any shares when running "smbclient //DUCK/test -U
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
I'm pretty sure it's authenticating properly as it says "session setup ok"
"session setup failed: NT_STATUS_LOGON_FAILURE"
This is correct.
Starting from a fresh boot up, try to use the /test share first, does it
work?
Does /tmp then fail?
If so, look under /var/cache/samba/

i don't remember exactly what i came across the
NT_STATUS_BAD_NETWORK_NAME error on CentOS 5.4 and what i did to fix
it, but do remember it wasn't what i expected.
...
(http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/diagnosis.html)
...
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
Michael Adam
15 years ago
Permalink
Hi Dominic,

I wanted to wait for the original mail to pop up on the list.
But somehow it did not appear yet.
So while the problem seems to be solved meanwhile, I wanted to
...
This really means that you got a permission denied on the unix
level. -- Despite the unix perms that you listed in your last
mail. I don't know what made it accessible after a reboot, but
I guess this is about all there is to see from the samba side.

Cheers - Michael
...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba/attachments/20091229/ff12460d/attachment.pgp>
Volker Lendecke
15 years ago
Permalink
...
Probably selinux. The reboot might finally have deactivated
it.

Volker
Michael Adam
15 years ago
Permalink
...
Ok, I suspected "something along these lines", but my
knowledge about selinux and friends is so embrassing
that I did not even want to mention the word actively
myself, hoping that someone would explain this... ;-)

Cheers - Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba/attachments/20091229/ec3e1315/attachment.pgp>
Dominic Gamble
15 years ago
Permalink
I did change selinux from restrictive to permissive at some point during the
process, by editing the file /etc/selinux/config. I didn't know a reboot was
required for this to take effect, but that could be it.

Best regards,
Dominic

-----Original Message-----
From: samba-bounces at lists.samba.org [mailto:samba-bounces at lists.samba.org]
On Behalf Of Michael Adam
Sent: Wednesday, 30 December 2009 8:30 AM
To: Volker Lendecke
Cc: samba at lists.samba.org
Subject: Re: [Samba] FW: tree connect failed: NT_STATUS_BAD_NETWORK_NAME
...
Ok, I suspected "something along these lines", but my knowledge about
selinux and friends is so embrassing that I did not even want to mention the
word actively myself, hoping that someone would explain this... ;-)

Cheers - Michael

Loading...