-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncatchable error upon error-no-response #566
Comments
You should either be using sftp.get() or sftp.downloadFiles() to get the
files. The sftp.createReadStream() is a low level function provided as a
special escape hatch and should only be used in special situations. You
have to take a lot more precautions and do a lot more work to make it
perform correctly (have a look at the code for sftp.downloadFiles() to see
what fi mean).
In general, trying to download many files in parallel never works well with
sftp. It typically doesn't improve performance as much as you might expect
and just makes things more complicated. One of the additional complications
is how sftp servers handle many requests and the variolus rate limiting
techniques they use to protect against DDoS etc.
…On Fri, 24 Jan 2025 at 18:05, cobasajaxinpho ***@***.***> wrote:
Hi @theophilusx <https://github.com/theophilusx> ,
Just wonder. have you encounter this issues?
https://repost.aws/questions/QUsUpFCoYHRMuLd_yfi7tOEQ/lambda-ssh2-sftp-client-throw-uncatchable-error-no-response-from-server-when-run-in-parallel
I have been trying to figure out too. as try catch won't catch the error,
will lead to crash the application
—
Reply to this email directly, view it on GitHub
<#566>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMFIKIX4AIP2AX4RMGJ5WL2MHQ4ZAVCNFSM6AAAAABVZAYYWWVHI2DSMVQWIX3LMV43ASLTON2WKOZSHAYDQNRXGQ3DQMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
regards,
Tim
--
Tim Cross
|
Ok. Thanks for clarifying.
got error any idea why the error happen? tried "documents/files/data" also same error. |
The error is telling you that the file path you are suppling does not
match on the remote server. There are quite a few reasons why the path
may not be what you expect.
- The sftp server may be operating within a chroot or container
environment which presents a different view of the file system from what
you expect.
- The sftp servfer might be logging you in at a point in the file system
different to what you expect.
- The sftp server may have different permission settings. The file is
there, but the server doesn't allow you to read it.
The ftp protocol (which is what sftp uses and is different from just
ssh), has many optiolns and sftp servers can be set up in many different
ways. For example, a 'traditional' sftp server configuration has the
server setup within a chroot environment and for anonymous ftp, it allow
uploading of files but does not allow listing or retrieving of files
(even ones you have uploaded).
It is unlikely the error you are seeing is due to an issue with
ssh2-sftp-client. Most likely the issue is that your using the wrong/bad
file path or you don't have the righyt permissions.
I would suggest using the sftp.realPath() and sftp.list() methods to
verify your assumptions regarding file paths and verify relative and
absolute paths. I would also use something like the openSSH CLI sftp
client to test/verify.
|
i have modified my code to use realPath , also result in the same error
the different is real path value : "/documents/files/data" |
There isn't sufficient information for me to tell what is goig on here. Please provide
Some things to consider -
Have you tested your uploadFile function in a simple script without any of the web stuff and outside any class or object? To get to the root cause here, it will first be necessary to strip everything down to absolute minimum, verify basic function and then build up bit by bit. |
Hi @theophilusx ,
Just wonder. have you encounter this issues?
https://repost.aws/questions/QUsUpFCoYHRMuLd_yfi7tOEQ/lambda-ssh2-sftp-client-throw-uncatchable-error-no-response-from-server-when-run-in-parallel
I have been trying to figure out too. as try catch won't catch the error, will lead to crash the application
here's some snapshot of the code
Somehow need to
to prevent it from crashing the application
The text was updated successfully, but these errors were encountered: