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

Uploads keep crashing #61

Open
jay-oswald opened this issue Nov 27, 2023 · 2 comments
Open

Uploads keep crashing #61

jay-oswald opened this issue Nov 27, 2023 · 2 comments

Comments

@jay-oswald
Copy link

I'm using this to sync files from my local server to s3 compatible storage, however I keep getting crashes without any errors.

I'm running it on node 21 in a docker container, just super small node script which runs the sync every hour from a local folder to the cloud storage, below is the entire script.

I added some limits to my bucket size that was below the current storage, and when trying to upload I successfully got that error logged saying there was not enough storage. But most of the time its crashing every 15 mins or so. It was crashing every 5 mins before I added the partial size 100mb line, so that has helped, but still crashing very regurally.

Is there any way I can enable more logging so when it crashes I at least get error logs to see whats happening? I have transferred just over 100Gb to the bucket, but only 70Gb of files have been saved, so the regular crashing is leaving a lot of multi-part files half-done

import { S3Client } from '@aws-sdk/client-s3';
import { S3SyncClient, TransferMonitor } from 's3-sync-client';
import cron from 'node-cron';

const s3Client = new S3Client({
    endpoint: `xxx`,
    region: "xxx",
    credentials: {
      accessKeyId: "xxx",
      secretAccessKey: "xxx",
    },
});

const { sync } = new S3SyncClient({ client: s3Client });
const monitor = new TransferMonitor();

let running = false;
backup();

cron.schedule('0 * * * *', () => {
    backup();
});

async function backup(){
    if(running) return;
    running = true;
    const timeout = setInterval(() => console.log(monitor.getStatus()), 2000);
    await sync("/backup", "s3://xxx", {
        monitor,
        del: true,
        partSize: 100 * 1024 * 1024,
    });
    console.log(monitor.getStatus())
    clearInterval(timeout);
    running = false;
}

@jay-oswald
Copy link
Author

I found in my router logs that the internet had kept dropping out. I suspect my ISP kept dropping the internet and re-connecting it straight away because I was maxing my upload or something? and when that happens the script dosen't cope and crashes. Not sure if theres much that can be done about that. But would still be nice to get an error message, like when the API returns one so its easier to see whats happening

@jeanbmar
Copy link
Owner

jeanbmar commented Nov 28, 2023

Hello,

What happens when it crashes? If you notice it crashes, I assume you get some kind of generic error at least. What is this error?

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

No branches or pull requests

2 participants