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.

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)


Topic review


I've been getting the same error and I think it's because the specified LogMaxSize limit has been reached, the file isn't in use anywhere else - I was expecting it to rollover to a new log file but this isn't happening.

$session.SessionLogPath = "C:\scripts\logs\logfile.log"
$session.AddRawConfiguration("Logging\LogMaxSize", "1000000")
$session.AddRawConfiguration("Logging\LogMaxCount", "20")

If I try to run the script again, it returns "Error: You cannot call a method on a null-valued expression".

I tried renaming the log file so a new one would be created but it was locked in use - I closed the powershell window which I was using to run the script and was then able to rename the log file.

I opened a new PS session, ran the same script and a new log was created. I deleted this (not locked) and renamed the original back, ran the script again and, sure enough, this time it rolled over to produce a new log with a '.1' suffix.

Not sure what happened the first time, looks like it didn't rollover properly and didn't exit properly either.

Reproduce the problem?

Not yet, but I'll try. One note I forgot in my first post was that while WinSCP was in the error loop (possibly one dialog per log line??), I deleted the existing log files from the directory - no issues with file locks. The error in WinSCP persisted after the files were deleted. I'll turn logging back on and see what happens.


Re: WinSCP locked up in endless log file error dialog loop

Thanks for your report. Can you reproduce the problem?

WinSCP locked up in endless log file error dialog loop

WinSCP 5.13 (build 8172), Win XP Pro 64 SP 1

I turned on logging a few WinSCP sessions ago, and all was fine. Then this morning during file transfer from remote linux server, "Error occurred during logging. It's been turned off.", "System Error. Code: 32. The process cannot access the file because it is being used by another process." I did not have the log file open, nor had I recently.

This dialog could be dismissed but it would pop up again immediately. I tried dismissing it several times, including holding down the ENTER key for a bit to dismiss it probably neart to a hundred times, and gave up. Eventually killed WinSCP with Process Explorer.