tus-node-server icon indicating copy to clipboard operation
tus-node-server copied to clipboard

使用s3Store上传报错,Error: Parse Error

Open zhoushangdeng opened this issue 2 years ago • 4 comments

这是我的代码,有时候断点续传走到 this.client.uploadPart 就卡住了,有时候正常,错误为就解析错误。我是在koa里使用的,我的版本"aws-sdk": "^2.4.1",

const PATH = '.files'
const tusServer = new tus.Server();
tusServer.datastore = new tus.S3Store({
    path: `/${PATH}`,
    endpoint: 'http://192.168.10.23:9000',
    accessKeyId: 'minio',
    secretAccessKey: 'minio123',
    s3ForcePathStyle: true,
    bucket: 'shangdeng',
    partSize: 5 * 1024 * 1024, // each uploaded part will have ~8MB,
    tmpDirPrefix: 'tus-s3-store',
    signatureVersion: 'v2',
});

_uploadPart(metadata, read_stream, current_part_number) {
        const { fileType } = this.decode(metadata.file.upload_metadata)
        return this.client
            .uploadPart({
                Bucket: this.bucket_name,
                Key: `${metadata.file.id}.${fileType}`,
                UploadId: metadata.upload_id,
                PartNumber: current_part_number,
                Body: read_stream
            })
            .promise()
            .then((data) => {
                console.log({ data });
                log(`[${metadata.file.id}] finished uploading part #${current_part_number}`);
                return data.ETag;
            })
            .catch((err) => {
                console.log("_uploadPartError", err);
                throw err;
            });
    }

zhoushangdeng avatar Feb 14 '22 09:02 zhoushangdeng

Please describe your problem in English :)

Acconut avatar Feb 14 '22 13:02 Acconut

中文:请描述你的问题)

Error: Parse Error at socketOnEnd (node:_http_server:602:22) at Socket.emit (node:events:402:35) at Socket.emit (node:domain:475:12) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)

zhoushangdeng avatar Feb 17 '22 01:02 zhoushangdeng

Please describe your problem in English :)

Breakpoint continuation sometimes reports this error

zhoushangdeng avatar Feb 17 '22 01:02 zhoushangdeng

I am still not able to piece together the information from you. Please describe the issue in more detail, similar to how it is laid out in this questionnaire: https://github.com/tus/tusd/blob/master/.github/ISSUE_TEMPLATE/bug_report.md

Acconut avatar Feb 21 '22 12:02 Acconut