Issues with SFTP Get Files command
- Posts: 8
- Joined: Tue Dec 06, 2016 2:33 pm
I created a project that connects via SFTP and grabs a file to place it somewhere on our server. However, according to the debug I posted below, it looks like the connection closes after it attempts to get the file. I am at a lost as the only thing I am told by this debug is ERROR bad message and "Routing the control to the module 'failed'.
Dec 20, 2016 10:33:30 AM INFO ******************** Debug Mode ********************
Dec 20, 2016 10:33:30 AM INFO Executing project 'FTP Rec'
Dec 20, 2016 10:33:30 AM INFO Project location: C:\Program Files\Linoma Software\GoAnywhere\userdata\projects\awright\FTP Rec.xml
Dec 20, 2016 10:33:30 AM INFO Executing module 'Main'
Dec 20, 2016 10:33:33 AM INFO Executing task 'sftp 1.0 (####)'
Dec 20, 2016 10:33:33 AM INFO Connecting to '####' at port '####' as user '####'
Dec 20, 2016 10:33:35 AM INFO Executing sub-task 'get'
Dec 20, 2016 10:33:35 AM INFO Closed the FTP connection
Dec 20, 2016 10:33:35 AM INFO Closed the FTP connection
Dec 20, 2016 10:33:35 AM ERROR Bad message
Dec 20, 2016 10:33:35 AM INFO Routing the control to the module 'Failed'
- Support Specialist
- Posts: 592
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
You can email this to our Support@Linoma.com or post it here.
We need to see this to give a full recommendation as to what's happening.
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
- Posts: 8
- Joined: Tue Dec 06, 2016 2:33 pm
<project name="FTP Rec" mainModule="Main" version="2.0" logLevel="verbose">
<module name="Main">
<sftp label="Harcros" resourceId="####" host="####" port="####" user="####" password="####" timeout="30" connectionRetryAttempts="1" connectionRetryInterval="5" version="1.0" onError="call:Failed">
<get destinationDir="folderX" whenFileExists="rename">
<fileset dir="folderY" recursive="false">
<wildcardFilter>
<include pattern="*.*.*" caseSensitive="true" />
</wildcardFilter>
</fileset>
</get>
</sftp>
<exitProject version="1.0" />
</module>
- Support Specialist
- Posts: 592
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
<sftp label="Harcros" resourceId="####" version="1.0" onError="call:Failed">
Also, when retrieving all files from a folder, you can just designate the FileSet Folder without any filters. It should look like this:
<get destinationDir="folderX" whenFileExists="rename">
<fileset dir="folderY" recursive="false"/>
</get>
Try those changes and see what happens.
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
- Posts: 8
- Joined: Tue Dec 06, 2016 2:33 pm
I tried what you suggested and got the same error message as before, it attempts to execute sub-task 'get' and then the ftp connection closes with a Bad message Error. "Routing the control to the module 'failed'". Here is the revised script.
<project name="FTP Rec" mainModule="Main" version="2.0" logLevel="verbose">
<module name="Main">
<sftp label="Harcros" resourceId="####" host="####" port="####" user="####" password="####" timeout="30" connectionRetryAttempts="1" connectionRetryInterval="5" version="1.0" onError="call:Failed">
<get destinationDir="folderX" whenFileExists="rename">
<fileset dir="folderY" recursive="false"/>
</get>
</sftp>
<exitProject version="1.0" />
</module>
- Support Specialist
- Posts: 592
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
This way I can review it...
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
- Posts: 8
- Joined: Tue Dec 06, 2016 2:33 pm
<project name="Harcros FTP Rec" mainModule="Main" version="2.0" logLevel="verbose">
<module name="Main">
<sftp label="Harcros" resourceId="Harcros Sunset" host="#####" port="#####" user="#####" password="#####" timeout="30" connectionRetryAttempts="1" connectionRetryInterval="5" version="1.0" onError="call:Failed">
<get destinationDir="FolderX" whenFileExists="rename">
<fileset dir="FolderY" recursive="false" />
</get>
</sftp>
<exitProject version="1.0" />
</module>
<module name="Failed" disabled="true">
<sendEmail resourceId="Delek Mail" toList="####" version="2.0">
<from address="GoAnywhere@goemail.com" />
<subject>
<![CDATA[Harcros FTP Rec Failed]]>
</subject>
<message>
<![CDATA[Did not receive acknowledgement. Check to see if a 210 was sent . If there is not one, contact Harcros and make sure they receive interchange.]]>
</message>
</sendEmail>
<exitProject version="1.0" />
</module>
</project>
Jan 6, 2017 9:39:37 AM INFO Start Date and Time: 1/6/17 9:39:37 AM
Jan 6, 2017 9:39:37 AM INFO Job Number: 1000000000295
Jan 6, 2017 9:39:37 AM INFO Project Name: /jwright/Harcros FTP Rec
Jan 6, 2017 9:39:37 AM INFO Submitted By: jwright
Jan 6, 2017 9:39:37 AM INFO Submitted From: Administrator UI
Jan 6, 2017 9:39:37 AM INFO GoAnywhere 5.3.4 running on Windows Server 2012 6.2 (amd64)
Jan 6, 2017 9:39:38 AM INFO ******************** Debug Mode ********************
Jan 6, 2017 9:39:38 AM INFO Executing project 'Harcros FTP Rec'
Jan 6, 2017 9:39:38 AM INFO Project location: C:\Program Files\Linoma Software\GoAnywhere\userdata\projects\jwright\Harcros FTP Rec.xml
Jan 6, 2017 9:39:38 AM INFO Executing module 'Main'
Jan 6, 2017 9:39:50 AM INFO Executing task 'sftp 1.0 (Harcros)'
Jan 6, 2017 9:39:50 AM INFO Connecting to '####' at port '####' as user '####'
Jan 6, 2017 9:39:51 AM INFO Executing sub-task 'get'
Jan 6, 2017 9:39:51 AM INFO Closed the FTP connection
Jan 6, 2017 9:39:51 AM ERROR Bad message
Jan 6, 2017 9:39:51 AM INFO Routing the control to the module 'Failed'
Jan 6, 2017 9:39:51 AM INFO Executing task 'sendEmail 2.0'
Jan 6, 2017 9:39:51 AM INFO Connecting to mail server: ####
Jan 6, 2017 9:39:51 AM INFO Opened the connection
Jan 6, 2017 9:39:51 AM INFO Message is delivered successfully
Jan 6, 2017 9:39:51 AM INFO Message 'Harcros FTP Rec Failed' was sent to 1 recipient(s)
Jan 6, 2017 9:39:51 AM INFO The message has been delivered to the following 1 addresses:
J####
Jan 6, 2017 9:39:51 AM INFO Closed the connection
Jan 6, 2017 9:39:51 AM INFO Finished task 'sendEmail 2.0'
Jan 6, 2017 9:39:51 AM INFO Executing task 'exitProject 1.0'
Jan 6, 2017 9:39:51 AM INFO Exiting project 'Harcros FTP Rec'
Jan 6, 2017 9:39:51 AM INFO Finished task 'exitProject 1.0'
Jan 6, 2017 9:39:51 AM INFO Finished project 'Harcros FTP Rec'
Jan 6, 2017 9:39:51 AM INFO End Date and Time: 1/6/17 9:39:51 AM
- Posts: 8
- Joined: Tue Dec 06, 2016 2:33 pm
I managed to figure out what the problem was. It turned out to be a permissions issue on the server I was connecting to. Once I got that taken care of it worked without any further issue. A note to anyone reading this. It may not say anything in the GoAnywhere logs, but make sure you triple check permissions.
-Artis