Open mzur opened 1 year ago
The validation could be done with the created user disk here:
and here:
If the validation failed, the changes should be reverted.
The validation can probably only be done after the disk is created because it needs an ID to create the "temporary storage disk", so the validation cannot be done in the form request classes.
There was this error with an incorrectly entered endpoint URL (missing the bucket name):
"message" => """
Unable to list contents for '', shallow listing
Reason: Error executing "ListObjectsV2" on "https://s3.us-east-005.backblazeb2.com/?list-type=2&prefix=&delimiter=%2F"; AWS HTTP error: Client error: `GET https ▶
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error>
<Code>AccessDenied</Code>
<Message>not entitled< (truncated...)
AccessDenied (client): not entitled - <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error>
<Code>AccessDenied</Code>
<Message>not entitled</Message>
</Error>
"""
"context" => array:2 [▼
"userId" => xxx
"exception" => array:6 [▶]
]
"level" => 400
"level_name" => "ERROR"
"channel" => "production"
"datetime" => "2023-09-06T19:26:08.359622+02:00"
"extra" => []
Errors like these should produce a meaningful error message to the user, too (e.g. "access denied" in this case).
We had an error
Unable to list contents
for an S3 disk. Maybe there was a typo in the URL. We should add a validation with a "list contents" call to check if any files can be listed with a new storage disk. If not, throw a vaildation error.