Filestore S3 - Custom Endpoint

im using Minio S3 compatible storage
FreePBX 15.0.37.8
Filestore 15.0.9

here is an example of settings:


so when I’m trying to backUp it FreePBX is incorrectly appending the bucket name (bucket) to the MinIO server’s IP address (89.89.89.89:9000). This results in an invalid hostname (bucket.89.89.89.89:9000), which causes the cURL error 6 (Could not resolve host).

Exporting KVStore from Core
	Adding file to tar: files/tmp/Devices_dump/Devices.sql
	Adding module manifest for core
	Adding custom directory to tar: customdir/etc/asterisk
Starting Cleaning up
Cleaning up data generated by Core
	Removing /tmp/Devices_dump
Finished Cleaning up
Finished created backup file: 20240911-094354-1726073034-15.0.37.8-1473605231.tar.gz
Performing Local Maintenance
Finished Local Maintenance
Performing Remote Maintenance
Error executing "ListObjects" on "http://bucket.89.89.89.89:9000/?prefix=&delimiter=%2F&encoding-type=url"; AWS HTTP error: cURL error 6: Could not resolve host: bucket.89.89.89.89; Unknown error (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Finished Remote Maintenance
Saving to selected Filestore locations
Error executing "ListObjects" on "http://bucket.89.89.89.89:9000/?prefix=20240911-094354-1726073034-15.0.37.8-1473605231.tar.gz%2F&max-keys=1&encoding-type=url"; AWS HTTP error: cURL error 6: Could not resolve host: bucket.89.89.89.89; Unknown error (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Finished Saving to selected Filestore locations
There were errors during the backup process
	Error executing "ListObjects" on "http://bucket.89.89.89.89:9000/?prefix=&delimiter=%2F&encoding-type=url"; AWS HTTP error: cURL error 6: Could not resolve host: bucket.89.89.89.89; Unknown error (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
	Error executing "ListObjects" on "http://bucket.89.89.89.89:9000/?prefix=20240911-094354-1726073034-15.0.37.8-1473605231.tar.gz%2F&max-keys=1&encoding-type=url"; AWS HTTP error: cURL error 6: Could not resolve host: bucket.89.89.89.89; Unknown error (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

i believe that URL from the Backup module
should be
http://89.89.89.89:9000/bucket
but for some reason Freepbx is trying to use ```
http://bucket.89.89.89.89:9000/

The module uses PHP League Flysystem and abstracts it out. Their module is based on the s3 standards with a primary focus on how amazon implements it.

Edit: Looking at the code you can set this as a parameter

bucket_endpoint: (bool) Set to true to send requests to a hardcoded bucket endpoint rather than create an endpoint as a result of injecting the bucket into the URL. This option is useful for interacting with CNAME endpoints. Note: if you are using version 2.243.0 and above and do not expect the bucket name to appear in the host, you will also need to set use_path_style_endpoint to true.

So you will want to open a feature request to make that a setting probably that is passed to Aws\S3\S3Client

thanks
sorted by switching on the use of Virtual-Hosted Style on my Minio Server
and change the Endpoint to DNS name

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.