Cat Write Error Connection Reset By Peer Linux
& Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers Search Forums Show Threads Show error initializing 104 connection reset by peer linux Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... linux rdesktop connection reset by peer learn linux and unix commands - unix shell scripting cat: write error: Connection reset by peer UNIX for Dummies Questions & Answers read from socket failed connection reset by peer linux Thread Tools Search this Thread Display Modes #1 03-30-2011 atelford Registered User Join Date: Mar 2011 Last Activity: 4 July 2013, 6:50 AM EDT Posts: 12 Thanks: 0 Thanked 0 Times in 0 Posts cat: write error: Connection reset by peer I have created a script to cat the contents of a log file and pipe it to head and tail so I can get specific lines. When I do this I sometimes randomly get the error "cat: write error: Connection reset by peer". It is completely sporatic and sometimes it doesnt happen and sometimes it does but it means therefore the output of the script is unreliable. Here is the code I am using where tmpfile is the name of the file im cat'ing and errorstartline is the line number in the file I want to load into the "line" variable. line=`cat $TMPFILE | head -$ERRORSTARTLINE | tail -1` I initially thought this was because the TMPFILE was on another mount so I added some code to cp the file to the same dir as the script and then cat but it made no difference. Has anyone seen this error or can anyone recommend an alternative way of getting a specified line out of the log file. The log file isnt that large I dont think so not sure why I am seeing this issue. Remove advertisements Sponsored Links atelford View Public Profile Find all posts by atelford #2 03-30-2011 acmvillareal Registered User Join Date: Mar 2011 Last Activity: 4 June 2014, 1:21 AM EDT Location: Manila Posts: 28 Thanks: 0 Thanked 2 Times in 2 Posts Quote: Has anyone seen this error or can anyone recommend an alternative way of getting a specified line out of the log file. The log file isnt that large I dont think so not sure why I am seeing this issue. Maybe it's better if you use grep or sed. Remove advertisements Sponso
| Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ bug#9089: pipe failure with cat and head of coreutils 6.12 I'm trying to track down a bug in cat of coreutils 6.12. Doing cat /var/log/Xorg.0.log | head -n70 under ksh consistently fails with 'cat: write error: Connection reset by peer'. It does not fail when run under bash and it does not fail in current coreutils . It seems that http://www.unix.com/unix-for-dummies-questions-and-answers/157023-cat-write-error-connection-reset-peer.html ksh implementing pipes by socketpair(2) is the reason for this failure. Does somebody have a hint how to track this down? When trying to use strace it won't fail and I don't know how to get this to run under gdb. Philipp Eric Blake-3 Reply | Threaded Open this post in threaded view ♦ ♦ | Report http://gnu-coreutils.7620.n7.nabble.com/bug-9089-pipe-failure-with-cat-and-head-of-coreutils-6-12-td8249.html Content as Inappropriate ♦ ♦ bug#9089: pipe failure with cat and head of coreutils 6.12 On 07/15/2011 05:30 AM, Philipp Thomas wrote: > I'm trying to track down a bug in cat of coreutils 6.12. Doing > > cat /var/log/Xorg.0.log | head -n70 > > under ksh consistently fails with 'cat: write error: Connection reset by > peer'. It does not fail when run under bash and it does not fail in current > coreutils . It seems that ksh implementing pipes by socketpair(2) is the > reason for this failure. And that behavior of ksh is probably a violation of POSIX: http://austingroupbugs.net/view.php?id=205There, the Austin Group discussion around the issue was that since socketpair() creates observable differences from pipe(), including your example (where socket disconnect behaves differently than EPIPE errors), and many programs are not expecting these differences, that ksh should probably be fixed to use pipe() like everyone else. Conversely, if cat already has any special handling for EPIPE, then we should probably do that same handling for socket disco
Problem - Connection Reset By Peer After Too Much Data is Transferred Issues related to configuring your network Post Reply Print view Search Advanced search 7 posts • Page 1 of 1 chomputer Posts: 4 Joined: 2010/07/25 19:57:26 [RESOLVED] SSH Problem - Connection Reset http://www.centos.org/forums/viewtopic.php?t=26400 By Peer After Too Much Data is Transferred Quote Postby chomputer » 2010/07/25 20:47:27 Hello Everyone,I am having a rather strange problem when I ssh to my linux server that's running CentOS 5.4. It appears that there is a hard limit on the amount of data that I can transfer in a single session and once I reach it, I get a 'Connection reset by peer' error message. Unfortunately, the amount of data is very small, about 48k. connection reset Here is the situation...I can open an ssh session from my local workstation running Windows XP using PuTTY and I encounter no problems. I am presented with a terminal and can execute commands without any issue. For instance, I can execute ls to list the contents of my home directory exactly 84 times and then it disconnects me with the 'Connection reset by peer' message or I can execute cat on any file over 48k and instantly get kicked connection reset by off with the same message. I can open up an SFTP session to my server and if I try to transfer any file over 48k it will transfer the first 48k and then the FTP session will die. I can cat a 10k file 4 times fine and then it disconnects on the 5th attempt. Similarly, if I try to push data from my workstation to the server, I hit the same limit. I have a SVN repository installed that I connect to using svn+ssh, and if I attempt to commit any changes over 48k - Connection reset by peer.So, at first I wasn't sure if I had SSH misconfigured on my server or if the problem was on my workstation. I attempted to log on to a friend's linux server using PuTTY. I connected with no problems and didn't encounter the Connection reset by error message. So it seems as though my PuTTY configuration wasn't the problem. While I was connected to my friend's server, I initiated a new ssh session from his server to my server. From his server I was able to connect with no issues. I tried executing cat with a text file over 3MB and it displayed the entire file with no problems. I established an SFTP session from his server to mine and was able to pull the same 3MB file across with no problems. One possible di