Comments (6)
Hello.
I can't test Spaces right now, but according to this link, you need to set forcePathStyle: false
example:
const config = {
// s3 client options:
forcePathStyle: false, // Configures to use subdomain/virtual calling format.
endpoint: `https://${process.env.SPACES_REGION}.digitaloceanspaces.com`,
region: 'us-east-1',
credentials: {
accessKeyId: process.env.SPACES_KEY,
secretAccessKey: process.env.SPACES_SECRET
},
// uploadx storage options:
bucket: process.env.S3_BUCKET,
expiration: { maxAge: '1h', purgeInterval: '15min' },
onComplete: file => 'completed',
filename: file => file.originalName
};
from node-uploadx.
I tried with forcePathStyle: false
but it also did not work same error was thrown.
from node-uploadx.
It is possible that the process.env.ENDPOINT
value is set incorrectly.
add loglevel: 'debug'
to the configuration and look at the endpoint log value, it should be https://nyc1.digitaloceanspaces.com
.
from node-uploadx.
Log after adding logLevel: 'debug'
:
2023-10-25T17:08:09.515Z DEBUG uploadx: S3Storage config: { endpoint: 'https://xxxx.digitaloceanspaces.com', bucket: 'xxx', region: 'xxxx', apiVersion: '2006-03-01', credentials: { accessKeyId: 'xxx', secretAccessKey: 'xxx' }, logLevel: 'debug', forcePathStyle: false, expiration: { maxAge: '1h', purgeInterval: '15min' }, onComplete: [Function: onComplete], filename: [Function: filename], logger: [class BasicLogger] }
Still some error:
Error: getaddrinfo ENOTFOUND xxx.s3.xxxx.amazonaws.com at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'xxx.s3.xxxx.amazonaws.com', '$metadata': { attempts: 1, totalRetryDelay: 0 } }
from node-uploadx.
I can't reproduce this error with "amazonaws.com".
Requests go correctly to 'nyc3.digitaloceanspaces.com':
import * as express from 'express';
import { uploadx } from '@uploadx/core';
import { S3Storage } from '@uploadx/s3';
const app = express();
const storage = new S3Storage({
endpoint: 'https://nyc3.digitaloceanspaces.com',
forcePathStyle: false,
region: 'eu-west',
credentials: {
accessKeyId: 'xxx',
secretAccessKey: 'xxxx'
},
bucket: 'testing-uploadx',
onComplete: file => console.log('File upload complete: ', file),
logLevel: 'debug'
});
app.use('/files', uploadx({ storage }));
app.listen(3002);
from node-uploadx.
Thanks for this response problem is solved. The problem is getting files from the bucket, not in @uploadx/s3. working fine now.
from node-uploadx.
Related Issues (19)
- UnhandledPromiseRejectionWarning on HTTP Errors
- indirect dependency "node-forge" contain vulnerability HOT 2
- Action Required: Fix Renovate Configuration
- npm is crashing when trying to resume the upload HOT 3
- How to run functions and change response data HOT 8
- Validation error response HOT 2
- Limit chunk upload HOT 1
- Client for React HOT 2
- Dependency Dashboard
- How i handle a upload progress and resume events? HOT 3
- adapt upload for koa2?
- NODE-UPLOADX + .HTACCESS configuration. HOT 2
- Are checksum used to verify upload? HOT 3
- Metadata updates are not saved on disk
- Broken custom `onComplete` response
- S3 direct upload: custom cache/etag storage HOT 4
- ensureFile fsMkdir exists error HOT 1
- [Help wanted] Module 'node-uploadx/lib/core' has no exported member 'Range' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-uploadx.