temporary file exception

Advertisement

yzorg
Joined:
Posts:
6

temporary file exception

I'm running this code using the 5.0.6 beta (portable version), and the .NET wrapper assembly.

var options = new WinSCP.SessionOptions() {
    FtpSecure = WinSCP.FtpSecure.None
    , HostName = "wireless.fcc.gov"
    , Protocol = WinSCP.Protocol.Ftp
};

WinSCP.Session session = new WinSCP.Session() {
    ExecutablePath = Path.Combine(Environment.CurrentDirectory, "SftpTools", "WinSCP.exe")
};
session.Open(options);    

The Open() call always fails trying to open a temporary file. It looks like .NET assembly is trying to open the same temporary file twice. I know the temporary file is already open because Process Explorer finds it open by the process even though the exception is thrown (so second open attempt has failed).

P.S. Running from Visual Studio, and portable edition of WinSCP.exe is placed in bin\Debug\SFTPTools\WinSCP.exe.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: temporary file exception

Please set Session.DebugLogPath and post or email me the log file.
_________________
Martin Prikryl

Reply with quote

yzorg
Joined:
Posts:
6

debug log files, and anon FTP in beta

Two debug log files are attached. Both show the IO exception after WinSCP open command fails.

So there might be two layers. Next I tried a automation sync script, and there the simple form of public FTP also failed:

# This Fails
open ftp://wireless.fcc.gov    

But the more complex form with default username and no password works:

# This Works
open ftp://anonymous:@wireless.fcc.gov    

Could there be a regression in open command when using simple form of public FTP URL?

I'm using 5.0.6 beta, portable version. OS is Windows 7 x64. I also have earlier 5.0.5 installed (non-portable version).

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: debug log files, and anon FTP in beta

Maybe I got lost, how is your other post related to the first one? I do not see any error about temporary files in the debug log.

For anynomous FTP: Yes, there's indeed an issue with WinSCP. It just cannot accept empty credentials with FTP. As a workaround, please set .UserName = "anonymous", .Password = "something".
_________________
Martin Prikryl

Reply with quote

yzorg
Joined:
Posts:
6

two exceptions

> Maybe I got lost, how is your other post related to the first one? I do not see any error about temporary files in the debug log.

I'm trying to accomplish the same thing, with the .NET wrapper if possible, but if not then calling out to WinSCP.com script file to synchronize directories.

There is an exception stack trace near the end of the winscpdebug-first.txt (and the other debug log). The debug trace says 'SessionRemoteException' but at runtime the exception that escapes the call is an IO exception: Access Denied, when trying to reopen a temporary file.

This seems related to:
/xmllog="C:\Users\yzorg\AppData\Local\Temp\tmpC390.tmp"

I didn't ask for an XMLLOG, but it looks like it is turned on by default. And in this error condition it seems to be trying to open it twice (or not closing it the first time after the exception).

For the WinSCP.EXE issue: I can't set a password as it is a public FTP site and including a password will fail authentication. I've tried setting an empty password, "", and the .NET wrapper doesn't emit the colon between the username and the site, and that seems to be enough to keep WinSCP.EXE from connecting. Again, the bug seems to be WinSCP.exe, and it is a beta, I can wait for the next drop to use the .NET wrapper.

Thank you very much for the quick responses. I do hope you could run the code snippet to connect to public FTP to see the IO exception for yourself, which seems to be a separate issue.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: two exceptions

yzorg wrote:

There is an exception stack trace near the end of the winscpdebug-first.txt (and the other debug log). The debug trace says 'SessionRemoteException' but at runtime the exception that escapes the call is an IO exception: Access Denied, when trying to reopen a temporary file.
It's not there. Please check yourself. Maybe you have posted another log files.

For the WinSCP.EXE issue: I can't set a password as it is a public FTP site and including a password will fail authentication.
If your server does not ask for password, the password you set won't be used, so it should not fail authentication.
_________________
Martin Prikryl

Reply with quote

yzorg
Joined:
Posts:
6

exception

There is an exception stack trace in both debug logs. It starts on line 93.

[2012-03-28 08:59:23Z] [0001]   Failed: [WinSCP.SessionRemoteException: Authentication failed.]
[2012-03-28 08:59:37Z] [0001]   Exception: WinSCP.SessionRemoteException: Authentication failed.
   at WinSCP.SessionLogReader.Read(LogReadFlags flags)
   at WinSCP.ElementLogReader.Read(LogReadFlags flags)
   at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
   at WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
   at WinSCP.CustomLogReader.WaitForNonEmptyElementAndCreateLogReader(String localName, LogReadFlags flags)
   at WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader()
   at WinSCP.Session.Open(SessionOptions sessionOptions)
[2012-03-28 08:59:37Z] [0001]   Session.Cleanup entering
[2012-03-28 08:59:37Z] [0001]     Command: [exit]    

But an IO exception is what is thrown from the call to Session.Open(). I assume the .NET wrapper is not handling the SessionRemoteException properly.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: exception

Ok, so can you please post a callstack of actual exception you get?
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum