The Unofficial Samba HOWTO

Troubleshooting Samba

David Lechnyr <david@lechnyr.com>
Tue, 13 May 2003 11:32:46 -0700

Is It Not Nifty?

"You're reasoning is excellent -- it's only your basic assumptions that are wrong." -- Anonymous


Samba Checklist

The following items should be consulted, in sequential order, to help diagnose/troubleshoot your Samba server.

Test #1: Ensure basic connectivity

Test #2: Proper Samba configuration

Test #3: Daemons

Test #4: NetBIOS Name Resolution

Test #5: Listing Network Shares

Test #6: Establishing a Session

If All Else Fails...

Again, don't panic. The solution is there; you just have to do the work to determine the cause of the problem. If you're certain you've exhausted your options and have read, followed and addressed the above tests, you can always post your question to one of the Samba mailing lists located at http://lists.samba.org. If you haven't addressed and resolved the above tests, don't be suprised if nobody answers your questions ;-)

Samba Logfile Settings

To stand a chance of determining the answer to the classic question of "what went wrong" you'll need to understand how to enable Samba logging and how to decipher its cryptic log messages as well. First, here are a few of the smb.conf(5) parameters that directly affect logging:

Marshalling/Unmarshalling

If you've ever seen something similar to the following in a logfile before, you've probably been a bit perplexed:

rpc_server/srv_samr.c:api_samr_set_userinfo(670)
api_samr_set_userinfo: Unable to unmarshall SAMR_Q_SET_USERINFO.

By itself, marshalling means to take variable data, serialize (i.e., place in order) it, and send it in transmittable form across a network or to a file. Unmarshalling is the reverse process. In DCE/RPC terminology, marshalling and unmarshalling refers to the flattening and unpacking of a data stream between a client and server. A rough approximation of this process could be described as:

Using tcpdump

When troubleshooting your Samba server with tcpdump, the best use is something like:

tcpdump -ln -vv host 192.168.1.1 | tee tcpdump.samba

While analyzing your data, you may come across an error message similar to:

WARNING: Short packet. Try increasing the snap length

This actually has nothing to do with Samba, however it comes up a lot. It's tcpdump itself complaining about snaplen (-s <number>) being shorter than at least one packet during its capture. Again, it has nothing to do with Samba; it's harmless and can be ignored.

Troubleshooting Example

This is, perhaps, the best example of a real-life approach towards troubleshooting, which was posted on samba-technical:

From: jht@samba.org (John H Terpstra)
Subject: Re: Eureka! Slow Samba transfers resolved!
Date: Sun, 19 Jan 2003 21:17:39 +0000 (UTC)

On Sun, 19 Jan 2003, Jean-Marie White wrote:

> I just spent so much time troubleshooting why
> *some types* of samba transfers were slow that I thought
> I would share how I resolved the problem.
>
> This problem had been going on for ever. As far as I could
> tell, it was only happening with winamp (MP3 player). All
> my MP3s reside on my Linux box and I was trying to access
> them from my PC running Windows 2000. What was throwing me
> for a loop was that Windows Media player seemed to be more
> successful at playing them ! What would happen is that Winamp
> would freeze and nothing would happen. I had then decided to
> just copy my MP3s back to my PC.
>
> Then, last night I started using FrontPage for some reason or
> another; and when I tried to publish my web site to my Linux
> box, then behavior I had observed with my MP3s started
> plaguing FrontPage as well.
>
> I went through all the troubleshooting guides, learned about
> every samba configuration options: I was able to successfully
> transfer a 100M file in either direction (linux->pc or
> pc->linux) using the File Explorer without any problem.
> But I just couldn't for the life of me understand why
> winamp and FrontPage were having problems.
>
> Then I decided to use ethereal and try and understand what
> was actually happening on the wire. I realized that when
> winamp or FrontPage were trying to transfer files, Linux
> was ending up retransmitting the same frame over and over
> without ever receiving a TCP acknowledgment for it. Then the
> PC would eventually tear down the session and re-establish the
> session and restart the transfer. An article that I read
> http://www.dd.iij4u.or.jp/~okuyamak/Documents/tuning.english.html
> talking about how Windows could mysteriously drop packets,
> and I started thinking that maybe packets were being lost
> due to some hardware problem.
>
> So I looked at my PC network card configuration (Linksys LNE
> 100TX Fast Ethernet) and saw that the "Connection Type" was
> set to auto-detect. (My PC is connected to my Linux box through
> a Linksys 8-port Workgroup Switch - Ehterfast 10/100) So I
> thought, maybe having to ends that "auto-detect" each
> others speed is not good. So I changed my "Connection Type"
> to 100 TX Full Duplex and VOILA! All my problems solved, winamp
> is happily playing away and FrontPage can publish my whole web
> site in seconds.

The problem and solution you describe here is very common. It also happens to be the least expected,
thus we have had many queries on this list regarding samba problems that were in fact hardware issues like yours.

Thank you for sharing your experience. This is valuable feedback.

John H Terpstra
Email: jht@samba.org

This document was lovingly handcrafted on a Dell Latitude C400 laptop running Slackware Linux 9.0, in case anyone asks.

Copyright © 2003 David Lechnyr <david@lechnyr.com>
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation. A copy of the license is available at http://www.gnu.org/licenses/fdl.txt.