Gateway Script unable to upload file to FTP server

Hi
I need some direction to identify the issue.
Ignition Version 8.1.14 and OS windows server 2019
I am working with a script which is querying the data from tag history and create xml file and connect to FTP server and upload the file onto it and send me email with file attached.
This script is on the button and same script is on gateway script configured under schedule.

Behavior: When script executed with press of button from client. It upload the file to FTP server and send me file at attachment in email.
When same script is executed with gateway schedule. it creates file not uploading the file onto FTP sever and email me the file as attachment in email.

I can’t see anything unusual under wrapper log or gateway script schedule logs.
I am not sure why gateway script unable to connect to FTP server or unable to upload the file.

I have already configured the ignition service with admin logon as well.

Try opening a cmd prompt on the gateway and connecting to the ftp server.
image

image

FTP login works and it is able to connect to the server.

Forgot to mention above that gateway and client run on same machine. File upload work when client push button is pressed but doesn’t work when executed by gateway script.

Doing more diagnostic on gateway script. I found the file path is not coming up correctly.
It is coming up with two back slashes for each folder . Where as when executed from client it is correct with one back slash…
i am currently using command open(os.path.realpath(FTPfilepath), ‘rb’)

Issue is resolved. It was myself not paying attention to the scripting syntaxes…
thanks Josborn . i learn other way to check the FTP connection using command prompt.
thanks again everyone.

1 Like