I also see that they say to set the use_path_style_endpoint to true, as we do not support this feature yet, could you try to edit this file and add this option in the $options variable?
twake/backend/core/src/Twake/Drive/Services/Storage/Adapter_AWS.php
I also see that we build the bucket name like this: “[bucket-prefix]twake.[bucket-region]”
It would be very great to have feedback on this if you have time, if not I will add this option but it will not be available before 3 weeks.
Thanks a lot for your warm words about Twake,
Romaric
Thank you very much for getting back to me. I fully understand you might be overwhelmed by all the requests and I’m grateful you’re looking into my issue.
I’ve made the modifications you’ve suggested
And reading the modified Adapter_AWS.php code makes perfect sense.
However, when trying to upload a file to drive, 0% gets uploaded and the windows progress bar is red
Quick question regarding implementation of updated code:
I ran these commands : sudo docker-compose stop
Then integrated your code update in Adapter_AWS.php and also saved Parameters.php, please see both versions down below.
then executed these commands :
sudo docker-compose up -d
sudo docker-compose exec nginx yarn build
Are these commands enough?
Thank you again for your assistance Romaric! Really appreciated.
Seeing I couldn’t upload files and S3 integration wasn’t working yet, I updated Parameters.php again with these entries as to deactivate S3 for now, and continue the use of legacy Drive functions.
Interestingly, I can download previously uploaded files, however uploading new files doesn’t work anymore. - Any suggestion?
Many thanks again for your time!
UPDATE:
It all works perfectly fine setting up True/False - I was impatient
For the local bucket mode, try to set the acces rights to your drive volume (with chmod 777) and tell me if it works again.
For the S3 mode, you need to enter “development mode” for docker (tell docker to use the hosts php files instead of the image ones). Here is the procedure:
Add this volume to php service in docker-compose.yml:
- ./backend/core/:/twake-core:cached
At this time your modifications to Adapter_S3 should be took into account.
Please changes both
twake/backend/core/src/Twake/Drive/Services/OldFileSystem/Adapter_AWS_DriveFileSystem.php
and
twake/backend/core/src/Twake/Drive/Services/Storage/Adapter_AWS.php
Like in this commit:
So far, having implemented all the code update you’ve detailed, It seems that files aren’t going through to minIO S3 storage.
Checking logs\nginx\twakeapp_dev_error.log, attempting to upload a file generates the error below:
2021/01/14 18:31:38 [error] 10#10: *484 FastCGI sent in stderr: "PHP message: InvalidArgumentException: Endpoints must be full URIs and include a scheme and host in /twake-core/vendor/aws/aws-sdk-php/src/ClientResolver.php:669
Being after this for half day already, I’m giving it a break.
However if there is any option for you were you could take over my machine over SSH, I’m at your service to debug Twake S3 integration.
Hopefully you’ll have any useful suggestion to assist me into debugging this.
Hi, I’m working on this part of Twake so I’m ready to help you on this. A ssh access would be very great of course, but you can already get more information on the error with this command:
sudo docker-compose logs -f --tail 100 php
It will give you the php logs, according to the error you see in nginx, there is some url the AWS SDK cannot build, I still don’t know why.
You can also try to put the code from Minio in the __construct part of Adapter_AWS.php and see if you can create a single file on minio:
$s3 = new Aws\S3\S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'endpoint' => 'http://localhost:9000',
'use_path_style_endpoint' => true,
'credentials' => [
'key' => 'YOUR-ACCESSKEYID',
'secret' => 'YOUR-SECRETACCESSKEY',
],
]);
// Send a PutObject request and get the result object.
$insert = $s3->putObject([
'Bucket' => 'testbucket',
'Key' => 'testkey',
'Body' => 'Hello from MinIO!!'
]);
If this works, I suggest to add error_log(json_encode($option)); variable just before the new S3Client($options) line and compare with the configuration you should have.
If this is too difficult or you don’t have time, you can give me access to your machine by PM, I will try to test and fix this today.
Just to give feedback to anyone following this thread:
Romeric and I have been working on S3 integration over the last couples days.
A few bugs are currently being ironed out by Romaric and Twake awesome team about S3 buckets and read/write operations.
Twake is definitively worth the wait for those willing to run on premises services!