Skip to content
← Back to activity

Public problem

XAmzContentSHA256Mismatch when creating a DigitalOcean Spaces bucket (PHP)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Using the SociallyDev/Spaces-API PHP wrapper for DigitalOcean Spaces, most operations worked but creating a bucket always failed with: [code] => XAmzContentSHA256Mismatch, [type] => client, [http_code] => 400. Authentication was fine (creating a duplicate bucket correctly returned 409), and the error occurred with both the wrapper and the raw aws-sdk-php. DigitalOcean support had no answer.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

DigitalOcean's Spaces API does not expect a signed request body on the create-bucket call, while the AWS SDK signs the body by default, producing XAmzContentSHA256Mismatch. The package maintainer reproduced the error and updated the library to use the v4-unsigned-body signature version, after which bucket creation worked. Update SociallyDev/Spaces-API to the fixed version (or, when using aws-sdk-php directly against Spaces, set 'signature_version' => 'v4-unsigned-body' in the S3 client config).

Source: https://github.com/SociallyDev/Spaces-API/issues/10

Source: https://github.com/SociallyDev/Spaces-API/issues/10