Skip to content
← Back to activity

Public problem

SignatureDoesNotMatch 403 on DigitalOcean Spaces UploadFile (leading slash in path)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Connecting to DigitalOcean Spaces with new SpacesConnect($key, $secret, $space_name, $region) returned: "SignatureDoesNotMatch" 403. Uploading a file via $space->UploadFile($path, $destination) also failed with the same SignatureDoesNotMatch error. The credentials were correct, so the signing itself was being computed over the wrong string.

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

A leading forward slash on the object path breaks AWS Signature V4 signing against Spaces: UploadFile('/file.txt') fails while UploadFile('file.txt') succeeds. The reporter found this themselves and a second user confirmed the same fix on uploads. Strip any leading '/' from destination paths before calling UploadFile. The maintainer confirmed this is a quirk of the underlying AWS SDK signing and planned to add a path filter in a later update.

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

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