PutFile error 30023 - WeOnlyDo Discussion board

PutFile error 30023 (wodSFTP / wodSFTP.NET / wodSFTPdll)

by jz1, Thursday, June 29, 2006, 23:04 (6722 days ago)

Sometimes I get an error from PutFile: 30023, Error occurred trying to read from local file. I made sure the file I'm trying to transfer actually exists and that my program has read access to it. What can cause this error? My application is trying to FTP this file to two or three different servers at the same time. Could this be causing the problem? Does the DLL open the file in exclusive read or shared read mode? Thanks.

Joe

Re: PutFile error 30023

by wodDamir, Friday, June 30, 2006, 09:23 (6721 days ago) @ jz1

Hi Joe,

I just tried doing this by using 2 instances, and it worked like a charm. Can you give me some more specific instructions on how i can duplicate this?

Regards,
Damir

Re: PutFile error 30023

by jz1, Friday, June 30, 2006, 20:35 (6721 days ago) @ wodDamir

I've tried a few more things and here is what I know. It looks like a timing issue with the Progress event. I am transferring files in non-blocking mode and I'm using the COM event sink model. My event sink is based on your sample code in SamplesVCATLConsoleAppConsoleApp.cpp. I'm using Visual Studio .Net 2003 C++.

The parameters passed to the last Progress event shows that all bytes have been transferred, but then the Done event is fired with error code 30023. The file does actually show up on the FTP server correctly. I found two work-arounds. The first is to Sleep for a short time in the Progress event handler. This is what makes me think it is a timing issue. The second is to check the number of bytes transferred in the Progress event and if they are the same as the total number of bytes, ignore the error passed to the Done event.

The error code is not consistently generated. It seems to happen more frequently with older or heavily-loaded IIS 5.1 machines. It rarely happens when sending to a Debian Linux ProFTPD 1.3.0 machine.

I hope this helps.

Joe

Re: PutFile error 30023

by wodSupport, Friday, June 30, 2006, 21:04 (6721 days ago) @ jz1

If you use nonblocking mode in console sample, do you have some sort of message pump? If component works in async mode - does your code end too soon perhaps while wodFtpDLX.NET can't do anything in the background?

Kreso

Re: PutFile error 30023

by jz1, Friday, June 30, 2006, 21:17 (6721 days ago) @ wodSupport

Does my code need a message pump? If so, where should I put it? Everything else works ok without one.

The code runs indefinitely. It never exits unless it is specifically shut down.

I don't know if it matters, but in your last post, you mentioned wodFtpDLX.Net. I don't think I'm using that one. The product description I'm using is wodFtpDLX ActiveX Component and I'm using the .dll version.

Joe

Re: PutFile error 30023

by wodSupport, Friday, June 30, 2006, 21:30 (6721 days ago) @ jz1

Ok, it's same for wodFtpDLX ActiveX.

You can't run indefenetely. Remember wodFtpDLX is apartment threaded - it lives in same thread as your app. It needs some timeslice to do it's async work - so you can't Sleep the thread, or exit it.. You must have GetMessage..TranslateMessage..DispatchMessage pump - or you MUST use blocking mode.

Why don't you use blocking mode anyway? You can still use events, just don't call any our methods from within events.

Kreso

Re: PutFile error 30023

by jz1, Friday, June 30, 2006, 22:38 (6721 days ago) @ wodSupport

Does it use the single-threaded or multi-threaded apartment model?

I am using non-blocking calls because the Connect call would sometimes block forever, even when I set the timeout. With non-blocking calls, I can set up a timer and call Abort if the Connect is taking too long.

Joe

Re: PutFile error 30023

by wodSupport, Saturday, July 01, 2006, 00:17 (6721 days ago) @ jz1

That shouldn't be happening - if it does (I doubt, but it's always possible) then it is a bug.

How can I duplicate this? Can you send your code to techsupport so we can try it out?

Kreso

Re: PutFile error 30023

by jz1, Saturday, July 01, 2006, 00:26 (6721 days ago) @ wodSupport

The application is huge, involving databases, UIs, other processes, etc. It would take a lot of effort to extract the FTP code and turn it into something you could use without all the other components.

Perhaps it is related to the threading model. Is the COM comonent a single-threaded apartment or a multi-threaded apartment?

Joe

Re: PutFile error 30023

by wodSupport, Saturday, July 01, 2006, 00:32 (6721 days ago) @ jz1

It's single threaded. You must use it from the thread you initialize it.

Kreso

Re: PutFile error 30023

by jz1, Saturday, July 01, 2006, 00:35 (6721 days ago) @ wodSupport

That might be the problem. I was assuming it was multi-threaded. I'll change my code to conform to single-threading rules and see if that makes a difference. Thanks for the help.

Joe

Re: PutFile error 30023

by Gaurang Singh, Thursday, December 04, 2008, 19:52 (5833 days ago) @ jz1

I am getting the following error while trying to use wodsftp client with winsshd4.0 server . I have created windows user and given user full control permissions for both the folders.

Error occured trying to open local file.

My code is as follows :-

dim Sftp
set Sftp = Server.CreateObject( WeOnlyDo.wodSFTPCom.1 )
Sftp.Blocking = 1
Sftp.Hostname = itseelm-dn0132
Sftp.Login = testftp
Sftp.Password = testftp

Sftp.Connect
Sftp.GetFile CStr( C:/tmp ), CStr( /C:/testfolder/testfile.txt )
Sftp.Disconnect

Re: PutFile error 30023

by woddrazen, Thursday, December 04, 2008, 20:06 (5833 days ago) @ Gaurang Singh

Hi Gaurang,


What happened when you change your GetFile line to this:
[code]Sftp.GetFile CStr( C:\tmp\testfile.txt ), CStr( /C:/testfolder/testfile.txt ) [/code]
Let us know how it goes.


Regards,
Drazen