Topic "temporary file exception"

Author Message
yzorg
[View user's profile]

Joined: 2012-03-28
Posts: 6
I'm running this code using the 5.0.6 beta (portable version), and the .NET wrapper assembly.

Code:

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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please set Session.DebugLogPath and post or email me the log file.
_________________
Martin Prikryl
yzorg
[View user's profile]

Joined: 2012-03-28
Posts: 6
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:

Code:

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


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

Code:

# 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).
winscpdebug-second.txt (8.76 KB) [Download]

Description: (none)

winscpdebug-first.txt (8.75 KB) [Download]

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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
yzorg
[View user's profile]

Joined: 2012-03-28
Posts: 6
> 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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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.

Quote:
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
yzorg
[View user's profile]

Joined: 2012-03-28
Posts: 6
There is an exception stack trace in both debug logs. It starts on line 93.

Code:

[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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Ok, so can you please post a callstack of actual exception you get?
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License