Git Product home page Git Product logo

Comments (6)

kukhariev avatar kukhariev commented on September 18, 2024

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.

Aviico2 avatar Aviico2 commented on September 18, 2024

I tried with forcePathStyle: false but it also did not work same error was thrown.

from node-uploadx.

kukhariev avatar kukhariev commented on September 18, 2024

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.

Aviico2 avatar Aviico2 commented on September 18, 2024

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.

kukhariev avatar kukhariev commented on September 18, 2024

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.

Aviico2 avatar Aviico2 commented on September 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.