Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter does't work with ap-east-1 (HK) #139

Open
vitalii-bulyzhyn opened this issue Jan 24, 2021 · 7 comments
Open

Adapter does't work with ap-east-1 (HK) #139

vitalii-bulyzhyn opened this issue Jan 24, 2021 · 7 comments

Comments

@vitalii-bulyzhyn
Copy link

There is the issue with adapter: if I'm using with it ap-east-1 (HK) region - I can upload image without problems, however when I get wrong URL to access it.

The url does not specify region. Perfectly works with other regions

@mtrezza
Copy link
Member

mtrezza commented Jan 24, 2021

Thanks for reporting.

We need more details to analyze this. Can you give example results for working and non-working regions, to clearly describe what difference you are observing and why it is not working?

@vitalii-bulyzhyn
Copy link
Author

@mtrezza
Copy link
Member

mtrezza commented Jan 26, 2021

Can you please also share your S3 adapter configuration?

@vitalii-bulyzhyn
Copy link
Author

vitalii-bulyzhyn commented Jan 26, 2021

Yes, of course

var s3Adapter = new S3Adapter(
process.env.AWS_ACCESS_KEY,
process.env.AWS_SECRET_KEY,
process.env.S3_BUCKET_NAME,
{
region: process.env.S3_REGION,
directAccess: true,
signatureVersion: 'v4',
},
);

@mtrezza
Copy link
Member

mtrezza commented Jan 27, 2021

How do you use the adapter in the context of Parse Server?
Is the S3 adapter configuration not part of your Parse Server configuration?

filesAdapter: {
  module: "@parse/s3-files-adapter",
  options: {
      bucket: ...,
      region: ...,
      bucketPrefix: ...,
      baseUrl: ...,
      signatureVersion: "v4",
  }
},

@vitalii-bulyzhyn
Copy link
Author

This is how it is:

var s3Adapter = new S3Adapter(
process.env.AWS_ACCESS_KEY,
process.env.AWS_SECRET_KEY,
process.env.S3_BUCKET_NAME,
{
region: process.env.S3_REGION,
directAccess: true,
signatureVersion: 'v4',
},
);

var api = new ParseServer({
databaseURI: databaseUri,
cloud: process.env.CLOUD_CODE_MAIN,
masterKey: process.env.MASTER_KEY,
serverURL: process.env.SERVER_URL,
filesAdapter: s3Adapter,
});

@mtrezza
Copy link
Member

mtrezza commented Jan 27, 2021

I would look into whether the way you initialize makes any difference. From your code it's not clear which adapter repo you are using. Either way, I suggest you take a look at the region parameter and how the URL is composed in the adapter. I would imagine the logic to be region-agnostic, but according to your description, it works for you if you change the region, so something doesn't add up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants