node.jssynchronizationportdigital-oceanssh2-sftp

Outgoing SFTP Timeouts on DigitalOcean App Platfrom


I have a Node app that needs to dump (a small number of small) XML files to an external SFTP server. I'm using the 'sftp-sync-deploy' SFTP sync library, and the app works fine locally, but once deployed to the DigitalOcean App Platform, I get SFTP timeouts instead of the uploads.

The errors look like this:

[12:06:18] Server running on port 5000
[12:07:16] syncIxRS called
[12:07:16] * Deploying to host homeXXXXXXX.1and1-data.host
[12:07:16] * local dir  = /workspace/ixrs
[12:07:16] * remote dir = 
[12:07:16] 
[12:07:36] Error syncing IxRS folders Error: Connection Error: Timed out while waiting for handshake
[12:07:36]     at Client.<anonymous> (/workspace/node_modules/sftp-sync-deploy/lib/sftpSync.js:61:28)
[12:07:36]     at Client.emit (events.js:314:20)
[12:07:36]     at Timeout._onTimeout (/workspace/node_modules/ssh2/lib/client.js:689:14)
[12:07:36]     at listOnTimeout (internal/timers.js:554:17)
[12:07:36]     at processTimers (internal/timers.js:497:7)

My assumption is that the outgoing SFTP request or incoming response is being blocked, but I can't see how to open this port on DigitalOcean side.


Solution

  • I recently ran into this issue as well. DigitalOcean support gave this anwer:

    Unfortunately the SFTP protocol which uses SSH is not supported in app platform. Only TCP connections can be made external to app platform. App platform's disk is also ephemeral so any content moved there would be lost on each deploy.

    Unfortunately, SSH (and thus SFTP) is simply not available in the App platform.