webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

SFTP:put errors when contentstream is given as input parameter

  • 1.  SFTP:put errors when contentstream is given as input parameter

    Posted Thu August 26, 2021 04:08 PM

    Hi,

    When trying to use the SFTP:put service in my flow service with following input parameters ,
    I am getting an error either access denied or pipe close or directory error .
    Step 1: ERRORS
    inputs are session key, Content stream (converting the EDI data(String) to stream and passing the value),remote file (remote location folder path)
    Step 2: SUCCESS
    inputs are session key , local file (writing my EDI data to local temp folder and using that path ),remote file (remote location folder path)

    Need some advise what is wrong with step 1 .

    Thanks in Advance


    #edi
    #Application-Platform
    #webMethods-io-B2B
    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods-io-Integration
    #webMethods


  • 2.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Thu August 26, 2021 06:31 PM

    Access denied and directory errors seem to be design-time errors, while pipe closed is the runtime one.
    Can you post the actual error messages in full, along with their respective stack traces?

    KM


    #webMethods-io-B2B
    #Application-Platform
    #B2B-Integration
    #webMethods-io-Integration
    #Integration-Server-and-ESB
    #webMethods
    #edi


  • 3.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Thu August 26, 2021 06:38 PM

    Hi @Venkata_Kasi_Viswanath_Mugada1

    I am passing java.io.ByteArrayInputStream in content stream along with session key and remote file (/in/EDI998)

    ERROR: Error while executing command ‘put’: /in/EDI998: Access is denied

    Do you need more details


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods-io-Integration
    #webMethods-io-B2B
    #Application-Platform
    #edi


  • 4.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Thu August 26, 2021 07:16 PM

    If this is a remote folder wherein you’re creating a file directly, the error is straightforward to me. Can you check if the remote server/folder requires additional authorization or has streaming restrictions?

    Your local put followed by a file transfer to the remote folder works, so the issue seems isolated to the remote location and that’s where I’d investigate.

    Having said that, I recommend creating a local file, then transferring that file to the remote location and finally deleting the local copy if the transfer was successful. This helps in handling failure scenarios better in environments that are prone to disruptions, even though the mode parameter provides a resume option.

    KM


    #Application-Platform
    #Integration-Server-and-ESB
    #webMethods
    #webMethods-io-Integration
    #webMethods-io-B2B
    #edi
    #B2B-Integration


  • 5.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Thu August 26, 2021 07:38 PM

    Thank you @Venkata_Kasi_Viswanath_Mugada1 for the quick response.

    when using the step 2 it works fine. no issues only when i use the content stream option it throws access denied .
    I also check on the permission level for each folder with the EDI partner all good.
    yes , I will go with step 2 for now.

    Thank you once again


    #B2B-Integration
    #webMethods-io-Integration
    #edi
    #webMethods
    #webMethods-io-B2B
    #Application-Platform
    #Integration-Server-and-ESB


  • 6.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Fri August 27, 2021 10:16 AM

    Happy to help!

    Option 1 should work, but I haven’t tested it personally - do open a support ticket if you need further assistance. I prefer Option 2 when I design for a problematic environment.

    KM


    #Application-Platform
    #webMethods-io-Integration
    #edi
    #Integration-Server-and-ESB
    #webMethods
    #webMethods-io-B2B
    #B2B-Integration


  • 7.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Mon August 30, 2021 01:41 PM

    Hi, can you please try sending as bytes and also try with explicit setting active or passive mode too.

    HTH,
    RMG


    #edi
    #Integration-Server-and-ESB
    #Application-Platform
    #webMethods-io-Integration
    #webMethods-io-B2B
    #B2B-Integration
    #webMethods


  • 8.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Tue August 31, 2021 06:59 PM

    When using a stream as input to the service, are you specifying a filename or just the folder path? If just the folder path, that is likely why it is failing. Trying to write the stream to the directory itself, not a file. When you specify a file as input, it will use the name of the file as the name of the remote file. From the docs: “If you specify localFile , then remoteFile and contentStream are optional. In this case, the
    remote file will be given the same name as the local file.”

    Make sure the remoteFile string specifies a filename, not just the directory name. The “/in/EDI998” string you mention above looks like a dir name, not a complete filename.


    #Application-Platform
    #webMethods
    #webMethods-io-B2B
    #edi
    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods-io-Integration


  • 9.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Wed September 01, 2021 01:55 PM

    yes good catch item… please try mentioning the remoteFile name aswell - /in/EDI998/%remotefilename%.edi and test it as Rob suggested! :slight_smile:

    Cheers!
    RMG


    #webMethods-io-B2B
    #B2B-Integration
    #webMethods
    #Application-Platform
    #edi
    #Integration-Server-and-ESB
    #webMethods-io-Integration


  • 10.  RE: SFTP:put errors when contentstream is given as input parameter

    Posted Fri September 03, 2021 10:35 AM