Like the title says. It just spits back a missing region error or expects to concatenate the region with a AWS endpoint that I have nothing to do with.
The question being: am I doing this correctly if I want to use something like Backblaze S3 bucket storage?
As in, do you use the storage-s3 plugin for non-AWS specific solutions?
There are people using min.io and cloudflare R2 successfully
What do the backblaze docs say for configuring the region?
the region goes directly in to the url. Also the endpoint does not get respected. It actually tries to call the AWS endpoint/api.
[15:58:35] ERROR: There was an error while uploading files corresponding to the collection media with filename images.png:
[15:58:35] ERROR: getaddrinfo ENOTFOUND s3.us-west.amazonaws.com
err: {
"type": "Error",
"message": "getaddrinfo ENOTFOUND s3.us-west.amazonaws.com",
"stack":
Error: getaddrinfo ENOTFOUND s3.us-west.amazonaws.com
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17)
"errno": -3008,
"code": "ENOTFOUND",
"syscall": "getaddrinfo",
"hostname": "s3.us-west.amazonaws.com",
"$metadata": {
"attempts": 1,
"totalRetryDelay": 0
}
}
[15:58:35] ERROR: Error: getaddrinfo ENOTFOUND s3.us-west.amazonaws.com
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17)
POST /api/media?depth=0&fallback-locale=null 500 in 163ms plugins: [
//@ts-ignore
s3Storage({
collections: {
['media']: true
},
//@ts-ignore
bucket: process.env.S3_BUCKET,
config: {
credentials: {
//@ts-ignore
accessKeyId: process.env.S3_ACCESS_KEY_ID,
//@ts-ignore
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
},
endpoint: process.env.S3_ENDPOINT,
region: process.env.S3_REGION,
forcePathStyle: true
},
}),
],What is the endpoint set to?
And region is set to us-west-004?
umm. This may be something really dumb. Assuming console logs work in payload config, I am getting undefined when I try and echo out the endpoint.
Their example seems straightforward here
https://www.backblaze.com/docs/cloud-storage-use-the-aws-sdk-for-javascript-v3-with-backblaze-b2O.M.F.G. there was a typo in the
**env file
you .. have to be .. just kill me.
lol
😆
says invalid url but I can work with that
there we go. "media saved successfully"
Welp. I'm dumb. Thanks for you help!
Glad we figured it out!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.