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

Failing S3 Uploads: Invalid Part Numbers #664

Open
2 tasks done
matthewcaminiti opened this issue Oct 21, 2024 · 2 comments
Open
2 tasks done

Failing S3 Uploads: Invalid Part Numbers #664

matthewcaminiti opened this issue Oct 21, 2024 · 2 comments
Labels

Comments

@matthewcaminiti
Copy link

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Steps to reproduce

Packages

// client
    "tus-js-client": "^4.0.1",
// server
    "@tus/server": "^1.4.1", // resolved to 1.8.0
    "@tus/s3-store": "^1.4.1", // resolved to 1.6.0

Client snippet

        tusUpload = new tus.Upload(file, {
          endpoint: `/admin/uploads/tus`, // removed url origin from snippet
          chunkSize: 6 * 1024 * 1024,
          retryDelays: [0, 1000, 3000, 5000],
          parallelUploads: 1,
          removeFingerprintOnSuccess: true,
          storeFingerprintForResuming: true,
          uploadDataDuringCreation: true,
          headers: {
            authorization: `Bearer ${token}`,
          },
          metadata: {
            name,
            id,
          },
          onProgress: function (bytesUploaded, bytesTotal) {
          },
          onSuccess: async function () {
          },
          onError: function (error) {
          },
        });

Server snippet

    const s3Store = new S3Store({
      partSize: 6 * 1024 * 1024,
      s3ClientConfig: {
        bucket: BUCKETS.UPLOADS,
        region: REGION,
      },
    });

    this.tusServer = new Server({
      path: '/admin/uploads/tus',
      datastore: s3Store,
      relativeLocation: true,
      namingFunction(req, metadata) {
        return metadata.name;
      },
      onResponseError: (req, res, err) => {
        // err
      },
    });

Expected behavior

Expectation is file upload success. Up until recently (although unknown how long this has been broken) our setup has worked without issue. With our setup we were successfully uploading and tracking the progress of uploads.

Pinning our versions of @tus/server and @tus/s3-store to 1.4.1 restores the expected behaviour.

Actual behavior

Error that is consistently hit, at seemingly the end of the upload process (server side), failing to complete the upload.

InvalidPartOrder: The list of parts was not in ascending order or did not have consecutive part numbers. The parts list must be specified order by part number, and must not have any gaps.

Stack trace comes out of the aws-sdk.

@Acconut
Copy link
Member

Acconut commented Oct 22, 2024

Are you using AWS S3 or another S3-compatible storage service?

@matthewcaminiti
Copy link
Author

Are you using AWS S3 or another S3-compatible storage service?

AWS S3

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

No branches or pull requests

2 participants