# Samba (3.0.10) errors in log

## CrashNBurns

My forum (and google!) searches have turned up nothing on this, so I thought I'd ask for a bit of help on this.

I just emerged and configured Samba 3.0.10 for use as just a file server (i.e. no printing, authentication, PDC, etc.).  Everything works as desired.  My network consists of a single Win XP Pro (SP2) and the Linux server.  The linux server has a static IP address and the client is DHCP.

The problem is that on a very frequent basis, I'm seeing the following in my syslog:

```
Mar  6 11:22:12 linserver smbd[15214]: [2005/03/06 11:22:12, 0] lib/util_sock.c:get_peer_addr(1000)

Mar  6 11:22:12 linserver smbd[15214]:   getpeername failed. Error was Transport endpoint is not connected

Mar  6 11:22:12 linserver smbd[15214]: [2005/03/06 11:22:12, 0] lib/util_sock.c:get_peer_addr(1000)

Mar  6 11:22:12 linserver smbd[15214]:   getpeername failed. Error was Transport endpoint is not connected

Mar  6 11:22:12 linserver smbd[15214]: [2005/03/06 11:22:12, 0] lib/access.c:check_access(328) Mar  6 11:22:12 linserver smbd[15214]: [2005/03/06 11:22:12, 0] lib/util_sock.c:get_peer_addr(1000)

Mar  6 11:22:12 linserver smbd[15214]:   getpeername failed. Error was Transport endpoint is not connected

Mar  6 11:22:12 linserver smbd[15214]:   Denied connection from  (0.0.0.0)

Mar  6 11:22:12 linserver smbd[15214]: [2005/03/06 11:22:12, 0] lib/util_sock.c:get_peer_addr(1000)

Mar  6 11:22:12 linserver smbd[15214]:   getpeername failed. Error was Transport endpoint is not connected

Mar  6 11:22:12 linserver smbd[15214]:   Connection denied from 0.0.0.0

Mar  6 11:22:12 linserver smbd[15214]: [2005/03/06 11:22:12, 0] lib/util_sock.c:write_socket_data(430)

Mar  6 11:22:12 linserver smbd[15214]:   write_socket_data: write failure. Error = Connection reset by peer

Mar  6 11:22:12 linserver smbd[15214]: [2005/03/06 11:22:12, 0] lib/util_sock.c:write_socket(455)

Mar  6 11:22:12 linserver smbd[15214]:   write_socket: Error writing 5 bytes to socket 24: ERRNO = Connection reset by peer

Mar  6 11:22:12 linserver smbd[15214]: [2005/03/06 11:22:12, 0] lib/util_sock.c:send_smb(647)

Mar  6 11:22:12 linserver smbd[15214]:   Error writing 5 bytes to client. -1. (Connection reset by peer)

Mar  6 11:54:12 linserver smbd[15268]: [2005/03/06 11:54:12, 0] lib/util_sock.c:get_peer_addr(1000)

Mar  6 11:54:12 linserver smbd[15268]:   getpeername failed. Error was Transport endpoint is not connected

Mar  6 11:54:12 linserver smbd[15268]: [2005/03/06 11:54:12, 0] lib/access.c:check_access(328) Mar  6 11:54:12 linserver smbd[15268]: [2005/03/06 11:54:12, 0] lib/util_sock.c:get_peer_addr(1000)

Mar  6 11:54:12 linserver smbd[15268]:   getpeername failed. Error was Transport endpoint is not connected

Mar  6 11:54:12 linserver smbd[15268]:   Denied connection from  (0.0.0.0)

Mar  6 11:54:12 linserver smbd[15268]: [2005/03/06 11:54:12, 0] lib/util_sock.c:get_peer_addr(1000)

Mar  6 11:54:12 linserver smbd[15268]:   getpeername failed. Error was Transport endpoint is not connected

Mar  6 11:54:12 linserver smbd[15268]:   Connection denied from 0.0.0.0

Mar  6 11:54:12 linserver smbd[15268]: [2005/03/06 11:54:12, 0] lib/util_sock.c:write_socket_data(430)

Mar  6 11:54:12 linserver smbd[15268]:   write_socket_data: write failure. Error = Connection reset by peer

Mar  6 11:54:12 linserver smbd[15268]: [2005/03/06 11:54:12, 0] lib/util_sock.c:write_socket(455)

Mar  6 11:54:12 linserver smbd[15268]:   write_socket: Error writing 5 bytes to socket 5: ERRNO = Connection reset by peer

Mar  6 11:54:12 linserver smbd[15268]: [2005/03/06 11:54:12, 0] lib/util_sock.c:send_smb(647)

Mar  6 11:54:12 linserver smbd[15268]:   Error writing 5 bytes to client. -1. (Connection reset by peer)
```

