MDTM Timestamp Issue with BizTalk 2010 FTP Adapter

Ever received below error in your BizTalk even log when you are trying to receive Files from a FTP server using BizTalk 2010 FTP adapter?

The adapter "FTP" raised an error message. Details "TimeStamp retrieval Failed. Ensure that FTP server supports MDTM command. Server message: "String was not recognized as a valid DateTime."

There can be two reason because of which you can see this error.

  1. Your FTP server OS does not support the MDTM FTP command.
  2. Your FTP server OS does support the MDTM command but the value returned by this command is not supported by BizTalk. (BizTalk only accepts timestamps of following format “YYYYMMddHHmmss”.)

Now the questions would arise: What is this MDTM command and what does it do and where is it used in BizTalk?

Let me explain you what this command does. MDTM is a FTP command which returns the last modified time of the given file. This command is used in FTP adapter of BizTalk when Enable Timestamp Comparison property of your FTP receive location is configured. This helps to re-download the file once again in case it got modified.   

Now back to the main agenda, what needs to be done in case you are seeing above error message in your event log?

First thing to check would be the FTP log which BizTalk creates. You have to check whether you are able to see a return value coming when the MDMT command gets called.

If you are not able to see a return value coming from the MDMT command call, your FTP server OS does not support MDMT command.

 And if you are seeing a value which is not of this format (YYYYMMddHHmmss), return value of the MDMT command is not supported by BizTalk.

How to avoid this error

If you want to use the Enable Timestamp Comparison functionality of BizTalk FTP adapter, you would have to switch to a supported operating system for your FTP server. List of which is provided in the below link: https://support.microsoft.com/kb/841478

You can also disable the Enable Timestamp Comparison functionality of BizTalk FTP adapter in case you don’t want to use it when your FTP server does not support the MDMT command. You can set the Redownload Interval property to let the adapter know whether it has to download the file again.
            -1 indicates that the adapter will not download files again.
            -0 indicates that the adapter will download the file in each polling cycle.

If this property is set to ‘-1’, BizTalk would not run the MDMT command on your FTP server.

 

I hope this helps.

Written By
Yakshit Gohel

Reviewed By
Jainath V R

Microsoft India GTSC