News:

  • February 11, 2025, 12:11:38 AM

Login with username, password and session length

Author Topic: FTPGET doesn't request file?  (Read 210 times)

TheGreatMarklar

  • Jr. Member
  • **
  • Posts: 18
    • Rix Industries
FTPGET doesn't request file?
« on: January 13, 2025, 12:20:04 PM »
This is a new thread on an ongoing issue. After running for several days, the FTPGET instruction times out until the PLC is power-cycled. I recorded the attached log with DM Logger. It looks to me like the PLC connects to the server without issue, then never sends the command to request the file. Is that what's happening? If so, how do I fix it?

From DMLogger:

10.20.60.21 Port 29298(0x7272),01/09/25 09:50:53.522 ,"TCP connection failed or was unexpectedly closed in FTPGET @000011EC"
10.20.60.21 Port 29298(0x7272),01/09/25 09:50:53.521 ,"Server connection lost. Shutting down..."
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.300 ,"200 PORT command successful."
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.231 ,"PORT 10,20,60,21,4,75.."
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.230 ,"250 CWD command successful"
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.230 ,"CWD /Raw_Data/2P.."
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.229 ,"230 Login successful."
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.147 ,"PASS [redacted]"
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.145 ,"331 Please, specify the password."
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.071 ,"USER [redacted]"
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.070 ,"220 Please visit https://filezilla-projectDOTorg/"
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.070 ,"220-FileZilla Server 1.9.4"
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.069 ,"FTP connected!"
10.20.60.21 Port 29298(0x7272),01/09/25 09:40:39.067 ,"Connecting to FTP server..."

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 694
  • Hmmm...
    • Host Engineering, Inc.
Re: FTPGET doesn't request file?
« Reply #1 on: January 13, 2025, 03:50:58 PM »
I've always tested FTPGET using the passive (PASV) mode. Instead, it appears yours is specifying this (the PORT) command. Shockingly, there is a 10-minute(!) delay after this when the connection is lost. It does appear that the retrieve (RETR) command is not issued. But, is the FTP server happy about the PORT really? The connection is a TCP-level issue. Was there a network timeout or disruption? Did the server terminate the connection (instead of the BRX)?

Have you tried it in passive (PASV) mode? To use that, you have to edit your FTP Client Device settings in Do-more Designer, and check the "Use PASV Mode" in the Other Settings box.

I tested mine not in the PASV mode with the following results from DMLogger. The green is the portion that yours doesn't seem to get to:

10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.028 ,"FTP disconnected!"
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.028 ,"Disconnecting FTP..."
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.028 ,"QUIT.."
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.027 ,"FTP data port disconnected!"
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.027 ,"Disconnecting FTP data port..."
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.026 ,"226 Successfully transferred "/RemoteDir/Contacts - Copy.txt""
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.026 ,"150 Opening data channel for file download from server of "/RemoteDir/Contacts - Copy.txt""
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.025 ,"FTP data port connected!"
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.024 ,"Connecting FTP data port..."
10.0.0.149  Port 29298(0x7272),01/13/25 15:44:00.023 ,"RETR Contacts - Copy.txt.."
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.953 ,"200 Port command successful"
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.953 ,"PORT 10,0,0,149,4,8.."
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.952 ,"250 CWD successful. "/RemoteDir" is current directory."
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.952 ,"CWD /RemoteDir.."
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.951 ,"230 Logged on"
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.951 ,"PASS [redacted].."
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.951 ,"331 Password required for greg"
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.950 ,"USER [redacted].."
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.950 ,"220 Please visit https://filezilla-project.org/"
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.950 ,"220-written by Tim Kosse (tim.kosse@filezilla-project.org)"
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.949 ,"220-FileZilla Server 0.9.60 beta"
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.948 ,"FTP connected!"
10.0.0.149  Port 29298(0x7272),01/13/25 15:43:59.945 ,"Connecting to FTP server..."
There are two types of people in the world; those that can extrapolate from incomplete data sets.

TheGreatMarklar

  • Jr. Member
  • **
  • Posts: 18
    • Rix Industries
Re: FTPGET doesn't request file?
« Reply #2 on: January 14, 2025, 10:58:28 AM »
It does work, most of the time. Then it stops working, with no apparent cause, and only a reboot of the PLC fixes it.

PASV mode is not supported by my server implementation, but here's an example where active mode works. Red text is a failed download in PASV. Blue text is a hang in PASV. I reconfigured for active, and the green text shows a success.

