Post a reply

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

vpuchko

Found the issue, the issue was that winscp .net library version didn't match winscp.exe version, reinstalled from scratch and it worked.
vpuchko

Element "cwd" not found in the log file

Hey,

I've got the same exception when trying to synchronize directories. I was using Syncplify.me Server! server and the following code to sync dirs:
                var sessionOptions = new SessionOptions

                {
                    Protocol = Protocol.Sftp,
                    HostName = _settingsService.GetValue((SFTPSettings s) => s.InboundHost, string.Empty),
                    UserName = _settingsService.GetValue((SFTPSettings s) => s.InboundUsername, string.Empty),
                    Password = _settingsService.GetValue((SFTPSettings s) => s.InboundPassword, string.Empty),
                    SshHostKeyFingerprint = _settingsService.GetValue((SFTPSettings s) => s.InboundSshHostKeyFingerprint, string.Empty)
                };
                SynchronizationResult result;
                using (var session = new Session {ExecutablePath = _winScpPath, DisableVersionCheck = true})
                {                 
                    session.Open(sessionOptions);

                    result = session.SynchronizeDirectories(SynchronizationMode.Local, localFolderPath,
                        folderPath, removeFiles: true);

                    result.Check();
                }


I used standard SFTP server settings and added all required permissions to the user.
martin

Re: Element "cwd" not found in the log file

Can you post the logs using the latest version of WinSCP?
mkozak

Error: {0}WinSCP.SessionLocalException: Element "cwd" not found in the log file
at WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.CustomLogReader.WaitForNonEmptyElementAndCreateLogReader(String localName, LogReadFlags flags)
at WinSCP.Session.Open(SessionOptions sessionOptions)
at F5_Add.Add.WinSCP(String source, String dest) in c:\Users\mkozak\Documents\Visual Studio 2013\Projects\F5 Add\F5 Add\Add.cs:line 1806
AjitKhodke

Can you post a callstack of the extension?
mkozak

Element "cwd" not found in the log file

Trying to upload a file I get this error message on session.Open(sessionOptions);

I've attached the log files.


SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "virt01",
UserName = "root",
Password = "mypassword",
PortNumber = 22,
SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
};


// Connect
session.DebugLogPath = Environment.GetEnvironmentVariable("USERPROFILE") + "\\AppData\\Local\\Commander\\DebugLogPath.txt";
session.SessionLogPath = Environment.GetEnvironmentVariable("USERPROFILE") + "\\AppData\\Local\\Commander\\SessionLogPath.txt";
session.DisableVersionCheck = true;
session.Open(sessionOptions);