Samba - Error writing 75 bytes to client. -1. (Broken pipe)

Error Message:

Aug 24 17:00:02 Viking smbd[31939]: [2007/08/24 17:00:02, 0] lib/util_sock.c:write_data(562)
Aug 24 17:00:02 Viking smbd[31939]: write_data: write failure in writing to client 10.10.10.100. Error Broken pipe
Aug 24 17:00:02 Viking smbd[31939]: [2007/08/24 17:00:02, 0] lib/util_sock.c:send_smb(769)
Aug 24 17:00:02 Viking smbd[31939]: Error writing 75 bytes to client. -1. (Broken pipe)

From the best of my knowledge this particular error message is related to ‘file descriptors’ which caused the broken pipes. You can fix this issue by setting ‘ulimit’ on the startup script of smb (i.e. /etc/rc.d/init.d/smb)- by increasing the amount of file limits.

For example:

ulimit -Hn 16384
ulimit -Sn 16384
Or in my instance since I am experimenting:
ulimit -HSd unlimited

UPDATE:  After  further  experiment  found  ‘ulimit’  has  no  affect. The only other conclusion at this point in time that I can think of is a device driver issue, or hardware related issue.

ifconfig  output

eth1 Link encap:Ethernet HWaddr 00:09:5B:8D:9A:C3
inet addr:10.10.10.200 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::209:5bff:fe8d:9ac3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:54070745 errors:0 dropped:0 overruns:0 frame:0
TX packets:68109524 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3885232471 (3.6 GiB) TX bytes:2458736338 (2.2 GiB)
Interrupt:5 Base address:0×4000

cat /proc/interrupts output

CPU0
0: 641874455 XT-PIC-XT timer
1: 2 XT-PIC-XT i8042
2: 0 XT-PIC-XT cascade
5: 121165062 XT-PIC-XT eth1
7: 0 XT-PIC-XT ohci_hcd:usb1, ohci_hcd:usb2
8: 8 XT-PIC-XT rtc
9: 1 XT-PIC-XT acpi
10: 0 XT-PIC-XT MPU401 UART
11: 30757233 XT-PIC-XT libata, eth0
12: 4 XT-PIC-XT i8042
14: 643621 XT-PIC-XT ide0
15: 643443 XT-PIC-XT ide1
NMI: 0
LOC: 0
ERR: 0
MIS: 0

Reference:
How to use ulimit

Update again:
>ethtool -k eth1
Offload parameters for eth1:
rx-checksumming: off
tx-checksumming: off
scatter-gather: off
tcp segmentation offload: off

