wso2sftpvfs

VFS Transport Sender Warning


I am using a proxy that reads from a csv file, converts into a desired json payloads and writes to two different sftp locations sequentially via a clone. When i execute this operation i get the following warning in the logs for every file that's written.Do i need to change any configurations in the sequence or properties?

Warning log :

WARN {VFSTransportSender} - Could not set last modified. org.apache.commons.vfs2.FileSystemException: Could not set the last modified timestamp of "sftp://sftp4u.---:***@sftp4u.blob.core.windows.net/---/dev/VariantFeedToBloomreach/out/Put/2023-02-14T10-45-02.json".
    at org.apache.commons.vfs2.provider.DefaultFileContent.setLastModifiedTime(DefaultFileContent.java:180)
    at org.apache.synapse.transport.vfs.VFSTransportSender.populateResponseFile(VFSTransportSender.java:366)
    at org.apache.synapse.transport.vfs.VFSTransportSender.writeFile(VFSTransportSender.java:280)
    at org.apache.synapse.transport.vfs.VFSTransportSender.sendMessage(VFSTransportSender.java:189)
    at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
    at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:678)
    at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:86)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:586)
    at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:409)
    at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:77)
    at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:123)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:214)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
    at org.apache.synapse.mediators.eip.Target.mediateMessage(Target.java:256)
    at org.apache.synapse.mediators.eip.Target.mediate(Target.java:111)
    at org.apache.synapse.mediators.eip.splitter.CloneMediator.mediate(CloneMediator.java:136)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
    at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:228)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
    at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFSTransportListener.java:854)
    at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:480)
    at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:189)
    at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:135)
    at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:67)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: 8: UnsupportedOperation: This operation is currently unsupported.
        at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)
        at com.jcraft.jsch.ChannelSftp._setStat(ChannelSftp.java:2418)
        at com.jcraft.jsch.ChannelSftp.setStat(ChannelSftp.java:2392)
        at org.apache.commons.vfs2.provider.sftp.SftpFileObject.flushStat(SftpFileObject.java:201)
        at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doSetLastModifiedTime(SftpFileObject.java:194)
        at org.apache.commons.vfs2.provider.DefaultFileContent.setLastModifiedTime(DefaultFileContent.java:176)
        ... 38 more

Proxy

    <?xml version="1.0" encoding="UTF-8"?>
<proxy name="SampleProxy" startOnLoad="true" transports="http https vfs" xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence>
            <smooks config-key="SmooksConf">
                <input type="text"/>
                <output type="xml"/>
            </smooks>
            <property expression="$body/*" name="Data" scope="default" type="OM"/>
            <clone sequential="true">
                <target>
                    <sequence>
                        <xslt key="sampleXSLT1"/>
                        <property name="messageType" scope="axis2" type="STRING" value="application/json"/>
                        <property name="JSON1" expression="json-eval($)"/>
                         <property name="messageType" scope="axis2" type="STRING" value="application/json"/>
                        <property expression="fn:concat('abc','.json')" name="transport.vfs.ReplyFileName" scope="transport" type="STRING"/>
                        <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
                        <property name="ClientApiNonBlocking" value="true" scope="axis2" action="remove"/>
                        <send>
                            <endpoint>
                                <address uri="vfs:sftp://{sftp_path}/folder?sftpPathFromRoot=true&amp;transport.vfs.AvoidPermissionCheck=true;transport.vfs.Streaming=true;">
                                    <suspendOnFailure>
                                        <initialDuration>-1</initialDuration>
                                        <progressionFactor>-1</progressionFactor>
                                        <maximumDuration>0</maximumDuration>
                                    </suspendOnFailure>
                                    <markForSuspension>
                                        <retriesBeforeSuspension>0</retriesBeforeSuspension>
                                    </markForSuspension>
                                </address>
                            </endpoint>
                        </send>
                    </sequence>
                </target>
                <target>
                    <sequence>
                        <xslt key="sampleXSLT2"/>
                        <property name="messageType" scope="axis2" type="STRING" value="application/json"/>
                        <property name="JSON2" expression="json-eval($)"/>
                        <property name="messageType" scope="axis2" type="STRING" value="application/json"/>
                        <property expression="fn:concat('xyz','.json')" name="transport.vfs.ReplyFileName" scope="transport" type="STRING"/>
                        <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
                        <property name="ClientApiNonBlocking" value="true" scope="axis2" action="remove"/>
                        <send>
                            <endpoint>
                                <address uri="vfs:sftp://{sftp_path}/folder?sftpPathFromRoot=true&amp;transport.vfs.AvoidPermissionCheck=true;transport.vfs.Streaming=true;">
                                    <suspendOnFailure>
                                        <initialDuration>-1</initialDuration>
                                        <progressionFactor>-1</progressionFactor>
                                        <maximumDuration>0</maximumDuration>
                                    </suspendOnFailure>
                                    <markForSuspension>
                                        <retriesBeforeSuspension>0</retriesBeforeSuspension>
                                    </markForSuspension>
                                </address>
                            </endpoint>
                        </send>
                    </sequence>
                </target>
            </clone>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </target>
    <parameter name="transport.vfs.Streaming">true</parameter>
    <parameter name="transport.PollInterval">15</parameter>
    <parameter name="transport.vfs.MaxRetryCount">1</parameter>
    <parameter name="transport.vfs.FileURI">sftp://{sftp_path}/input?sftpPathFromRoot=true&amp;transport.vfs.AvoidPermissionCheck=true</parameter>
    <parameter name="transport.vfs.ContentType">text/plain</parameter>
    <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
    <parameter name="transport.vfs.MoveAfterFailure">sftp://{sftp_path}/error?sftpPathFromRoot=true&amp;transport.vfs.AvoidPermissionCheck=true</parameter>
    <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
    <parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
    <parameter name="transport.vfs.MoveAfterProcess">sftp://{sftp_path}/move?sftpPathFromRoot=true&amp;transport.vfs.AvoidPermissionCheck=true</parameter>
</proxy>

Solution

  • Please try adding this property in the proxy, this works in wso2 ei 6.6.

    <property action="remove" name="LAST_MODIFIED" scope="transport"/>