The Unofficial Samba HOWTO
Prev   Next

6. Troubleshooting

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

Among the many troubleshooting issues people have asked me about, here are the three frequent solutions that fix nine out of ten problems:

  1. Do you have firewall protection (e.g., iptables) on your Samba server? If so, try turning this entirely off. Do the same to your Windows computer -- this includes any 3rd party firewall (e.g., Norton Firewall) and the built-in Internet Connection Firewall (ICF) on some versions of Windows. If things work fine, then you're guilty of using a tool without knowing how to use it ;-) Read up on the section on using Samba with iptables in this document.
  2. Is your smb.conf file longer than 20 lines? In fact, did you just start with the example that comes with the Samba source code? If so, you're guilty of the "cut and paste" syndrome and/or the "configuration overkill" habit. Trust me; avoid the headache and start over from scratch. Only include the items in smb.conf that you need. Only add items to your configuration file once everything is working.
  3. Are you getting an obscure Windows error message? Microsoft has never fully documented their error messages; instead, try increasing Samba's log level to either 2 or 3; restart Samba and examine the log output. The Samba Team has put a lot of effort into accurate logging of what's going on, and you'll get more diagnostic mileage out of it than you will Microsoft's snazzy simple yet unclear error message.

Additionally, these troubleshooting items might be of benefit. If one or more of these doesn't work, but others do, then you can help to isolate where the problem is coming from.

Logfiles

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 parameters that directly affect logging:

Common Error Messages

While it's not Samba's responsibility for managing ill-conceived error messages from Microsoft Windows,here are some of the more common ones you might encounter when trying to join a Samba domain. Please note that this is not a comprehensive list -- Windows has many error messages that are undocumented by Microsoft.

Troubleshooting Example

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

From: jmwhite@yahoo.com (Jean-Marie White)
Newsgroups: mailing.unix.samba-technical
Subject: Eureka! Slow Samba transfers resolved!
Date: Sun, 19 Jan 2003 18:07:31 +0000 (UTC)

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 loopwas 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) was 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.

I hope this will help.

Prev Home Next
Advanced Topics   Security