Reduce internal server errors

Open
#693 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Acconut is already working on this.

Since Mar 21, 2022.

Assessment

This issue has not been assessed yet.

Description

tusd currently returns some 500 Internal Server Error responses which are not necessary or should be other status codes:

  • [tusd] 2022/03/21 08:20:48 event="ResponseOutgoing" status="500" method="PATCH" path="" body="ERR_INTERNAL_SERVER_ERROR: unexpected EOF
    This occurs when the request body ends unexpectedly. This is no big deal, tusd will just store the received data. This should not be a ERR_INTERNAL_SERVER_ERROR.
  • [tusd] 2022/03/21 05:58:23 event="ResponseOutgoing" status="500" method="PATCH" path="" body="ERR_INTERNAL_SERVER_ERROR: http: invalid Read on closed Body
    I am not sure where this is exactly coming from but maybe from the new locking mechanism with upload interruptions. This needs investigation.
  • [tusd] 2022/03/21 09:07:09 event="ResponseOutgoing" status="500" method="POST" path="" body="ERR_INTERNAL_SERVER_ERROR: s3store: unable to create multipart upload: MetadataTooLarge: Your metadata headers exceed the maximum allowed metadata size
    S3 has a limit on the metadata size. From https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html:

The PUT request header is limited to 8 KB in size. Within the PUT request header, the user-defined metadata is limited to 2 KB in size. The size of user-defined metadata is measured by taking the sum of the number of bytes in the UTF-8 encoding of each key and value.

tusd should check the metadata size before and return a 400 error if the 2 KB are exceeded.

Dominant language
Go
Stars
3.9k
Forks
557
Avg merge
3d 1h
Merged PRs (30d)
10

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tus/tusd

All issues in tus/tusd

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.