Skip to content

[files_external] Wrong setup of S3 options #58882

@susnux

Description

@susnux

I might have found the issue. After looking at the requests the frontend sends. I noticed that there is a mismatch in required parameters. In my case it was a S3 mount for which I was not able to do modifications.

So the request it does looks like this

{"id":3,"mountPoint":"/R2","backend":"amazons3","authMechanism":"amazons3::accesskey","backendOptions":{"bucket":"<redacted>","storageClass":"","legacy_auth":false,"useMultipartCopy":true,"key":"<redacted>","secret":"__unmodified__","use_path_style":true,"hostname":"<redacted>.r2.cloudflarestorage.com","region":"auto","sse_c_key":"__unmodified__","encrypt":"1","port":"","use_ssl":true},"priority":100,"applicableUsers":["sample-user"],"mountOptions":{"encrypt":"1","previews":"1","enable_sharing":"","filesystem_check_changes":"1","encoding_compatibility":"","readonly":""},"userProvided":false,"type":"system"}

After sending this I got
{
"message": "Unbefriedigende Backend- Parameter"
}

Which lead to the conclusion that some parameters of the backend were not present in the request

And after looking at

(new DefinitionParameter('use_presigned_url', $l->t('Use presigned S3 url')))
->setType(DefinitionParameter::VALUE_BOOLEAN)
->setDefaultValue(false),

The parameter use_presigned_url does have a default but is not defined as optional.

When replaying the request I added "use_presigned_url":false, to the backendOptions json part and then it worked.
Also subsequent requests from the UI now work for this mount.

Additionally when toggling the "use_presigned_url" config once in the UI when creating a new mount also places this key in the JSON and it worked immediately for me.

So my suspicion is that every mount which gained some parameters which have a default but are not optional could be affected by this. That's also the reason why "Local" mounts always worked because they only consist of required parameters.

Originally posted by @iCaotix in #53472

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions