Purpose
The purpose of this page is to give a brief description of signaling of FTP sender adapter when using connect mode permanently. Also it gives some example, about how the FTP adapter sender adapter behaviors when FTP server gives 421 520 error.
Overview
Some of the times, when using FTP sender adapter with connect mode permanently, it can be found many 421 and 520 error in default trace. Generally speaking, such errors will not give critical effect to the scenario, which PI choose to ignore it and doesn't give an alert. But still, it is not sign for these errors keep showing in the system. To know how these errors occur, why they have no effect to PI and how to avoid them. The signaling should first be known.
Access for first time
Please check below figure, it give the sequence of FTP protocol after TCP connection is established.
- From "220 Microsoft FTP Service" to "200 Type set to I" are about authentication and connection. This part is configured in "FTP connection parameters" of FTP sender channel in Integration Builder.
- FTP sender adapter uses CWD to access to the target folder and 250 to confirm. This part is configured in "Source Directory".
- FTP sender adapter uses PASV which is passive mode. This part is configured in “Data Connection”.
- FTP response " 227 Entering Passing Mode" include IP and port to transfer file.
- FTP sender adapter uses LIST command to get list of target file. This part is configured in "File Name".
- FTP server start to transfer file and complete, which code is 125 and 226.
- In this log, FTP sender adapter repeated step 2-6, it is no need to do this again, but one may find it make sense when the logic described below is known.
- After receiving the list, FTP sender adapter will judge whether there is file need to be polled.
- If there is, it requires connection for file to be transferred. This is the same as step 3-4.
- FTP sender adapter polls the file using RETR command.
- FTP server start to transfer file and complete, which code is 125 and 226.
Above describes the whole sequence of the first time access. To know the connection mode permanently well, the access for following time are also needed to be know.
Please note at this time, the TCP connection is still established.
Access for following time
Please check below figure, it starts at 226 transfer complete of last time.
- When it is time for next poll, FTP sender adapter check whether the connection for FTP layer is alive or not, using command NOOP.
- If 200 is received, FTP sender adapter repeat step 7-11 in "Access for first time".
- FTP sender adapter will repeat these steps and the benefit of this is no need to do authentication or TCP connection again. It increases the efficiency.
By far, only normal behavior is described. Due to some reason, FTP server will not always give correct response when receiving request.
Below one example is given how FTP sender adapter handles unexpected error.
Error 421 and 520 of FTP
Some of the time, below error will be displayed in default trace.
421 Unexpected reply codeTimeout
520 Unexpected reply codeControl connection prematurely closed by server
Even PI ignored these error as they do not affect the function of FTP. But it is still error, it bothers us and we may wonder about this.
So how FTP sender adapter handles unexpected error is given to show there is no need to worry about these type of error.
Please be noted the error code 421 and 520 are all receiving from FTP server, if the root cause is needed, please ask the FTP server team.
- The first step is same as step 1 of "Access for following time", NOOP is sent to FTP server.
- When 421 code is received from FTP server, FTP sender adapter realize the connection is no longer available.
3. Then FTP sender adapter sends "QUIT" to leave this connection.
4. FTP server replies 520 code. This time it tells the connection is already closed before "QUIT" is received.
The purpose of "QUIT" is to let the server to close the connection. And now knowing the connection is already closed, the result is the same for FTP sender adapter.
Then FTP sender adapter will reestablish the connection and process the transfer as "Access for first time".
Related Content
Related Documents
FTP transfer protocol: https://www.ietf.org/rfc/rfc959.txt
Related SAP Notes/KBAs
____________