Question

I have a very basic c# console app that sftps into a remote server, grabs a file, and throws it into a location on our end (that the console application is on).

When I run the application manually, it runs fine and gets the file successfully. This is also true of when I run it in an automated task.

However we use jams and for some reason, when scheduled to run through that, it ends up throwing

System.IO.IOException: The handle is invalid.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.Console.get_CursorLeft()
   at GrabDataCarve.Class1.OnTransferProgress(Object sender, SftpTransferProgressEventArgs e)
   at Rebex.Net.Sftp.CipxfYZ(Object , String , Stream , Int64 , Int64 )
   at Rebex.Net.Sftp.CipxfYZ(FileMode , Object , String , String , Int64 , Int64 , Int64 )
   at Rebex.Net.Sftp.GetFile(String remotePath, String localPath)

Would anyone know a way to resolve this? (It seems that JAMS is running it without a console window open.. maybe?

Thanks in advance.

Was it helpful?

Solution

Apologies, my initial thinking was incorrect. It ended up simply being the sftp was denying the new ip and causing this error to be thrown. It is now resolved by having the other server approve the new ip.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top