SuiteScript - Troubleshoot SFTP Connections and Errors

Written by
Manuelito Macalinao
Published on
October 31, 2023 at 1:34:48 AM PDT October 31, 2023 at 1:34:48 AM PDTst, October 31, 2023 at 1:34:48 AM PDT

Scenario

When using the N/sftpSuiteScript 2.0Module in NetSuite, problems may be encountered during the development of Script that will use it. Therefore, is highly recommended to verify all the necessary settings and possible limitations when using this Module. Below are some considerations that need to be taken with the N/sftp Module. These are good practices which we strongly recommend to be taken when using this Module.

Solution

  • The communication protocol which is attempting to use to connect to the server. At this time,SuiteScriptsupports only SFTP for file transfers with the N/SFTP module
  • The SSH host key on the server. The host key must be supplied in each connection request. If the host key on the server has changed, it needs to be updated manually, asSuiteScriptdoes not have an API to retrieve the host key
  • The used cipher suite. At this time,SuiteScriptsupports only the following cipher suites: AES256-CTR, AES192-CTR, AES128-CTR
  • The server's IP address requirements. Does the server require a static IP address that can be whitelisted in a firewall? NetSuite accounts do not have static IP addresses
  • The file which should be transferred. Is the file encrypted? At this time,SuiteScriptonly supports AES decryption
  • The name of the file which should be transferred.SuiteScriptrequires that the file's exact directory and filename is known and used in your scripts
  • The port on which the SFTP server is running. Make sure the correct port number is used in the scripts. Try to connect to this port using Telnet. If the connection to the port is not successful,SuiteScriptprobably can't connect either
  • The firewall rules on user's network. Connections could be blocked due to the rules on network firewall

For more information about using SFTP with theSuiteScript 2.0N/sftp Module, see the following: