I have deployed S3 file storage (https://github.com/minio/minio) on my server. I’m trying to work with him in Wappler. However, errors occur at certain steps. For example, when trying to Put a file to the repository (Put File), the following error occurs:
At the same time, the step of getting a list of files in the buckets (S3 List Files) is working fine. The step of getting a buckets list (S3 List Buckets) also works fine.
Is there any way to fix the work with minio in those steps where errors occur?
There is no middleware. Most likely you didn’t fully understand what I’m talking about. MinIO is not an intermediate software for working with S3, it is S3, which can be installed on your server. For connection and requests, I use the Wappler steps that you gave above.
As per the error, minio could not parse the request body. Maybe its not XML or not what minio is expecting?
Try using an external tool to connect and upload files - like S3 browser for Windows. For mac I think cyberduck could work.
If it works there, then it could be a Wappler specific problem.
I did the testing as you recommended. This is a specific Wappler problem. Everything works fine through S3 browser for Windows. Creating new buckets, uploading files:
With the help of a Wappler, some of the steps, as I wrote above, work absolutely correctly. I can get a list of buckets, I can get a list of files in a specific bucket.
Default configuration of min.io is the use “Path-style” request and not “Virtual-hosted–style”. And looks like that Wappler use the method Virtual-hosted.
Obtaining buckets doesn’t affect how the component query with the right credentials and endpoint, but for obtain files looks like a Wappler error.
I have already testing with a min.io installation using cloudron.io this allow directly install mini.io as an app that comes ready to use.
Obtaining buckets not a problem in Wappler, but listing files cause the error, and that is what I suppose the problem comes from virtual-hosted method that Wappler use to connected in s3 API.
A temporal workaround is to add “forcePathStyle” into app.js file. This will force to work with default min.io configuration with Path Style and not Virtual-Hosted:
Wappler version 5.5.3
File
/lib/core/app.js
In line 433 after signatureVersion add forcePathStyle to true.
Now Wappler will force to addressing using “Path Style” and all works.
Of course after next Wappler update this modification to app.js file will dissapear.
The correct way is to proper config min.io to allow the use of virtual-hosted and not path style, because this is deprecated.
But looks like is a bit complicated to made minio work with virtual-hosted, at least for me, I have tried differents configuration but I can’t made it wo work.
Hello Alexander! I confirm that all of the above is true and you have found a great workaround! Although I try not to touch or change the core files, but it turned out to be much more efficient than building a separate server extension for MinIO based on the library https://github.com/minio/minio-js With your solution, just one property makes all the steps of the Wappler with MinIO work correctly.
I guess the most feasible option is for the Wappler Team to implement it in native way and allow to choose from virtual-hosted and path style. This change is really minimum and I don’t think that could affect to other s3 connections.