diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index 082cceaa9de9b..c085bbc76e4ac 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -174,7 +174,11 @@ public function getConnection() { try { $logger->info('Bucket "' . $this->bucket . '" does not exist - creating it.', ['app' => 'objectstore']); if (!$this->connection::isBucketDnsCompatible($this->bucket)) { - throw new StorageNotAvailableException('The bucket will not be created because the name is not dns compatible, please correct it: ' . $this->bucket); + throw new StorageNotAvailableException( + 'The bucket name "' + . $this->bucket + . '" is not valid for S3. Bucket names must be DNS-compatible: use lowercase letters, numbers, dots (.), and hyphens (-).' + ); } $this->connection->createBucket(['Bucket' => $this->bucket]); Server::get(IEventDispatcher::class)