How to Resolve SFTP Connection Timeout Issues

When connecting to an SFTP server from NetSuite, you may encounter connection timeout errors, preventing successful file transfers. These issues can arise due to network restrictions, incorrect configurations, or authentication problems.

This article outlines common causes and solutions to resolve SFTP connection timeout issues in NetSuite.

Common Causes of SFTP Connection Timeout Issues

  1. Incorrect Hostname or Port – The SFTP server details may be incorrect.
  2. Network Firewall Restrictions – NetSuite’s IP addresses might be blocked.
  3. Authentication Issues – Wrong credentials or missing key-based authentication.
  4. SFTP Server Unavailability – The server might be down or rejecting connections.
  5. Slow Response from SFTP Server – Long processing times can cause timeouts.
  6. NetSuite Script Execution Limits – SuiteScript time limits may cause disconnections.

Troubleshooting and Solutions

1. Verify SFTP Credentials and Host Details

  • Ensure you are using the correct SFTP hostname, username, password, and port (typically 22).
  • If using key-based authentication, check that the SSH key pair matches the server configuration.

Steps to check credentials:

  1. Navigate to Setup > Company > Certificates (for key-based authentication).
  2. Ensure the correct SSH key is linked to your NetSuite script or integration.
  3. If using a password, confirm it is accurate and not expired.

2. Test the Connection Outside NetSuite

  • Use an SFTP client like Cyberduck, WinSCP, or FileZilla to test the connection.
  • If the connection fails outside NetSuite, the issue is likely with the SFTP server.
  • If it works, proceed with debugging NetSuite’s connection.

3. Whitelist NetSuite’s IP Addresses

  • Many SFTP servers restrict connections based on IP allowlists.
  • Whitelist NetSuite’s outbound IP addresses in your SFTP server’s firewall settings.
To find NetSuite’s outbound IPs, refer to NetSuite Help Center (IP ranges vary by data center).

4. Check NetSuite Governance and Script Execution Limits

  • Scheduled Scripts and Map/Reduce scripts in NetSuite have governance limits that might cause disconnections.
  • If the script runs out of execution time:
  • Optimize the script to reduce execution time.
  • Use scheduled execution instead of running it as a user event or client script.

5. Ensure SFTP Server is Running

  • Contact the SFTP provider or server administrator to verify:
  • The server is online and not under maintenance.
  • The account used for authentication is not locked or disabled.
  • There are no rate limits preventing multiple NetSuite requests.

6. Enable Debugging and Logs in NetSuite

  • Check the Execution Log in NetSuite Scripts:
  • Go to Customization > Scripting > Script Deployment.
  • Enable Logging and check for connection errors.
  • Modify the script to log error messages:
javascript

Copy

Edit
try {
    var connection = sftp.createConnection({...});
} catch (e) {
    log.error('SFTP Connection Error', e.message);
}

Conclusion

SFTP connection timeout issues in NetSuite can be resolved by verifying credentials, allowing NetSuite’s IP addresses, increasing script timeout limits, and debugging logs. If the issue persists, testing the connection outside NetSuite and checking for server-side restrictions can help pinpoint the root cause.

Would you like help debugging a specific error message related to your SFTP connection?

Leave a comment

Your email address will not be published. Required fields are marked *