How to adapt strapi-provider-upload-aws-s3 for Wasabi in Strapi?

I was able to setup strapi-provider-upload-wasabi in Stripe as shown here strapi-provider-upload-wasabi - npm

But the package is deprecated and the author’s recommending to use strapi-provider-upload-aws-s3 instead.

When I try to upload file in Strapi, I’m having error: error InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.

Looks like it’s searching the Access Key in Amazon?

My settings as follows.

config/plugins.js:

module.exports = ({ env }) => ({
  upload: {
    provider: 'aws-s3',
    providerOptions: {
      accessKeyId: env('WASABI_ACCESS_KEY'),
      secretAccessKey: env('WASABI_ACCESS_SECRET'),
      region: env('WASABI_REGION'),
      params: {
        Bucket: env('WASABI_BUCKET'),
      },
    },
  },
});

.env:

WASABI_REGION=<some data1>
WASABI_BUCKET=<some data 2>
WASABI_ACCESS_SECRET=<some data 3>
WASABI_ACCESS_KEY=<some data 4>

Full error log:

[2021-07-27T11:42:42.365Z] [2021-07-27t11:42:42.363z] error InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.
    at Request.extractError (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/services/s3.js:718:35)
    at Request.callListeners (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/request.js:688:14)
    at Request.transition (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/request.js:690:12)
    at Request.callListeners (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
    at Request.emit (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/request.js:688:14)
    at Request.transition (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/askar/code/kaganat/kaganat-api/node_modules/aws-sdk/lib/request.js:38:9)
[2021-07-27T11:42:42.366Z] error Error: Internal Server Error
    at convertToStrapiError (/Users/askar/code/kaganat/kaganat-api/node_modules/strapi-plugin-upload/errors.js:38:26)
    at Object.upload (/Users/askar/code/kaganat/kaganat-api/node_modules/strapi-plugin-upload/config/functions/bootstrap.js:35:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Object.uploadFileAndPersist (/Users/askar/code/kaganat/kaganat-api/node_modules/strapi-plugin-upload/services/Upload.js:154:5)
    at async Promise.all (index 0)
    at async Object.upload (/Users/askar/code/kaganat/kaganat-api/node_modules/strapi-plugin-upload/services/Upload.js:140:12)
    at async uploadFiles (/Users/askar/code/kaganat/kaganat-api/node_modules/strapi-plugin-upload/controllers/upload/admin.js:187:27)
    at async Object.upload (/Users/askar/code/kaganat/kaganat-api/node_modules/strapi-plugin-upload/controllers/Upload.js:65:5)
    at async /Users/askar/code/kaganat/kaganat-api/node_modules/strapi/lib/middlewares/router/utils/routerChecker.js:79:22
    at async /Users/askar/code/kaganat/kaganat-api/node_modules/strapi-utils/lib/policy.js:68:5
    at async /Users/askar/code/kaganat/kaganat-api/node_modules/strapi/lib/middlewares/parser/index.js:48:23
    at async /Users/askar/code/kaganat/kaganat-api/node_modules/strapi/lib/middlewares/xss/index.js:26:9

I am facing the same issue. Would be helpful if anyone could address this issue.

Hi,
Although it’s not maintained, you can still use this one

You can use wasabi through @strapi/provider-upload-aws-s3 - npm library with endpoint option.

Add this var to .env

WASABI_ACCESS_KEY=
WASABI_SECRET_KEY=
WASABI_REGION=
WASABI_BUCKET=
WASABI_END_POINT=s3.wasabisys.com

And set provider to config/plugins.js

upload: {
  config: {
    provider: "aws-s3",
    providerOptions: {
      accessKeyId: env("WASABI_ACCESS_KEY"),
      secretAccessKey: env("WASABI_SECRET_KEY"),
      region: env("WASABI_REGION"),
      params: {
        Bucket: env("WASABI_BUCKET"),
      },
      endpoint: env("WASABI_END_POINT"),
    },
    actionOptions: {
      upload: {},
      uploadStream: {},
      delete: {},
    },
  },
},
1 Like

Glad to know the package is now being maintained.
At the time I created my post, the package was abandoned.