According to, GitLab currently use Fog gem to support many backup backends. Underlying is some issues which I met while setting up the Amazon S3 backup.

  1. IAM Permission Setup

Incorrect IAM permission setup may lead to upload failures.

The solution is quite simple, visit and paste example policy JSON under Inline Policies. If you get *Statement is missing required element - Statement "$ID" is missing "Principal" element. *, it means that you have mistakenly mixed S3 Policy with User Permission Policy. Try the above link.

  1. OpenSSL certificate invalid

This issue may occur when you use the regions name in Code like us-east-1 will cause Fog to generate such a URL: But this URL now perform a permanent redirect to This means AWS preferred to use the code ap-northeast-1 instead of us-east-1. This may related to a minor update in S3, but it used to return in the <Endpoint> field of XML contents. Fog just concat your bucket name and append that endpoint URL, generating such URL like And that cause this certificate issue.

Solution is quite simple as well, directly use final code such as ap-northeast-1 and access the bucket without redirection.