10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.337 ,"FTP disconnected!"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.335 ,"Disconnecting FTP..."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.334 ,"QUIT.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.333 ,"FTP data port disconnected!"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.332 ,"Disconnecting FTP data port..."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.331 ,"226 Operation successful"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.255 ,"150 Starting data transfer."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.254 ,"FTP data port connected!"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.253 ,"Connecting FTP data port..."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.252 ,"RETR Data_S3_Record_250114.txt.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.171 ,"200 PORT command successful."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.094 ,"PORT 10,20,60,21,4,11.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.093 ,"250 CWD command successful"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.090 ,"CWD /Raw_Data/2P.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.089 ,"230 Login successful."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.029 ,"PASS [redacted]"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.023 ,"331 Please, specify the password."
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.022 ,"USER [redacted]"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.021 ,"220 Please visit https://filezilla-project.org/"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:35.020 ,"220-FileZilla Server 1.9.4"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:34.944 ,"FTP connected!"
10.20.60.21  Port 29298(0x7272),01/14/25 07:51:34.941 ,"Connecting to FTP server..."


10.20.60.21  Port 29298(0x7272),01/14/25 07:25:57.060 ,"227 Entering Passive Mode (10,10,20,22,94,191)"
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:57.059 ,"PASV.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:57.059 ,"250 CWD command successful"
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:57.058 ,"CWD /Raw_Data/2P.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:57.057 ,"230 Login successful."
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:56.979 ,"PASS [redacted]"
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:56.979 ,"331 Please, specify the password."
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:56.907 ,"USER [redacted]"
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:56.907 ,"220 Please visit https://filezilla-project.org/"
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:56.906 ,"220-FileZilla Server 1.9.4"
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:56.906 ,"FTP connected!"
10.20.60.21  Port 29298(0x7272),01/14/25 07:25:56.901 ,"Connecting to FTP server..."


10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.201 ,"Received error from FTP server in FTPGET @000011FA"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.200 ,"Disconnecting FTP..."
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.199 ,"550 Couldn't open the file"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.120 ,"FTP data port connected!"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.120 ,"Connecting FTP data port..."
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.120 ,"RETR Data_S3_Record_250114.txt.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.029 ,"227 Entering Passive Mode (10,10,20,22,94,196)"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.029 ,"PASV.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.029 ,"250 CWD command successful"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.028 ,"CWD /Raw_Data/2P.."
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:52.028 ,"230 Login successful."
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:51.951 ,"PASS [redacted]"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:51.951 ,"331 Please, specify the password."
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:51.951 ,"USER [redacted]"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:51.950 ,"220 Please visit https://filezilla-project.org/"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:51.950 ,"220-FileZilla Server 1.9.4"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:51.860 ,"FTP connected!"
10.20.60.21  Port 29298(0x7272),01/14/25 07:24:51.859 ,"Connecting to FTP server..."

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 694
  • Hmmm...
    • Host Engineering, Inc.
Re: FTPGET doesn't request file?
« Reply #3 on: January 14, 2025, 11:24:06 AM »
Is it possible to get a Wireshark trace showing the exchange between the FTP server and the BRX PLC? You might could run Wireshark on the FTP Server. But I'd be more curious to know what is happening coming out of the Ethernet port on the BRX. This might require an Ethernet switch with port mirroring capability.

Is that possible? If so, please save a good and a failed one and email them to me: support at hosteng dot com.
« Last Edit: January 14, 2025, 01:54:45 PM by franji1 »
There are two types of people in the world; those that can extrapolate from incomplete data sets.

TheGreatMarklar

  • Jr. Member
  • **
  • Posts: 18
    • Rix Industries
Re: FTPGET doesn't request file?
« Reply #4 on: January 14, 2025, 02:23:05 PM »
I'll see what I can do. Need to coordinate that with IT.

TheGreatMarklar

  • Jr. Member
  • **
  • Posts: 18
    • Rix Industries
Re: FTPGET doesn't request file?
« Reply #5 on: February 04, 2025, 04:15:28 PM »
Is it possible to get a Wireshark trace showing the exchange between the FTP server and the BRX PLC? You might could run Wireshark on the FTP Server. But I'd be more curious to know what is happening coming out of the Ethernet port on the BRX. This might require an Ethernet switch with port mirroring capability.

Is that possible? If so, please save a good and a failed one and email them to me: support at hosteng dot com.

Just sent the traces.