Error: Exception: System.IO.IOException

Advertisement

curvetech
Joined:
Posts:
3

Error: Exception: System.IO.IOException

When I try to open a session i get the following error in my logs

[2012-05-11 13:25:19Z] [0004] Executing Assembly: WinSCP, Version=1.0.0.235, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXXX; Path: D:/XmlProcessorService/bin/WinSCP.DLL; Location: D:\XmlProcessorService\bin\WinSCP.dll; Product: 5.0.6.0
[2012-05-11 13:25:19Z] [0004] Entry Assembly: XMLProcessorService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[2012-05-11 13:25:19Z] [0004] Operating system: Microsoft Windows NT 5.2.3790 Service Pack 1
[2012-05-11 13:25:19Z] [0004] User: _svc_maed@XXXXXXXXXX@XXXXXXXXXX; Interactive: False
[2012-05-11 13:25:19Z] [0004] Runtime: 2.0.50727.1433
[2012-05-11 13:25:19Z] [0004] Console encoding: Input: Western European (Windows) (1252); Output: Western European (Windows) (1252)
[2012-05-11 13:25:19Z] [0004] Session.Open entering
[2012-05-11 13:25:28Z] [0004] Exception: System.IO.IOException: The file exists.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.Path.GetTempFileName()
at WinSCP.Session.Open(SessionOptions sessionOptions)
[2012-05-11 13:25:28Z] [0004] Session.Cleanup entering
[2012-05-11 13:25:28Z] [0004] Session.Cleanup leaving
[2012-05-11 13:25:28Z] [0004] Session.Open leaving
[2012-05-11 13:25:28Z] [0004] Session.Open entering
[2012-05-11 13:25:37Z] [0004] Exception: System.IO.IOException: The file exists.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.Path.GetTempFileName()
at WinSCP.Session.Open(SessionOptions sessionOptions)
[2012-05-11 13:25:37Z] [0004] Session.Cleanup entering
[2012-05-11 13:25:37Z] [0004] Session.Cleanup leaving
[2012-05-11 13:25:37Z] [0004] Session.Open leaving
[2012-05-11 13:25:37Z] [0004] Session.PutFiles entering
[2012-05-11 13:25:37Z] [0004] Session.PutFiles leaving
[2012-05-11 13:25:37Z] [0004] Session.Dispose entering
[2012-05-11 13:25:37Z] [0004] Session.Cleanup entering
[2012-05-11 13:25:37Z] [0004] Session.Cleanup leaving

I've noticed that it is in consistent in that the same code will produce different results depending on the computer is is being run from. On my machine I have no problem establishing a connection to the remote server. When I run my code from my production server I get the above error. Any help would be greatly appreciated.


I am doing this using the SFTP protocol and the Win SCP .Net assembly version 5.0.6.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Error: Exception: System.IO.IOException

5.0.6 failed to remove the temporary files from Temp folder. So you may have run out of temp files sequence number (having 65535 temp files already). Please check your temp folder and upgrade to 5.0.7, which cleans the temp files properly:
https://winscp.net/tracker/849

Reply with quote

curvetech

We have upgraded to 5.0.7 and are still running into this issue. I've looked into the c:\windows\temp folder and I don't see any *.tmp files that need to be cleared out. I'm running this as a windows service and I've checked the permissions that the service is running under and it has read and write permissions to the folder.

Reply with quote

martin
Site Admin
martin avatar

Please check folder where %TEMP% points to. Should be like C:\Users\username\AppData\Local\Temp, but may vary depending on version of Windows.

Reply with quote

Advertisement

gunnerit
Joined:
Posts:
2
Location:
Ha Noi - Viet Nam

Still error

I have upgrade to 5.0.7 and deleted all temp file in %TEMP% .
But it's still error.
Please help me.
Thanks

Reply with quote

Advertisement

You can post new topics in this forum