question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client sftp exists crash

See original GitHub issue

when 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:closed
  • Created 4 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
theophilusxcommented, Nov 30, 2019

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.

0reactions
oussamaABIDcommented, Nov 25, 2019

Succes

Success

Error:

failed
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found