client sftp exists crash
See original GitHub issuewhen i call exists function with path folder not existing. i have error :
stack:"Error: sftp.exists: sftp.realPath:
Cannot find message [/Inbox/tip/test] /Inbox/tip/test\n
at formatError (\node_modules\ssh2-sftp-client\src\index.js:56:10)\n
at SftpClient.exists (\node_modules\ssh2-sftp-client\src\index.js:241:27)\n
at process._tickCallback (internal/process/next_tick.js:68:7)"
my code :
clientSftp.connect({
host: ssh2.host,
port: ssh2.port,
username: ssh2.username,
password: ssh2.password
}) .then(() => {
const folder = `${ssh2.path}/${type}`;
return clientSftp.exists(folder);
}) .then((exist) => {
return resolve(exist);
}).catch(err => {
self.logger.error( `transport to ${localFile}/${remoteFile} error`+ err.message);
return reject(err);
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Node can crash while doing a put because of missing 'error ...
Hello, We are seeing the possibility for a crash of node when doing a put. Here is the stack trace: Error: read ECONNRESET...
Read more >c# - SSH.NET SFTP client giving "Path does not exists" when ...
So I solved the issue by changing the library to WinSCP public SessionOptions GetFTPClient() { SessionOptions sessionOptions = new ...
Read more >SFTP client cannot send to Sterling Integrator SFTP Server ...
The SFTP server log indicates the file the client is trying to upload already exists. The SFTP Client is not using a temporary...
Read more >Sftp keeps crashing NR - General - Node-RED Forum
Hi, node-red-contrib-better-sftp will crash NR 2.2.2. In Better-Sftp LIST is working, but PUT, GET and DELETE will crash NR. In the console is...
Read more >SftpClient.Exists Method - Crestron
Permission to perform the operation was denied by the remote host. A SSH command was denied by the server. A SSH error where...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Odd, I added a comment about fixing this 5 days ago and now it is not there!
Anyway, I think your analysis was correct and I have fixed the catch test to use the error code rather than the message, so this issue should now be resolved. This change to add error.code properties in a consistent manner was already undeway (since node v10 improved this situation).
I have released a new version (v4.3.0) which has these fixes included.
Succes
Error: