Open scooper91 opened 3 years ago
That error is not coming from this module, so I can't help you there. You'll need to take it up with ssh2-sftp-client
it seems.
Thanks for the reply.
The error is surfacing through the ssh2-sftp-client
, but at the bottom of the stack, the error is coming from ssh2-streams
. In the linked issue from the ssh2-sftp-client
, the maintainer says it's not to do with their library. As I mentioned, we got the same error (with the stack originating from this ssh2-streams
library) using a different library.
It looks like the ssh2-sftp-client
library is calling fastPut
in this library, and the error in the stack trace is just a formatted version of the underlying error from ssh2-streams
.
Thanks!
Then I can only guess it's coming from the server because this module has never had an error message like that before. Is this a custom/specialty/uncommon sftp/ssh server?
It appears that we weren't doing a diligent enough check to ensure the files were uploading correctly. The file size is always correct when uploading the files, even when we get the error, but the start of the file is corrupted. We get a bunch of null characters (which show as ^@
in Vim), which represents zero-bytes.
e.g. When opening one of the files in Vim, it looks something like this (but with a lot more zero-byte characters)
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@rest-of-the-data
Unfortunately, it's a third-party SFTP, which we're just integrating with, so we don't know much about it! We do not appear to have an issue when using SCP
to upload files, and the owner of the SFTP has used FileZilla without any issues (although I don't know if they upload the file chunks concurrently).
Does the upload work when using sftp.createWriteStream()
instead? That function does not send concurrent chunks.
Hi,
We're frequently seeing a
Missing file segements in upload:0
error when trying to upload a file to a client's SFTP. It's a large file - ~1GB. The upload is successful and complete (we've verified the checksum), so we're unsure why we're seeing this error. We seeing this error about 80% of the time.We found this issue on the library we're using. We also tried using a different library (which still uses this
ssh2-streams
library), but got the same error. We are able to successfully upload a file usingscp
.We enabled debug mode, but nothing really jumped out. We did notice a 2 second pause between the last debug log and when the error was thrown.
Here's a screenshot of when the error was thrown:
We're not sure whether this is a problem with the SFTP server, or an issue at our end.
Any advice would be greatly appreciated.
Thanks!