Original error
———————————————————————————————————–
:45:37 Viking smbd[12175]: [2007/08/27 13:45:37, 0] lib/util_sock.c:write_data(562)
Aug 27 13:45:37 Viking smbd[12175]: write_data: write failure in writing to client 10.10.10.100. Error Connection reset by
peer
Aug 27 13:45:37 Viking smbd[12175]: [2007/08/27 13:45:37, 0] lib/util_sock.c:send_smb(769)
Aug 27 13:45:37 Viking smbd[12175]: Error writing 51 bytes to client. -1. (Connection reset by peer)
———————————————————————————————————–
After Disable offloading support
http://support.microsoft.com/kb/936594
———————————————————————————————————–
14:28:16 Viking smbd[12571]: [2007/08/27 14:28:16, 0] lib/util_sock.c:write_data(562)
Aug 27 14:28:16 Viking smbd[12571]: write_data: write failure in writing to client 10.10.10.100. Error Connection reset by
peer
Aug 27 14:28:16 Viking smbd[12571]: [2007/08/27 14:28:16, 0] lib/util_sock.c:send_smb(769)
Aug 27 14:28:16 Viking smbd[12571]: Error writing 208 bytes to client. -1. (Connection reset by peer)
Aug 27 14:28:16 Viking smbd[12571]: [2007/08/27 14:28:16, 0] lib/util_sock.c:write_data(562)
Aug 27 14:28:16 Viking smbd[12571]: write_data: write failure in writing to client 10.10.10.100. Error Broken pipe
Aug 27 14:28:16 Viking smbd[12571]: [2007/08/27 14:28:16, 0] lib/util_sock.c:send_smb(769)
Aug 27 14:28:16 Viking smbd[12571]: Error writing 75 bytes to client. -1. (Broken pipe)
———————————————————————————————————–
After increasing IRPStackSize - common with certain types of anti-virus software (especially with symantec)
http://support.microsoft.com/kb/177078
———————————————————————————————————–
Aug 27 14:44:24 Viking smbd[12719]: [2007/08/27 14:44:24, 0] smbd/nttrans.c:call_nt_transact_ioctl(2481)
Aug 27 14:44:24 Viking smbd[12719]: call_nt_transact_ioctl(0×90060): Currently not implemented.
Aug 27 14:44:39 Viking smbd[12719]: [2007/08/27 14:44:39, 0] lib/util_sock.c:read_data(534)
Aug 27 14:44:39 Viking smbd[12719]: read_data: read failure for 4 bytes to client 10.10.10.100. Error = Connection reset by
peer
Aug 27 14:44:39 Viking smbd[12719]: [2007/08/27 14:44:39, 0] lib/util_sock.c:write_data(562)
Aug 27 14:44:39 Viking smbd[12719]: write_data: write failure in writing to client 10.10.10.100. Error Broken pipe
Aug 27 14:44:39 Viking smbd[12719]: [2007/08/27 14:44:39, 0] lib/util_sock.c:send_smb(769)
Aug 27 14:44:39 Viking smbd[12719]: Error writing 75 bytes to client. -1. (Broken pipe)
———————————————————————————————————–
After increasing connection limit with Windows XP SP2
http://www.mydigitallife.info/2005/11/15/windows-xp-sp2-tcp-connection-limit-event-id-4226/
———————————————————————————————————–
Aug 27 15:03:36 Viking smbd[12839]: [2007/08/27 15:03:36, 0] smbd/nttrans.c:call_nt_transact_ioctl(2481)
Aug 27 15:03:36 Viking smbd[12839]: call_nt_transact_ioctl(0×90060): Currently not implemented.
Aug 27 15:03:37 Viking smbd[12839]: [2007/08/27 15:03:37, 0] lib/util_sock.c:read_data(534)
Aug 27 15:03:37 Viking smbd[12839]: read_data: read failure for 4 bytes to client 10.10.10.100. Error = Connection reset by
peer
Aug 27 15:03:37 Viking smbd[12839]: [2007/08/27 15:03:37, 0] lib/util_sock.c:write_data(562)
Aug 27 15:03:37 Viking smbd[12839]: write_data: write failure in writing to client 10.10.10.100. Error Broken pipe
Aug 27 15:03:37 Viking smbd[12839]: [2007/08/27 15:03:37, 0] lib/util_sock.c:send_smb(769)
Aug 27 15:03:37 Viking smbd[12839]: Error writing 75 bytes to client. -1. (Broken pipe)
Aug 27 15:04:28 Viking smbd[12064]: [2007/08/27 15:04:28, 0] lib/util_sock.c:get_peer_addr(1232)
Aug 27 15:04:28 Viking smbd[12064]: getpeername failed. Error was Transport endpoint is not connected
Aug 27 15:04:28 Viking smbd[12892]: [2007/08/27 15:04:28, 0] lib/util_sock.c:get_peer_addr(1232)
Aug 27 15:04:28 Viking smbd[12892]: getpeername failed. Error was Transport endpoint is not connected
Aug 27 15:04:28 Viking smbd[12892]: [2007/08/27 15:04:28, 0] lib/util_sock.c:read_data(534)
Aug 27 15:04:28 Viking smbd[12892]: read_data: read failure for 4 bytes to client 0.0.0.0. Error = Connection reset by peer
———————————————————————————————————–
Updated NVidia system drivers
NVidia NIC version 50.2.5.0 Date 04.14.2007
No update available.
———————————————————————————————————–
Windows XP Machine - NVidia NIC
IRQ 17 OHCI Compliant IEEE 1394 Host Controller OK
IRQ 17 Marvell Yukon 88E8001/8003/8010 PCI Gigabit Ethernet Controller OK
IRQ 23 NVIDIA nForce4 Serial ATA RAID Controller OK
IRQ 23 NVIDIA Network Bus Enumerator OK

