title: The %SourceFileName% macro can only be used with the http://schemas.microsoft.com/BizTalk/2006/sftp-properties namespace
body: <p><strong>Overview</strong></p>
  
  <p>I have a custom send port pipeline component that replaces the file name of the file being mapped on the send pipeline with a specific file mask format.  The pipelines code takes the ReceivedFileName property and applies transformation to it.  This process has been working for over a year, but after deploying a new schema and maps resource, the pipeline has ceased to work.  I now get no file created due to the below warnings and errors.  I am hoping that someone may have had a similar experience and could give me insight into this issue.</p>
  
  <p>Notes: The maps and schemas work (new and old) when not using the pipeline. The only change to the maps and schema artifacts were an addition of 2 TypedPolling schemas, 2 FlatFile schemas, and 2 maps.  </p>
  
  <p><strong>Here is the Warning and Error I got using the SFTP adapter</strong></p>
  
  <p>Warning</p>
  
  <blockquote>
    <p>The adapter failed to transmit message going to send port
    "SEND_FileFormat_BSFTP" with URL
    "SFTP://xxx.xxx.xxx.xxx:22/ToPartner/sftp/%SourceFileName%". It will
    be retransmitted after the retry interval specified for this Send
    Port. Details:"An unexpected failure occurred while processing a
    message. The text associated with the exception is
    "[SftpTransmitterEndpoint] Unable to transmit file . Inner Exception:</p>
    
    <p>The %SourceFileName% macro can only be used with the
    <a href="http://schemas.microsoft.com/BizTalk/2006/sftp-properties" rel="nofollow">http://schemas.microsoft.com/BizTalk/2006/sftp-properties</a> namespace. .
    Changing any Send Port Transport properties might require the host to
    be restarted, as the connection pool might still have connections".".</p>
  </blockquote>
  
  <p>Error</p>
  
  <blockquote>
    <p>A message sent to adapter "SFTP" on send port
    "SEND_FileFormat_BSFTP" with URI
    "SFTP://xxx.xxx.xxx.xxx:22/ToPartner/sftp/%SourceFileName%" is
    suspended.   Error details: System.ArgumentException: A property with
    the name
    '<a href="http://schemas.microsoft.com/BizTalk/2003/file-properties#ReceivedFileName" rel="nofollow">http://schemas.microsoft.com/BizTalk/2003/file-properties#ReceivedFileName</a>'
    is not present.</p>
    
    <p>Server stack trace:     at
    System.ServiceModel.Channels.MessageProperties.get_Item(String name)<br>
    at
    Microsoft.BizTalk.Adapter.Sftp.SftpOutputChannel.BuildFileName(Message
    message)    at
    Microsoft.BizTalk.Adapter.Sftp.SftpOutputChannel.Send(Message message,
    TimeSpan timeOut)    at
    System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
    md, Object[] args, Object server, Object[]&amp; outArgs)    at
    System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage
    msg, IMessageSink replySink)</p>
    
    <p>Exception rethrown at [0]:     at
    System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)<br>
    at
    System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult
    result)    at
    System.ServiceModel.Channels.ServiceChannel.EndCall(String action,
    Object[] outs, IAsyncResult result)    at
    System.ServiceModel.Channels.ServiceChannel.EndSend(IAsyncResult
    result)</p>
    
    <p>Exception rethrown at [1]:     at
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
    reqMsg, IMessage retMsg)    at
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;
    msgData, Int32 type)    at
    System.ServiceModel.Channels.IOutputChannel.EndSend(IAsyncResult
    result)    at
    Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendCallback(IAsyncResult
    result)   MessageId:  {055A8864-AB06-4849-ADC3-A5CB93016106} 
    InstanceID: {FF1E3802-89CD-466C-B68E-2CF4EC662DF4}</p>
  </blockquote>
  
  <p><strong>Here is the error I got using the Blogical SFTP adapter</strong></p>
  
  <blockquote>
    <p>Method:
    Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessage
    Error: [SftpTransmitterEndpoint] Unable to transmit file . Inner
    Exception: The %SourceFileName% macro can only be used with the
    <a href="http://schemas.microsoft.com/BizTalk/2006/sftp-properties" rel="nofollow">http://schemas.microsoft.com/BizTalk/2006/sftp-properties</a> namespace. .
    Changing any Send Port Transport properties might require the host to
    be restarted, as the connection pool might still have connections</p>
    
    <p>------------------------------ Information: Type: Blogical.Shared.Adapters.Sftp.SftpException Target:
    Microsoft.BizTalk.Message.Interop.IBaseMessage
    ProcessMessageInternal(Microsoft.BizTalk.Message.Interop.IBaseMessage,
    Blogical.Shared.Adapters.Sftp.ISftp) Message:
    [SftpTransmitterEndpoint] Unable to transmit file . Inner Exception:
    The %SourceFileName% macro can only be used with the
    <a href="http://schemas.microsoft.com/BizTalk/2006/sftp-properties" rel="nofollow">http://schemas.microsoft.com/BizTalk/2006/sftp-properties</a> namespace. .
    Changing any Send Port Transport properties might require the host to
    be restarted, as the connection pool might still have connections
    Stacktrace:    at
    Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessageInternal(IBaseMessage
    message, ISftp sftp)    at
    Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessage(IBaseMessage
    message)</p>
    
    <p>------------------------------ Type: System.Exception Target: System.String
    ReplaceMacros(Microsoft.BizTalk.Message.Interop.IBaseMessage,
    System.String) Message: The %SourceFileName% macro can only be used
    with the <a href="http://schemas.microsoft.com/BizTalk/2006/sftp-properties" rel="nofollow">http://schemas.microsoft.com/BizTalk/2006/sftp-properties</a>
    namespace. Stacktrace:    at
    Blogical.Shared.Adapters.Sftp.SftpTransmitProperties.ReplaceMacros(IBaseMessage
    message, String uri)    at
    Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessageInternal(IBaseMessage
    message, ISftp sftp)</p>
  </blockquote>
  
  <p>I have tried:</p>
  
  <ul>
  <li>Refreshing the pipeline, schema, and map artifacts</li>
  <li>Using %MessageId%, %SourceFileName%, and *.dat as my SFTP filename values</li>
  <li>Stopping the send ports, restarting the host instances</li>
  <li>Stopping everything in the app and restarting all host instances</li>
  <li>Re-gaccing the artifacts</li>
  <li>Using a File adapter instead of SFTP</li>
  </ul>