Skip to content
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

Seek fault when downloading some files #470

Open
BennyAlex opened this issue Aug 7, 2023 · 1 comment
Open

Seek fault when downloading some files #470

BennyAlex opened this issue Aug 7, 2023 · 1 comment

Comments

@BennyAlex
Copy link

I try to download a directory, for some files I get an seek faul error. Always the same files failing.

// Function to download a directory
async function backupDirectory(backupDir) {
  try {
    await sftp.connect(server);
    
    console.log('Connected to SFTP server');
    
    const failed = []
    const successful = []
    
    const status = await sftp.getDirectory(backupDir, '/0g564be4cbaMfUx3', {
      recursive: true,
      concurrency: 2,
      tick: function(localPath, remotePath, error) {
        if (error) {
          console.log(`Failed to download ${remotePath}: ${error}`);
          failed.push(localPath)
        } else {
          console.log(`Successfully downloaded ${remotePath}`);
          successful.push(localPath)
        }
      }
    });
    
    console.log('the directory transfer was', status ? 'successful' : 'unsuccessful')
    console.log('failed transfers', failed.length);
    console.log('successful transfers', successful.length);
  } catch (err) {
    console.error('SFTP error:', err);
  } finally {
    await sftp.dispose();
  }
}

Console output:

Connected to SFTP server
Failed to download \0g564be4cbaMfUx3\_foundUrlsWithoutStatus.json: Error: Seek fault.
Successfully downloaded \0g564be4cbaMfUx3\config.json
Failed to download \0g564be4cbaMfUx3\foundUrls.json: Error: Seek fault.
Successfully downloaded \0g564be4cbaMfUx3\foundUrlsHistory.json
Successfully downloaded \0g564be4cbaMfUx3\history.json
Successfully downloaded \0g564be4cbaMfUx3\pdfs.json
Successfully downloaded \0g564be4cbaMfUx3\report.json
Successfully downloaded \0g564be4cbaMfUx3\sitemap.json
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-error-error-faces-code-404.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-error-error-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-imprint-imprint-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-imprint-licenseinfo-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-imprint-privacy-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-sitemap-sitemap-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-subMenu-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-utilities-accessibilityHelp-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-utilities-accessibilityStatement-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\reports\hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-utilities-easyLanguageHelp-faces.json: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-.jpeg: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-error-error-faces-code-404.jpeg: Error: Seek fault.
Successfully downloaded \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-error-error-faces.jpeg
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-imprint-imprint-faces.jpeg: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-imprint-licenseinfo-faces.jpeg: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-imprint-privacy-faces.jpeg: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-sitemap-sitemap-faces.jpeg: Error: Seek fault.
Successfully downloaded \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-subMenu-faces.jpeg
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-utilities-accessibilityHelp-faces.jpeg: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-utilities-accessibilityStatement-faces.jpeg: Error: Seek fault.
Failed to download \0g564be4cbaMfUx3\screenshots\Full_hio-eh-prod-hispro-de-qisserver-pages-cs-sys-portal-utilities-easyLanguageHelp-faces.jpeg: Error: Seek fault.
the directory transfer was unsuccessful
failed transfers 22
successful transfers 8
@steelbrain
Copy link
Owner

Hi @BennyAlex

This is very interesting! There's a lot of potential points of failure here, from the ssh client to ssh server to the underlying filesystem itself.

Let's work together to try and eliminate the choices one by one. Is it possible to zip the files that you're trying to download (with .exec or .execCommand) and then download the zip?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants