zhangshenghang opened a new issue, #7863:
URL: https://github.com/apache/seatunnel/issues/7863

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   Configuring connection_mode does not take effect
   ```
   source {
     FtpFile {
       host= "172.16.25.204"
       port= 21
       connection_mode= "passive_local"
       user= "admin"
       password= "admin"
       path= "/123.txt"
       file_format_type= "binary"
       encoding = "UTF-8"
     }
   }
   ```
   Exception:
   
![image](https://github.com/user-attachments/assets/16bd34ce-ddea-4eb5-96df-c42daa2a936f)
   
   Cause of the problem:
   Described in the document: You can set active_local and passive_local, 
   that is: connection_mode = "active_local"
   
![image](https://github.com/user-attachments/assets/cd89ff20-eb33-4970-8a95-756afbbfcf3e)
   
   In `FtpConnectionMode.java` you can see the implementation code:
   
![image](https://github.com/user-attachments/assets/4f6e0d18-0baf-42b1-a01d-f84a2761b647)
   
   But when ConfigUtil parses the mode, it tries to filter by 
ACTIVE_LOCAL_DATA_CONNECTION_MODE = active_local, which is wrong.
   
   
![image](https://github.com/user-attachments/assets/da0b705c-5f75-4e67-8e08-b977e18df1a0)
   
   This will eventually cause the enumeration parsing to fail and return an 
exception.
   
![image](https://github.com/user-attachments/assets/f7935e7c-b3fd-4d3a-8769-7a67bc126fef)
   
   Resolve method:
   The name in the enumeration must be consistent with the logic of the 
ConfigUtil.convertToEnum method
   
   
![image](https://github.com/user-attachments/assets/1b10abd0-a23c-48a6-a01f-a603aadc1fc1)
   
   
   ### SeaTunnel Version
   
   dev
   
   ### SeaTunnel Config
   
   ```conf
   source {
     FtpFile {
       host= "172.16.25.204"
       port= 21
       connection_mode= "passive_local"
       user= "admin"
       password= "admin"
       path= "/123.txt"
       file_format_type= "binary"
       encoding = "UTF-8"
     }
   }
   ```
   ```
   
   
   ### Running Command
   
   ```shell
   run ftp sync
   ```
   
   
   ### Error Exception
   
   ```log
   Refer above
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to