title: SFTP: Couldn't get handle: No such file or directory, randomly occurs
body: <p>I'm getting  "Couldn't get handle: No such file or directory" error while transferring the file from a unix application as mentioned in below sample script, We are getting this error randomly but most of the time the file transfer is successful.  I couldn't find what is causing the failure sometimes.</p>
  
  <p>ABCCouldn't get handle: No such file or directory </p>
  
  <p>//script1:</p>
  
  <pre><code>export HOST=server.abc.com
  export ACCOUNT=ABC-application
  LOGFILE=abc.log
  LOGDIR=/directory1/directory2/logdir
  DIR=/directory1/directory2/scriptdir
  sftp -b ${DIR}/sftpscript.sftp -oPort=222 ${ACCOUNT}@${HOST} &gt;&gt; ${LOGDIR}/${LOGFILE}
  
  if [ $? -ne 0 ]
  then
  echo SFTP  failed &gt;&gt; ${LOGDIR}/${LOGFILE}
   cat ${LOGDIR}/${LOGFILE}
   exit 1
  fi
  </code></pre>
  
  <p>//sftpscript.sftp</p>
  
  <pre><code>cd destination_Dir
  lcd /directory1/directory2/sourcefiledir
  put abcsource.dat abcdest.txt
  bye
  </code></pre>
  
  <p>can anyone please let me know what causing the failure sometimes.  Will modifying Verbosity of sftp command would work ?</p>