Internal Server Error uploading to a bucket
vanlueckn
PROOP

3 months ago

If i try to upload a file to my bucket via a presigned url, i get this error:

The result:

<?xml version="1.0" encoding="UTF-8"?> <Error><Code>InternalError</Code><Message>We encountered an internal error, please try again.</Message><Resource>/respawn-data-dev-0pgpd7zy/backups/fb4230f4-2dea-4921-854c-5ca4729da847/1765580094945_add119a9-71cb-4784-afb9-588b8bb77112.tar.gz</Resource><RequestId>1765580116633683348</RequestId><Key>backups/fb4230f4-2dea-4921-854c-5ca4729da847/1765580094945_add119a9-71cb-4784-afb9-588b8bb77112.tar.gz</Key><BucketName>respawn-data-dev-0pgpd7zy</BucketName></Error>

This is the presigned url:

https://storage.railway.app/respawn-data-dev-0pgpd7zy/backups/fb4230f4-2dea-4921-854c-5ca4729da847/1765580094945_add119a9-71cb-4784-afb9-588b8bb77112.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=tid_oJuqccEMPbZebHLfmFKKjZigHOjwkxAcPXtDZyjRlPIWjKYbXY%2F20251212%2Fams%2Fs3%2Faws4_request&X-Amz-Date=20251212T225454Z&X-Amz-Expires=3600&X-Amz-Signature=d48f2e23cd24089d00d1481a94b84c54d7e3e4cd4a08ccebf48b49212990b167&X-Amz-SignedHeaders=host&x-amz-checksum-crc32=AAAAAA%3D%3D&x-amz-sdk-checksum-algorithm=CRC32&x-id=PutObject

$20 Bounty

1 Replies

3 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 3 months ago


jqcktalks
FREE

3 months ago

Your best bet is to generate a pre-signed URL without the AWS SDK's checksum protection. If you're using AWS-SDK's Client S3 package (v3.729.0+), it'll also add CRC32 unless you disable it. Here's an example that might work for you.

import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";

const s3 = new S3Client({
  region: "ams",
  endpoint: "https://storage.railway.app",
  requestChecksumCalculation: "WHEN_REQUIRED",
});

const command = new PutObjectCommand({
  Bucket: "respawn-data-dev-0pgpd7zy",
  Key: "backups/your-file.tar.gz",
});

const presignedUrl = await getSignedUrl(s3, command, {
  expiresIn: 3600, // Active for 1 hour.
});

console.log(presignedUrl);

Loading...