Hi I have a script which successfully connects and downloads file from a remote sftp server however after three perhaps four connections when it tries to reconnect it fails and I've no idea why, its also for a client so I have no access to their SFTP server and have to rely on them for debug logs etc so its difficult, I finally got them to put it in to debug and see the following
00 9d 40 00 50 4b 05 06 00 00 00 00 01 00 01 00 e4 00 00 00 77 09 00 0 +0 18 00 50 4b 5a 49 50 20 | ..@.PK..............w.....PKZIP 66 6f 72 20 7a 2f 4f 53 20 62 79 20 50 4b 57 41 52 45 + | for z/OS by PKWARE #70267 1553268907.00000 _queue_msg: queueing msg len: 25, code:5, id: +188 ... [1] 00 00 00 19 05 00 00 00 bc 00 00 00 04 00 00 00 00 00 00 00 00 00 00 0 +a 89 00 00 0a 89 | ............................. #70267 1553268907.00000 _get_msg: waiting for message... [1] #70267 1553268907.00000 _do_io: _do_io connected: 1 #70267 1553268907.00000 _do_io: _do_io select(-,-,-, 10) #70267 1553268907.00000 _do_io: _do_io write queue: 29, syswrite: 29, + max: 65536, $!: 00 00 00 19 05 00 00 00 bc 00 00 00 04 00 00 00 00 00 00 00 00 00 00 0 +a 89 00 00 0a 89 | ............................. #70267 1553268907.00000 _do_io: _do_io select(-,-,-, 10) #70267 1553268907.00000 _do_io: _do_io read sysread: 34, total read: +34, $!: 00 00 00 1e 65 00 00 00 bc 00 00 00 01 00 00 00 0b 45 6e 64 20 6f 66 2 +0 66 69 6c 65 00 00 00 02 | ....e............End of file.... 65 6e + | en #70267 1553268907.00000 _get_msg: got it!, len:30, code:101, id:188, +status: 1 65 00 00 00 bc 00 00 00 01 00 00 00 0b 45 6e 64 20 6f 66 20 66 69 6c 6 +5 00 00 00 02 65 6e | e............End of file....en #70267 1553268907.00000 _set_status: _set_status code: 1, str: End of + file #70267 1553268907.00000 _set_error: _set_err code: 5, str: Couldn't r +ead from remote file: End of file #70267 1553268907.00000 DESTROY: Net::SFTP::Foreign::FileHandle=GLOB( +0x237b5d0)->DESTROY called (sftp: Net::SFTP::Foreign=HASH(0x2375828)) #70267 1553268907.00000 _queue_msg: queueing msg len: 13, code:4, id: +189 ... [1] 00 00 00 0d 04 00 00 00 bd 00 00 00 04 00 00 00 00 + | ................. #70267 1553268907.00000 _get_msg: waiting for message... [1] #70267 1553268907.00000 _do_io: _do_io connected: 1 #70267 1553268907.00000 _do_io: _do_io select(-,-,-, 10) #70267 1553268907.00000 _do_io: _do_io write queue: 17, syswrite: 17, + max: 65536, $!: 00 00 00 0d 04 00 00 00 bd 00 00 00 04 00 00 00 00 + | ................. #70267 1553268907.00000 _do_io: _do_io select(-,-,-, 10) #70267 1553268907.00000 _do_io: _do_io read sysread: 30, total read: +30, $!: 00 00 00 1a 65 00 00 00 bd 00 00 00 00 00 00 00 07 53 75 63 63 65 73 7 +3 00 00 00 02 65 6e | ....e............Success....en #70267 1553268907.00000 _get_msg: got it!, len:26, code:101, id:189, +status: 0 65 00 00 00 bd 00 00 00 00 00 00 00 07 53 75 63 63 65 73 73 00 00 00 0 +2 65 6e | e............Success....en #70267 1553268907.00000 _close: closing file handle, return: 1, rid: 00 00 00 00 + | .... #70267 1553268907.00000 DESTROY: Net::SFTP::Foreign=HASH(0x2375828)-> +DESTROY called (current pid: 70267, disconnect_by_pid: 70267), curren +t thread generation: 1, disconnect_by_thread: 1) #70267 1553268907.00000 disconnect: Net::SFTP::Foreign=HASH(0x2375828 +)->disconnect called (ssh pid: 70272) #70267 1553268907.00000 _conn_lost: _conn_lost #70267 1553268907.00000 _set_status: _set_status code: 7, str: Connec +tion lost #70267 1553268907.00000 _set_error: _set_err code: 37, str: Connectio +n to remote server is broken #70267 1553268907.00000 disconnect: starting dirty cleanup of process + 70272 #70267 1553268907.00000 disconnect: killing process 70272 with signal + 0 #70267 1553268907.00000 disconnect: waitpid returned 0 #70267 1553268907.00000 disconnect: waitpid returned 70272 #70267 1553268907.00000 disconnect: process 70272 reaped .... 03/22/2019 11:35:07 INFO: Looking for fares to#70267 1553268907.00000 +new: This is Net::SFTP::Foreign 1.90 #70267 1553268907.00000 new: Loaded from /home/jbinst/perl5/lib/perl5 +/Net/SFTP/Foreign.pm #70267 1553268907.00000 new: Running on Perl v5.10.1 for linux #70267 1553268907.00000 new: debug set to -1 #70267 1553268907.00000 new: ~0 is 18446744073709551615 #70267 1553268907.00000 new: Using backend Net::SFTP::Foreign::Backen +d::Unix 1.88_02 #70267 1553268907.00000 autodisconnect: setting disconnecting pid to +70267 and thread to 1 #70267 1553268907.00000 _init_transport: ssh cmd: ssh -o PreferredAut +hentications=publickey fareloader@10.60.96.19 -s sftp Proceeding to download missing files. Attempting to connect to the SFTP server as: @ 10.60.96.19 #70267 1553268907.00000 _queue_msg: queueing msg len: 5, code:1, id:3 + ... [1] 00 00 00 05 01 00 00 00 03 + | ......... #70267 1553268907.00000 _get_msg: waiting for message... [1] #70267 1553268907.00000 _do_io: _do_io connected: 1 #70267 1553268907.00000 _do_io: _do_io select(-,-,-, 10) #70267 1553268907.00000 _do_io: _do_io write queue: 9, syswrite: 9, m +ax: 65536, $!: 00 00 00 05 01 00 00 00 03 + | ......... #70267 1553268907.00000 _do_io: _do_io select(-,-,-, 10) #70267 1553268917.00000 _do_io: _do_io select failed: #70267 1553268917.00000 _conn_lost: _conn_lost #70267 1553268917.00000 _set_status: _set_status code: 7, str: Connec +tion lost #70267 1553268917.00000 _set_error: _set_err code: 37, str: Connectio +n to remote server stalled #70267 1553268917.00000 _queue_msg: queueing msg len: 26, code:16, id +:0 ... [2] 00 00 00 1a 10 00 00 00 00 00 00 00 11 2f 48 6f 6d 65 2f 61 74 70 63 6 +f 2f 46 61 72 65 73 #70267 1553268917.00000 _get_msg: waiting for message... [2] #70267 1553268917.00000 _do_io: _do_io connected: 0 #70267 1553268917.00000 _conn_lost: _conn_lost #70267 1553268917.00000 _set_status: _set_status code: 7, str: Connec +tion lost #70267 1553268917.00000 _rel2abs: '' --> '.' #70267 1553268917.00000 _queue_msg: queueing msg len: 10, code:16, id +:1 ... [3] 00 00 00 0a 10 00 00 00 01 00 00 00 01 2e + | .............. #70267 1553268917.00000 _get_msg: waiting for message... [3] #70267 1553268917.00000 _do_io: _do_io connected: 0 #70267 1553268917.00000 _conn_lost: _conn_lost :

In reply to NET SFTP disconnects by DesmondL

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.