When I look at the individual log files for the same time slice (i.e. /var/log/samba3/log.0.0.0.0 and log.192.168.1.100) I see:

log.0.0.0.0

-------------

```
[2005/03/06 11:22:12, 0] lib/util_sock.c:get_peer_addr(1000)

  getpeername failed. Error was Transport endpoint is not connected

[2005/03/06 11:22:12, 0] lib/access.c:check_access(328)

[2005/03/06 11:22:12, 0] lib/util_sock.c:get_peer_addr(1000)

  getpeername failed. Error was Transport endpoint is not connected

  Denied connection from  (0.0.0.0)

[2005/03/06 11:22:12, 1] smbd/process.c:process_smb(1084)

[2005/03/06 11:22:12, 0] lib/util_sock.c:get_peer_addr(1000)

  getpeername failed. Error was Transport endpoint is not connected

  Connection denied from 0.0.0.0

[2005/03/06 11:22:12, 0] lib/util_sock.c:write_socket_data(430)

  write_socket_data: write failure. Error = Connection reset by peer

[2005/03/06 11:22:12, 0] lib/util_sock.c:write_socket(455)

  write_socket: Error writing 5 bytes to socket 24: ERRNO = Connection reset by peer

[2005/03/06 11:22:12, 0] lib/util_sock.c:send_smb(647)

  Error writing 5 bytes to client. -1. (Connection reset by peer)
```

log.192.168.1.100

---------------------

```

[2005/03/06 11:54:12, 0] lib/util_sock.c:get_peer_addr(1000)

  getpeername failed. Error was Transport endpoint is not connected

[2005/03/06 11:54:12, 0] lib/access.c:check_access(328)

[2005/03/06 11:54:12, 0] lib/util_sock.c:get_peer_addr(1000)

  getpeername failed. Error was Transport endpoint is not connected

  Denied connection from  (0.0.0.0)

[2005/03/06 11:54:12, 1] smbd/process.c:process_smb(1084)

[2005/03/06 11:54:12, 0] lib/util_sock.c:get_peer_addr(1000)

  getpeername failed. Error was Transport endpoint is not connected

  Connection denied from 0.0.0.0

[2005/03/06 11:54:12, 0] lib/util_sock.c:write_socket_data(430)

  write_socket_data: write failure. Error = Connection reset by peer

[2005/03/06 11:54:12, 0] lib/util_sock.c:write_socket(455)

  write_socket: Error writing 5 bytes to socket 5: ERRNO = Connection reset by peer

[2005/03/06 11:54:12, 0] lib/util_sock.c:send_smb(647)

  Error writing 5 bytes to client. -1. (Connection reset by peer)
```

So, if you notice the main log, at 11:22, the errors pertain to the 0.0.0.0 address, where the 11:54 errors pertain to the 192.168.1.100 address.  Note that during this time, the XP2 machine was at the login screen, and not doing ANYTHING in the background (as far as I can tell! ;->).

I've tried searching both these forums and google, and basically came up empty handed.  I was wondering if anyone might have any ideas on how to go about tracking this issue down.

Thanks,

- CrashNBurns

P.S. Here's my samba config:

```

linserver samba3 # testparm -s

Load smb config files from /etc/samba/smb.conf

Processing section "[backup]"

Processing section "[data]"

Loaded services file OK.

# Global parameters

[global]

        workgroup = BURNS

        server string = Samba Server %v

        interfaces = lo, eth0

        bind interfaces only = Yes

        security = SHARE

        guest account = smbguest

        log file = /var/log/samba3/log.%m

        max log size = 50

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        dns proxy = No

        guest ok = Yes

        hosts allow = 127.0.0.1, 192.168.1.0/24

[backup]

        comment = Network Backup Storage Area

        path = /mnt/netdrv1/backup

        force user = smbguest

        force group = smbguest

        read only = No

[data]

        comment = Network Data Storage Area

        path = /mnt/netdrv1/data

        force user = smbguest

        force group = smbguest

        read only = No

linserver samba3 #
```

