Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Created Unassigned: Session Operation has timed out [2564]

$
0
0
Hi,

I've seen a few posts on this and while I've tried some of the fixes suggested in them, none of them seem to be working. This seems to be present regardless of file size, I've tried a 5MB file, 20MB, 100MB and 512MB...the final solution if I can get this working needs to be capable of transferring about 10GB or so.

I'm still getting to grips with this library so it might be something that I'm doing wrong and not in fact an issue at all, but looking round I've seen a few pieces here and there so it might be a recurring issue. I have also tried with just the standard buffersize, but seeing the suggestions that this might fix it, I added in the line to specify it explicitly.

Testing it with the SFTP client results in a successful transfer and a very quick one at that, although it is going from host to guest VM so that is to be expected!

Thinking it might be something to do with how I'm initializing the I took a look inside the ConnectionInfo and saw that the client is using SSH2.0 could this be affecting the size?

I have also tested the transfer using the Putty SCP command line tool and it successfully completes without any issues.

```
sshClient.Connect();
if (sshClient.IsConnected)
{
try
{
Console.WriteLine("Connection successful!");
Console.WriteLine();
Console.WriteLine(string.Format("Checking for existence of {0} directory...", destDir));
var locateDir = sshClient.RunCommand(string.Format("if [ -d {0} ]; then echo \"true\"; else echo \"false\"; fi", destDir));
var dirExixts = Convert.ToBoolean(locateDir.Result.Replace("\n", ""));
if (dirExixts)
{
Console.WriteLine("Directory already exists...");
}
else
{
Console.WriteLine("Directory not found, attempting to create directory...");
var createDir = sshClient.RunCommand(string.Format("mkdir {0}", destDir));
if (createDir.ExitStatus == 0)
Console.WriteLine("Destination directory successfully created!");
else
{
throw new Exception(string.Format("Failed to create remote directory: {0}. Error: {1}", destDir, createDir.Error));
}
}

Console.WriteLine();
Console.WriteLine("Initiating SCP transfer...");
var scpClient = new ScpClient(sshClient.ConnectionInfo);
scpClient.BufferSize = 1024 * 16 - 64;
scpClient.Connect();
var file = new FileInfo(@"C:\Users\DevTest\Downloads\20MB.zip");
using (var stream = File.OpenRead(file.FullName))
{
scpClient.Upload(stream, destDir + "/" + file.Name);
}
Console.WriteLine("SCP transfer complete!");
Console.WriteLine();
Console.WriteLine(string.Format("Disconnection from {0}..."));

sshClient.Disconnect();

Console.ReadKey();
}
catch (Exception ex)
{
Console.WriteLine("An unexpected error has occured");
Console.WriteLine(string.Format("Exception: {0}", ex.Message));
sshClient.Disconnect();
}
}
else
{
Console.WriteLine("Connection failed...");
}
```

If needs be as well, I am running this in a VM so can snapshot and sort out sending a copy of the environment over to see if you're able to reproduce in.

After some more digging, specifically finding this site http://winscp.net/eng/docs/scp it looks like SCP has a file size maximum of 4GB anyway making it impractical for the 10GB target I need to hit, however the SFTP function works fine so I can carry on with that aspect of this library but some insight into the issue anyway would be interesting.

Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>