Skip to content

Failing S3 Uploads: Invalid Part Numbers #664

Closed

Description

@matthewcaminiti

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.

Activity

  1. Acconut commented on Oct 22, 2024

    @Acconut
    Member

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

  2. matthewcaminiti commented on Oct 22, 2024

    @matthewcaminiti
    Author

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

    AWS S3

  3. jesse-small commented on Dec 19, 2024

    @jesse-small

    This could possibly be related to the bug I reported here:
    #688

    Solution is to not increment the part number twice, this is a fix required by the library.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions