Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Guest

Already resolved. Customer forgot to pay for internet connection...
Guest

Invalid Access to memory. Can't connect to the server

Hi, I'm using WinSCP 4.3.0.1029 in multi-threading application to send files into SFTP server. In application I used your example of C# code:
                

Process winscp = new Process();
winscp.StartInfo.FileName = ConfigurationManager.AppSettings["WinScp"]+"winscp.com";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.CreateNoWindow = true;
winscp.Start();

                /// Feed in the scripting commands
winscp.StandardInput.WriteLine("option batch on");
winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("open " + ConfigurationManager.AppSettings["protocol"]
   + "://" + ConfigurationManager.AppSettings["User"] + ":"
   + ConfigurationManager.AppSettings["Pass"] + "@"
   + ConfigurationManager.AppSettings["Host"] + ":"
   + ((ConfigurationManager.AppSettings["Port"] != null) ? ConfigurationManager.AppSettings["Port"] : "22")
   + " -hostkey=\"" + ConfigurationManager.AppSettings["hostkey"] + "\"");
winscp.StandardInput.WriteLine("ls");
winscp.StandardInput.WriteLine("put " + tmp_name + " " + String.Concat(arc_folder, Path.GetFileName(inputFile)));
winscp.StandardInput.WriteLine("exit");
winscp.StandardInput.Close();

string output = winscp.StandardOutput.ReadToEnd();

winscp.WaitForExit();


Three days it works fine, except that sometimes appears this error
winscp> option batch on

batch           on       
winscp> option confirm off
confirm         off       
winscp> open SFTP://XXXX:xxxxx@XX.XX.XX.XX:2222 -hostkey="ssh-dss 1024 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX"
Searching for host...
Connecting to host...
Authenticating...
Using username "XXXXXX".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] XXXXXX@XX.XX.XX.XX
winscp> ls
D---------   0                           0 Dec  2 12:41:21 2010 kozlplc1
D---------   0                           0 Dec  2 17:01:19 2010 PLC01
D---------   0                           0 Nov 29 13:28:54 2010 PLC02
D---------   0                           0 Dec  2 15:07:04 2010 sl01
D---------   0                           0 Dec  2 15:06:52 2010 sl02
D---------   0                           0 Dec  2 15:12:42 2010 sl03
D---------   0                           0 Dec  2 15:21:04 2010 sl04
winscp> put C:\WINDOWS\TEMP\tmp73F.tmp /sl01/min_cur.js
C:\WINDOWS\TEMP\tmp73F.tmp |          2 KiB |    0,0 KiB/s | binary | 100%
Upload of file 'min_cur.js' was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn on 'Ignore permission errors' option.
No such file or directory.
Error code: 2
Error message from server (en): The file does not exist.
Request code: 9
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort
winscp> exit

But it may appears because of another service on server, which catch incoming files, so this error is not critical and Ok.

But today morning WinSCP was totally crashed and generate this error
winscp> option batch on

batch           on       
winscp> option confirm off
confirm         off       
winscp> open SFTP://XXXX:xxxxx@XX.XX.XX.XX:2222 -hostkey="ssh-dss 1024 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX"
Searching for host...
Connecting to host...
Host is not communicating for more than 15 seconds. Still waiting...
Warning: Aborting this operation will close connection!
(A)bort: Abort
Terminated by user.
winscp> ls
No session.
winscp> put C:\WINDOWS\TEMP\tmpF.tmp /sl01/min_day.js
No session.
winscp> exit

All attempts has the same result. Communication is Ok, SFTP server is works and accessible, no changes in port forwarding or something similar was made. PC restart does not help.
When I tried to use WinSCP.exe after input login data and press login I got "Invalid Access to memory", may be caused by Windows version limitation and it's not critical.

Windows XP Embedded SP 3

Another PC with the same configuration works fine (except point "Invalid Access to memory").