First of thanks for making this library @patrickjuchli - really awesome.
Describe the bug
I'm looking for a enhancement to resolve the existing known "Error: Timeout (control socket)" issue. See issue #123
I use this library as a dependency for a few of my libraries see FTP-Deploy-Action and @samkirkland/ftp-deploy. This is a ongoing issue and I'd love to work with you on a resolution.
Example code
Please see tickets SamKirkland/FTP-Deploy-Action#144 and SamKirkland/FTP-Deploy-Action#106
Sadly the recreation is very difficult due to it being dependent on routers between the client/server. I am able to recreate a similar error (426 Failure reading network stream) but I believe its the same cause because it only appears with the following conditions:
- Must be using FTPS
- Must be running the deployment code on github servers and connecting to a server in Germany (router dependent)
- Must be uploading a relatively large file, In my recreation I successfully upload a dozen files <1MB and then it fails consistently on a file >1MB
Console output
Error from user reports
Note: Ignore line numbers, i've pushed out a new version. New line number is 3759 in my codebase
Error: Timeout (control socket)
at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/beta-v4/dist/index.js:3701:58)
at Object.onceWrapper (events.js:299:28)
at Socket.emit (events.js:210:5)
at Socket._onTimeout (net.js:469:8)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)
Error I am able to recreate
uploading ".htaccess"
uploading "About.php"
uploading "api/.htaccess"
uploading "api/API.class.php"
uploading "api/api.php"
uploading "api/concrete.php"
uploading "api/error_log"
uploading "cist2910/create.php"
uploading "cist2910/css/style.css"
uploading "cist2910/img/drink.svg"
uploading "cist2910/img/exercise.svg"
uploading "cist2910/img/food.svg"
uploading "cist2910/img/music.svg"
uploading "cist2910/index.php"
uploading "cist2910/insert.php"
uploading "cist2910/js/jquery-2.1.4.min.js"
400 level error from server when performing action - retrying...
FTPError: 426 Failure reading network stream.
at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3759:39)
at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3600:44)
at TLSSocket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:286:13)
at TLSSocket.Readable.push (_stream_readable.js:224:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:182:23) {
name: 'FTPError',
code: 426
}
Which version of Node.js are you using?
Node v14.15.1
Additional context
Based on some reading on node keep alive the default interval can be quite long.
See Stackoverflow post one of the recommendations is to use net-keepalive but it doesn't support windows 😞
It appears other clients such as FileZilla and WinSCP are doing it the way you suggested in issue #123
I would love to implement this on my side but looking through the API I don't see how it'll be possible. I can't send commands on the open control socket while the connection is already open.
My current idea is to create a interval to send a NOOP over the control socket every . Internal could be set within handle and cleared when the promise is resolved/rejected. A new keepAlive interval number option would be added to the client constructor next to timeout. Default is undefined (non-breaking), if a number is passed we will send a "NOOP" every N ms.
First of thanks for making this library @patrickjuchli - really awesome.
Describe the bug
I'm looking for a enhancement to resolve the existing known "Error: Timeout (control socket)" issue. See issue #123
I use this library as a dependency for a few of my libraries see FTP-Deploy-Action and @samkirkland/ftp-deploy. This is a ongoing issue and I'd love to work with you on a resolution.
Example code
Please see tickets SamKirkland/FTP-Deploy-Action#144 and SamKirkland/FTP-Deploy-Action#106
Sadly the recreation is very difficult due to it being dependent on routers between the client/server. I am able to recreate a similar error (426 Failure reading network stream) but I believe its the same cause because it only appears with the following conditions:
Console output
Error from user reports
Note: Ignore line numbers, i've pushed out a new version. New line number is 3759 in my codebase
Error: Timeout (control socket) at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/beta-v4/dist/index.js:3701:58) at Object.onceWrapper (events.js:299:28) at Socket.emit (events.js:210:5) at Socket._onTimeout (net.js:469:8) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7)Error I am able to recreate
uploading ".htaccess" uploading "About.php" uploading "api/.htaccess" uploading "api/API.class.php" uploading "api/api.php" uploading "api/concrete.php" uploading "api/error_log" uploading "cist2910/create.php" uploading "cist2910/css/style.css" uploading "cist2910/img/drink.svg" uploading "cist2910/img/exercise.svg" uploading "cist2910/img/food.svg" uploading "cist2910/img/music.svg" uploading "cist2910/index.php" uploading "cist2910/insert.php" uploading "cist2910/js/jquery-2.1.4.min.js" 400 level error from server when performing action - retrying... FTPError: 426 Failure reading network stream. at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3759:39) at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3600:44) at TLSSocket.emit (events.js:210:5) at addChunk (_stream_readable.js:309:12) at readableAddChunk (_stream_readable.js:286:13) at TLSSocket.Readable.push (_stream_readable.js:224:10) at TLSWrap.onStreamRead (internal/stream_base_commons.js:182:23) { name: 'FTPError', code: 426 }Which version of Node.js are you using?
Node
v14.15.1Additional context
Based on some reading on node keep alive the default interval can be quite long.
See Stackoverflow post one of the recommendations is to use net-keepalive but it doesn't support windows 😞
It appears other clients such as FileZilla and WinSCP are doing it the way you suggested in issue #123
I would love to implement this on my side but looking through the API I don't see how it'll be possible. I can't send commands on the open control socket while the connection is already open.
My current idea is to create a interval to send a NOOP over the control socket every . Internal could be set within
handleand cleared when the promise is resolved/rejected. A new keepAlive intervalnumberoption would be added to the client constructor next to timeout. Default isundefined(non-breaking), if a number is passed we will send a"NOOP"every N ms.