FTP Mirror

Am trying to synchronise a remote ftp site to a local directory but am getting some odd errors.
Action sequence is
FTP Connect
FTP Change Directory
FTP List Directory
Create Text File
FTP Mirror

The first three actions work OK, but FTP Mirror fails with “FTP Mirror failed. Permission denied”. Both local and remote directories are accessible using a.n. other FTP tool (Filezilla) so I am reasonably confident that there is no real permissions issue.

If I override the remote directory, I get “FTP Mirror failed. Invalid number of arguments CWD” when executing FTP Connect followed by FTP Mirror, using the same parameter as FTP Change Directory - “/”.

Can you confirm that the FTP Mirror task runs under the permission of the logged-in user when debugging in the IDE.

Thanks.

Hi,

Firstly, which FTP Server are you using? This action was tested against a number FTP servers before release, but the CWD (change working directory) FTP command is not a standardised command so it may be that the server you are using will not accept the command in the format that our FTP library is sending it.

When you are running into these errors, do you see any of the action status messages before seeing the error? This will help me determine where the error is occurring.

The FTP Mirror action (like all the other FTP actions) runs as the user that the IDE is running under.

Regards,
Steve

Hi, thanks for the quick reply.

The server is owned by one of our suppliers. I don’t know anything about it, but this is what Filezilla gets back when logging in:

Command:SYST
Response:215 UNIX
Command:FEAT
Response:211-Extensions supported
Response: SIZE
Response: XMD5
Response: XSHA1
Response: XSHA256
Response: XSHA512
Response: XQUOTA
Response: LANG EN, ES, FR, GE
Response: MDTM
Response: MLST size*;type*;perm*;create*;modify*;
Response: REST STREAM
Response: TVFS
Response: UTF8
Response: AUTH SSL;TLS-P;
Response: PBSZ
Response: PROT C;P;
Response:211 end

Also, CRC checking is not supported.

Is there an alternative command to CWD, as used by FTP Change Directory?

The error occurs just after “Calculating Server Time Skew…”

Hi

Thanks for the additional information. After reading you reply it became immediately clear what the issue was…

When we calculate the server time skew, we upload an empty file to the FTP Server and then compare the time of this file to the local time to determine the difference in time between the server and the client. This works fine except if the user has read only permission. I tested this here and was able to reproduce immediately.

I have added an option on the ‘Overwrite Behaviour’ page of the action that allows you to skip the server time skew check. This will mean that you will be unable to overwrite files based on their date.

Could you please download the following build and let me know if this option helps your cause:
http://www.automise.com/downloads/automise/400/AT400_100.exe

As far as the CWD issue goes, I am still unable to reproduce here. It is strange that you are seeing this, as the Change Directory action uses the exact same function and it obviously works in your case.

Regards,
Steve

Thanks Steve, I’ll give it a go.
Another way of working out the skew, which I used in a previous script, is to pick up the UTC time offset form the registry (HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias) and compensate using that when looking at file times. I believe that FTP servers report time in UTC when using the MDTM command (get file modification time).

Been running the new version for over an hour, not having much luck.
The Automise mirror task opened the ftp site OK, and began transferring some data but appears to be stuck “Generating File List”, using roughly 80% of one CPU core with about 20% kernel time. According to Resource Monitor on Windows Server 2008 R2, it is still holding some TCP and UDP connections to the site but no data is being transferred.

I tried to sto pthe action after 2 hours but had to kill automise in the end as it didn’t stop.

Hi

Can you please enable detailed logging by selecting the FTP Mirror action in the action list and then go to the Property Inspector and then under the ‘Other’ section enable the ‘DetailedLogging’ option and send the output to support so I can have a look at what is happening.

Also, are you able to obtain the details of the FTP Server (OS and FTP Server Software) from your supplier and send that through as well?

The FTP Mirror action is very complex and I tested it with a number of servers before we released this action, as each FTP server implementation seems to vary slightly in behaviour, which I suspect is the case in this instance.

Regards,
Steve

I’ll get you some logging info shortly, but here’s what I got from our supplier:

Its a Windows 2003 Server, Enterprise Edition, Service Pack 2. Its running Ipswitch WS FTP Server Version 7.1.
As a standard, customers are setup with list and read rights.

Hi

Thanks for the information. I downloaded this particular FTP server and I was able to reproduce the error. I am just testing a fix for this at the moment, so I should be able to get you a new build today.

You can hold off on mailing me the log for the time being.

Regards,
Steve

Hi

Here is the new build with the fix for the FTP Mirror action:
http://www.automise.com/downloads/automise/400/AT400_108.exe

Can you please test this and let me know whether this solves your problem?

Regards,
Steve

That seems to work nicely, up to a point. It appears to be impossible to stop the task once it is running as it ignores “stop” or “terminate action” operations.

Pressing “Stop” causes a log entry to indicate “Stop Signalled”, but the task then carries on to download more files.

“Terminate Action” similarly shows “Aborting FTP Operation…” before resuming the downloads!

After 28 mins I had to kill Automise in Task Manager in order to regain control as the download had locked up with no network activity. I am currently trying to find out from our supplier if they put any firewall restrictions on the amount that can be downloaded in order to eliminate that as a possible issue.

Another thought, it would be nice to be able to preserve file dates when synchronising.

The supplier has confirmed that there are no limitations on download, but at the same time said that they have been cleaning out old files so it is possible that some files disappeared whilst the mirror action was under way.

Hi

I released a new official update today, which contains some more improvements to the FTP Mirror action.

Pressing Stop during the execution will now cause the action to stop after the current file has finished uploading/downloading (depending on the operation).

Terminating the action will now do just that.

You can download the build with these fixes (4.0.0.118) from the download page.

Regards,
Steve

Sorry to resurrect this thread after such a long time. I’m starting a new project and decided to revisit the FTP mirror action. Had stopped using it previously as we needed to preserve file date stamps. I’d like to request an option to do this as it would be really useful for some situations, and a lot cleaner than the process I had to come up with.
Thanks.