Customer Portal

Geeting error while writing csv file to FTP server

Comments 3

  • Avatar
    Lukas Cholasta
    0
    Comment actions Permalink
    Hi jagan,

    This issue may be caused by several reasons.

      1. The port is not opened.
      2. There is a user limit set on the FTP server.
      3. You are using SFTP protocol instead of plain FTP.
      4. There is a firewall on the FTP server or on your machine that is blocking the communication.


    Please try the following.

      1. Make sure you are using the correct port number.
      2. Check whether you are using SFTP protocol to connect to a SFTP server.
      3. Try saving the file on a different FTP server (via Designer).
      4. Check the settings of the FTP server (user limit, etc.).
      5. Temporarily turn off the firewall(s).


    Please let me know about the outcome.

    Best regards,
  • Avatar
    jagan
    0
    Comment actions Permalink
    Hi Lukas Cholasta,


    Please find my below comments,

    1. Make sure you are using the correct port number. -- I am using below URL to write the files and port is 22 but without port I am able to connect to server to select the files to read from Clover ETL.

    sftp://${SFTPUserName}:${SFTPPassword}@${SFTPHost}/${SFTPOutputFile}

    2. Check whether you are using SFTP protocol to connect to a SFTP server.-- Yes, I am using SFTP protocol while connecting through Winscp.
    3. Try saving the file on a different FTP server (via Designer).-- Yes it is working with other SFTP servers.
    4. Check the settings of the FTP server (user limit, etc.). -- I am not sure about this, I am not a administrator to change the setting.
    5. Temporarily turn off the firewall(s). -- I am not a administrator turn off firewall.

    I would like to describe about the issue.

    > I am able to connect to SFTP server from ETL and select the files remotely and able to read files without any issues.
    > I am facing issue when I am writing the file to SFTP server through ETL.
    > using other tool(Winscp): I got the same kind of exception when i am writing the files to winscp. Please find the Winscp Exception.png for the exception.
    > I did some analysis and finally I resolve the issue from Winscp by unchecked Preserve timestamp option. for more details please find the Winscp Setting.png.
    > Now i am able to move the file to Winscp maually without any exception after I uncheck the Preserve timestamp option.

    Similarly, Is there any option to handle this kind of exceptions in Clover ETL?

    Please help me on this.

    Thanks,
    Jagan.
  • Avatar
    Lukas Cholasta
    0
    Comment actions Permalink
    Hi,

    I've consulted your issue with our developers and it is most probably in settings of the FTP server itself. The FlatFileWriter (or UniversalDataWriter) is using just a bare implementation of the java.net.URLConnection class to save the file to the FTP server. Also, while you're creating the file and not copying it (and preserving it's modification date), these issues seems to be unrelated. I've attached a simple console Java application that uploads a file with "Hello world!" content to a FTP server. Please try to upload a file to that FTP server with it. If this successes, we can start looking for an issue in our code.

    I'd like to let you know that it's perfectly safe to run this app. Following is its code.
    package core;

    import java.io.OutputStream;
    import java.net.URL;
    import java.net.URLConnection;

    public class FTPWriter {

    public static void main(String[] args) throws Exception {
    if (args.length == 0) {
    System.out.println("usage: java -jar FTPWriter ftp://user:password@hostname:port/path/to/file.txt");
    return;
    }

    URL url = new URL(args[0]);
    URLConnection connection = url.openConnection();
    connection.setDoInput(false);
    connection.setDoOutput(true);

    try (OutputStream os = connection.getOutputStream()) {
    os.write("Hello world!".getBytes());
    }
    }
    }


    Thanks & regards,

Please sign in to leave a comment.