Since I dont use FireWire will attempt to try communication through the Marvell NIC.
My Static IP:
10.10.10.100/24

Windows Error Message Again:
Error Copying File or Folder
Cannot copy {filename}: The specified network name is no longer available.

Aug 27 15:36:45 Viking smbd[13015]: [2007/08/27 15:36:45, 0] smbd/nttrans.c:call_nt_transact_ioctl(2481)
Aug 27 15:36:45 Viking smbd[13015]: call_nt_transact_ioctl(0×90060): Currently not implemented.
Aug 27 15:36:46 Viking smbd[13015]: [2007/08/27 15:36:46, 0] lib/util_sock.c:write_data(562)
Aug 27 15:36:46 Viking smbd[13015]: write_data: write failure in writing to client 10.10.10.100. Error Connection reset by
peer
Aug 27 15:36:46 Viking smbd[13015]: [2007/08/27 15:36:46, 0] lib/util_sock.c:send_smb(769)
Aug 27 15:36:46 Viking smbd[13015]: Error writing 51 bytes to client. -1. (Connection reset by peer)
Aug 27 15:36:48 Viking smbd[12064]: [2007/08/27 15:36:48, 0] lib/util_sock.c:get_peer_addr(1232)
Aug 27 15:36:48 Viking smbd[12064]: getpeername failed. Error was Transport endpoint is not connected
Aug 27 15:36:48 Viking smbd[13060]: [2007/08/27 15:36:48, 0] lib/util_sock.c:get_peer_addr(1232)
Aug 27 15:36:48 Viking smbd[13060]: getpeername failed. Error was Transport endpoint is not connected
Aug 27 15:36:48 Viking smbd[13060]: [2007/08/27 15:36:48, 0] lib/util_sock.c:write_data(562)
Aug 27 15:36:48 Viking smbd[13060]: write_data: write failure in writing to client 0.0.0.0. Error Connection reset by peer
Aug 27 15:36:48 Viking smbd[13060]: [2007/08/27 15:36:48, 0] lib/util_sock.c:send_smb(769)
Aug 27 15:36:48 Viking smbd[13060]: Error writing 4 bytes to client. -1. (Connection reset by peer)
———————————————————————————————————–
Problem resolved I believe. The problem was I was having a network loop.

Computer - Win XP + SP2 (UNC: Raven)
	NIC 1a - 1000Mbit Uplink (Cross-Over) -> NIC 1b 10.10.10.100/24
	NIC 2a - Network Switch 100Mbit 192.168.30.179/24 

Computer - Samba Linux (UNC: Viking)
	NIC 1b - 1000Mbit Uplink (Cross-Over) -> NIC 1a 10.10.10.200/24
	NIC 2b - Network Switch 100Mbit 192.168.30.16/24

Even though I programmed the host (C:\windows\system32\drivers\etc\hosts) file in Windows the problem still existed, where computer Raven will try to communicate through both network cards to establish communication.
10.10.10.200 viking
———————————————————————————————————–
My Resolution:
“Block all source traffic from NIC 2a IP address - eth0 represents the NIC card on the Viking server”
#!/bin/sh

iptables=”/sbin/iptables”
ipstop=”192.168.30.179″

$iptables –flush INPUT
$iptables –flush FORWARD
$iptables –flush OUTPUT

$iptables –policy INPUT ACCEPT
$iptables –policy FORWARD ACCEPT
$iptables –policy OUTPUT ACCEPT

# $iptables -A OUTPUT -o eth0 -p tcp -d $ipstop -j REJECT
# Don’t use TCP IPTABLES REJECT windoze will just drop the connection by default and thus “Error Connect reset by peer”
# Since windoze has a personality of it’s own it will try and use both NIC’s.
$iptables -A OUTPUT -o eth0 -p tcp -d $ipstop -j DROP
$iptables -A OUTPUT -o eth0 -p udp -d $ipstop -j DROP

$iptables -A INPUT -i eth0 -p tcp -s $ipstop -j DROP
$iptables -A INPUT -i eth0 -p udp -s $ipstop -j DROP
———————————————————————————————————–


About this entry