
Good afternoon. I tried to configure _APP_STORAGE_S3_ENDPOINT, Appwrite version 1.7.0. I tried two different providers, but on both I encountered an access error or a lack of Bucket. All accesses and stuff have been checked manually, there are no problems. Apparently, when using _APP_STORAGE_S3_ENDPOINT, Appwrite does not handle _APP_STORAGE_S3_BUCKET correctly.
The screenshots are my tests of two S3-compatible providers.
The settings of the first one are _APP_STORAGE_S3_ENDPOINT=storage.yandexcloud.net
{"message":"Storage bucket with the requested ID could not be found.","code":404,"type":"storage_bucket_not_found","version":"1.7.0"}
Settings of the second one: _APP_STORAGE_S3_ENDPOINT=s3.twcstorage.ru
{"message":"Storage bucket with the requested ID could not be found.","code":404,"type":"storage_bucket_not_found","version":"1.7.0"}
I tried to make changes to the project code. If you change the file app/init.php from 1523 to 1572, the line is as follows, then everything works without problems.
if (!empty($connection)) {
$acl = 'private';
$device = Storage::DEVICE_LOCAL;
$accessKey = '';
$accessSecret = '';
$bucket = '';
$region = '';
$endPoint = 's3.twcstorage.ru';
try {
$dsn = new DSN($connection);
$device = $dsn->getScheme();
$accessKey = $dsn->getUser() ?? '';
$accessSecret = $dsn->getPassword() ?? '';
$bucket = $dsn->getPath() ?? '';
$region = $dsn->getParam('region');
} catch (\Throwable $e) {
Console::warning($e->getMessage() . 'Invalid DSN. Defaulting to Local device.');
}
switch ($device) {
case Storage::DEVICE_S3:
return new S3($root, $accessKey, $accessSecret, $bucket, $region, $acl, 's3.twcstorage.ru');
case STORAGE::DEVICE_DO_SPACES:
$device = new DOSpaces($root, $accessKey, $accessSecret, $bucket, $region, $acl);
$device->setHttpVersion(S3::HTTP_VERSION_1_1);
return $device;
case Storage::DEVICE_BACKBLAZE:
return new Backblaze($root, $accessKey, $accessSecret, $bucket, $region, $acl);
case Storage::DEVICE_LINODE:
return new Linode($root, $accessKey, $accessSecret, $bucket, $region, $acl);
case Storage::DEVICE_WASABI:
return new Wasabi($root, $accessKey, $accessSecret, $bucket, $region, $acl);
case Storage::DEVICE_LOCAL:
default:
return new Local($root);
}
} else {
switch (strtolower(System::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL) ?? '')) {
case Storage::DEVICE_LOCAL:
default:
return new Local($root);
case Storage::DEVICE_S3:
$s3AccessKey = System::getEnv('_APP_STORAGE_S3_ACCESS_KEY', '');
$s3SecretKey = System::getEnv('_APP_STORAGE_S3_SECRET', '');
$s3Region = System::getEnv('_APP_STORAGE_S3_REGION', '');
$s3Bucket = System::getEnv('_APP_STORAGE_S3_BUCKET', '');
$s3EndPoint = 's3.twcstorage.ru';
$s3Acl = 'private';
return new S3($root, $s3AccessKey, $s3SecretKey, $s3Bucket, $s3Region, $s3Acl, $s3EndPoint);```

S3 Bucket Error

Was this previously working on 1.6.2?

In version 1.6.2, _APP_STORAGE_S3_ENDPOINT did not work, the documentation also states that you should use >1.7 The code that I have attached works in 1.6.2

Oh, whoops - sorry

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).

Thanks, I've updated the code)
Recommended threads
- I need urgent help - Error upgrading to ...
Hey guys, how are you? I waited for the self-hosted documentation to update so I could update my appwrite version to version 1.7.2. I ran the upgrade command ...
- Upgrade from 1.6.2 to 1.7.2 error during...
I just went through the process of upgrading my selfhosted instance from `1.6.2` to `1.7.2`: ``` docker run -it --rm \ --volume /var/run/docker.sock:/var/r...
- Search queries
do any of yall know how to properly search for single words in a name of a document? for example if the name is `Tape PP-Solvent 50mm/100m 28μm White`, I want ...
