You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/modules/storage
Earl Warren 7818121d50
S3: log human readable error on connection failure (#26856)
Should BucketExists (HeadBucket) fail because of an error related to
the connection rather than the existence of the bucket, no information
is available and the admin is left guessing.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html

> This action is useful to determine if a bucket exists and you have
> permission to access it. The action returns a 200 OK if the bucket
> exists and you have permission to access it.
>
> If the bucket does not exist or you do not have permission to access
> it, the HEAD request returns a generic 400 Bad Request, 403
> Forbidden or 404 Not Found code. A message body is not included, so
> you cannot determine the exception beyond these error codes.

GetBucketVersioning is used instead and exclusively dedicated to
asserting if using the connection does not return a BadRequest.
If it does the NewMinioStorage logs an error and returns. Otherwise
it keeps going knowing that BucketExists is not going to fail for
reasons unrelated to the existence of the bucket and the permissions
to access it.

(cherry picked from commit d1df4b3bc62e5e61893a923f1c4b58f084eb03af)

Refs: https://codeberg.org/forgejo/forgejo/issues/1338
10 months ago
..
helper.go Fix all possible setting error related storages and added some tests (#23911) 1 year ago
helper_test.go add path prefix to ObjectStorage.Iterator (#23332) 1 year ago
local.go Fix all possible setting error related storages and added some tests (#23911) 1 year ago
local_test.go Fix all possible setting error related storages and added some tests (#23911) 1 year ago
minio.go S3: log human readable error on connection failure (#26856) 10 months ago
minio_test.go S3: log human readable error on connection failure (#26856) 10 months ago
storage.go Replace `interface{}` with `any` (#25686) 1 year ago
storage_test.go Fix all possible setting error related storages and added some tests (#23911) 1 year ago