seatunnel icon indicating copy to clipboard operation
seatunnel copied to clipboard

[Bug] [Connector-V2][FTP] FTP connector connection_mode is not effective

Open zhangshenghang opened this issue 4 months ago • 0 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

Configuring connection_mode does not take effect

source {
  FtpFile {
    host= "ip"
    port= 21
    connection_mode= "passive_local"
    user= "admin"
    password= "admin"
    path= "/123.txt"
    file_format_type= "binary"
    encoding = "UTF-8"
  }
}

Exception: image

Cause of the problem: Described in the document: You can set active_local and passive_local, that is: connection_mode = "active_local" image

In FtpConnectionMode.java you can see the implementation code: image

But when ConfigUtil parses the mode, it tries to filter by ACTIVE_LOCAL_DATA_CONNECTION_MODE = active_local, which is wrong.

image

This will eventually cause the enumeration parsing to fail and return an exception. image

Resolve method: The name in the enumeration must be consistent with the logic of the ConfigUtil.convertToEnum method

image

SeaTunnel Version

dev

SeaTunnel Config

source {
  FtpFile {
    host= "ip"
    port= 21
    connection_mode= "passive_local"
    user= "admin"
    password= "admin"
    path= "/123.txt"
    file_format_type= "binary"
    encoding = "UTF-8"
  }
}

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

zhangshenghang avatar Oct 16 '24 12:10 zhangshenghang