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

Issues with upgraded AWSSDK.S3 dependency in release v1.1.0 and upwards #7

Closed
petervannes opened this issue Jan 30, 2025 · 2 comments
Closed
Labels
documentation Improvements or additions to documentation

Comments

@petervannes
Copy link

petervannes commented Jan 30, 2025

In version 1.1.1 the PackageReference version for AWSSDK. S3 has been bumped to 3.7.412.5.
After bumping my tusdotnet.Storage.S3 version from v1.0.2 to v1.1.1 uploads from a tus-is-client to a tusdotnet server failed with the exception;

Net Connection id "...", Request id"...:0000000D": An unhandled exception was thrown by the application.
Amazon. S3 .AmazonSException: The Content-SHA256 you specified did not match what we received
--→> Amazon. Runtime. Internal. HttpErrorResponseException: Exception of type
' Amazon. Runtime. Internal. HttpErrorResponseException' was thrown.

Due to the NuGet dependency resolution it is not possible to forcibly downgrade the AWSSDK.S3 version by adding a
explicit version in the csproj.

The exception is caused by the new default integrity protections in de AWSSDK.S3 version 3.7.412.0
(aws/aws-sdk-net#3610) and our not Amazon AWS S3 storage.
So when using MinIO or Dell ECS this exception may occur.

For now it can be resolved by adding the configuration option "RequestChecksumCalculation" with value
"RequestChecksumCalculation. WHEN _REQUIRED" to the S3 configuration.

public static class Tusstore
{
    Public static void AddusStore(this IServicecollection services, IConfiguration configuration, ILogger< TusS3Store> logger)
    {
        var objectStorageSettings = new ObjectStorageSettings();
        configuration.GetSection("ObjectStorage").Bind(objectStorageSettings);
        var tusS3StoreConfig = new TusS3StoreConfiguration
        {
            BucketName = objectStorageSettings. BucketName!,
        }
        var awsCredentials = new BasicAWSCredentials(objectStorageSettings.AccessKey, objectStorageSettings.Secret);
        var objectStoreConfig = new AmazonS3Config
        {
             ServiceURL = objectStorageSettings. Endpoint,
             ForcePathStyle = true,
             RequestChecksumCalculation = RequestChecksumCalculation.WHEN_REQUIRED
        }
        var tusObjectStore = new TusS3Store(logger, tusS3StoreConfig, awsCredentials, objectStoreConfig);
        services.AddSingleton(tusObjectStore);
    }
}

See also; https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.html

@teian
Copy link
Collaborator

teian commented Jan 30, 2025

Sure but that's not an issue with this lib but with your S3 backend. I will add this information to the documentation though.

@teian teian added the documentation Improvements or additions to documentation label Jan 30, 2025
teian added a commit that referenced this issue Jan 30, 2025
@teian teian closed this as completed Jan 30, 2025
@petervannes
Copy link
Author

petervannes commented Jan 30, 2025 via email

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

No branches or pull requests

2 participants