----------

## Lemma

I have the same type of errors, no solution in sight... It does work well, but the errors are there in the log and I assume the do mean something  :Wink: .

----------

## sedeuce

 *Lemma wrote:*   

> I have the same type of errors, no solution in sight... It does work well, but the errors are there in the log and I assume the do mean something .

 

Well, I'm in the same boat so I thought I would chime in - maybe somebody has some news to share?

I have a very basic Samba conf on a simple network (gentoo server/router with a Mac and Windows XP client).  I am able to use Samba on the gentoo server without problems, however, periodically get a block of these error messages in /var/log/messages:

```

<date> <hostname> smbd[7560]: [2005/08/03 02:29:30, 0] lib/util_sock.c:get_peer_addr(1000)

<date> <hostname> smbd[7560]:   getpeername failed. Error was Transport endpoint is not connected

<date> <hostname> smbd[7560]: [2005/08/03 02:29:30, 0] lib/util_sock.c:get_peer_addr(1000)

<date> <hostname> smbd[7560]:   getpeername failed. Error was Transport endpoint is not connected

<date> <hostname> smbd[7560]: [2005/08/03 02:29:30, 0] lib/util_sock.c:write_socket_data(430)

<date> <hostname> smbd[7560]:   write_socket_data: write failure. Error = Connection reset by peer

<date> <hostname> smbd[7560]: [2005/08/03 02:29:30, 0] lib/util_sock.c:write_socket(455)

<date> <hostname> smbd[7560]:   write_socket: Error writing 4 bytes to socket 22: ERRNO = Connection reset by peer

<date> <hostname>  smbd[7560]: [2005/08/03 02:29:30, 0] lib/util_sock.c:send_smb(647)

<date> <hostname>  smbd[7560]:   Error writing 4 bytes to client. -1. (Connection reset by peer)

```

Anybody have any clues?  Not that I'm anal, but I like clean logs  :Laughing: 

Thanks,

sedeuce

----------

## sedeuce

 *sedeuce wrote:*   

>  *Lemma wrote:*   I have the same type of errors, no solution in sight... It does work well, but the errors are there in the log and I assume the do mean something . 
> 
> Well, I'm in the same boat so I thought I would chime in - maybe somebody has some news to share?
> 
> sedeuce

 

Scratch that.  Don't know all [any of] the specifics, but it is related to port 445 and 139 both attempting to be used on your samba server.

I found this post:

http://www.pelennorfields.com/matt/2005/04/13/samba-error-getpeername-failed/

According to Mark Orenstein ( http://groups-beta.google.com/group/linux.samba/msg/370a5eaded746ab2 ), Windows XP Pro attempts to connect to the share on ports 445 and 139, and whichever port responds first is used for further communication.. Mark therefore suggested disabling port 445 via a simple iptables rule:

```
iptables -I INPUT 1 -p tcp --dport 445 -j DROP
```

The caveat is:

Be careful running this on a Samba 3.x PDC with other samba servers on the network. It appears that you will loose the ability for windows clients to map drives to the other non-PDC servers on the network from my test today.

So what I did:

 - found one of the log files for an offending Windows XP system that was producing the getpeername errors

```
/var/log/samba3/log.<xphostname>
```

 - correlated the times in the samba3/log file to the /var/log/messages to confirm this was the offending one

 - backed up the log file to /tmp and removed it from /var/log/samba3/

 - applied the iptables rule

 - waited about an hour and saw the newly created /var/log/samba3/log.<hostname> file created

 - checked it and found no more errors.   yay!

Hope this helps,

sedeuce

----------

## sgould

 *sedeuce wrote:*   

> Don't know all [any of] the specifics, but it is related to port 445 and 139 both attempting to be used on your samba server.

 

Thanks for that info. It was enough to help me find a solution!  :Smile:  In the smb.conf file, I added the following line:

```
smb ports = 139
```

That seems to have fixed it for me. So far my (re-configured) Samba server has been up-and-running for 4 hours without producing any of those "write_socket" error messages.  :Smile: 

BTW, I'm running smbd 3.0.14a.

Steve

----------

