SCP Upload fails and leaves a 0 byte file on the destination, error "Error uploading: Socket closed"
search cancel

SCP Upload fails and leaves a 0 byte file on the destination, error "Error uploading: Socket closed"

book

Article ID: 437717

calendar_today

Updated On:

Products

Workload Automation Agent

Issue/Introduction

SCP Upload job consistently fails for a specific file, "abc.txt," while another file, "def.txt," transfers successfully using the same job definition and destination.

Manual transfers via SFTP also work without issue.

Symptoms & Errors:

  • A 0-byte file is created on the destination server, but the transfer never completes.
  • Agent Error: <Error uploading: Socket closed>
  • SCP Server side message : "Incoming subsystem message length 65558 exceeds maximum supported packet length 65535 (213)."

Cause

The root cause is a packet size mismatch, agent's side is sending a bit more data than what the remote SFTP server permits, "Incoming subsystem message length" of 65558

Resolution

  • Add/modify below options in agentparm.txt 

ftp.scp.maxpacketsize=32768
#This value is passed into the SSH session connector as the SCP client’s maximum channel packet size for the SSH_MSG_CHANNEL_OPEN path.


ftp.scp.downloadblocksize=32768
# this parameter sets the packet size for both downloads and uploads

  • Restart the agent and retest