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

Reading S3 bucket fails with error URL is not a valid S3 compliant URL #389

Open
Subhajit97 opened this issue Oct 25, 2022 · 3 comments
Open

Comments

@Subhajit97
Copy link

Subhajit97 commented Oct 25, 2022

Hi! I am trying to read a non-public S3 bucket created in my AWS account with url = s3::https://s3.us-east-1.amazonaws.com/my_bucket/test_folder?aws_access_key_id=ACCESS_KEY&aws_access_key_secret=SECRET and received the following error:

URL is not a valid S3 compliant URL

I had a look at https://github.com/hashicorp/go-getter#s3-bucket-examples and https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html, but I'm not sure what syntax to use especially for buckets which are not public.

Is there anything I'm missing in the above example?

@ghost
Copy link

ghost commented Nov 10, 2022

@Subhajit97,
Not a hashicorp member, but I think since you're passing in parameters you need doublequotes around the whole thing ie "s3::https://s3.us-east-1.amazonaws.com/my_bucket/test_folder?aws_access_key_id=ACCESS_KEY&aws_access_key_secret=SECRET"

I've currently got a PR #394 updating the s3 formats, if you want to take a look at alternate s3 uri formats

@Subhajit97
Copy link
Author

Subhajit97 commented Nov 10, 2022

Thanks, @twunderlich-grapl! the example URI formats are helpful.
I was able to make the URL work. I'm using the below format:

s3::https://bucket.s3.us-east-1.amazonaws.com/folder?aws_profile=my-profile

But, when I use the same URL by explicitly passing the access key and secret to the URL, for example:

s3::https://bucket.s3.us-east-1.amazonaws.com/folder?aws_access_key_id=...&aws_access_key_secret=...

It fails with the below error:

error downloading 'https://bucket.s3.us-east-1.amazonaws.com/folder?aws_access_key_id=...&aws_access_key_secret=...': NoSuchKey: The specified key does not exist.
        status code: 404, request id: ..., host id: ...

Is there anything I'm missing here?

@buzzki11
Copy link

Thanks, @twunderlich-grapl! the example URI formats are helpful. I was able to make the URL work. I'm using the below format:

s3::https://bucket.s3.us-east-1.amazonaws.com/folder?aws_profile=my-profile

But, when I use the same URL by explicitly passing the access key and secret to the URL, for example:

s3::https://bucket.s3.us-east-1.amazonaws.com/folder?aws_access_key_id=...&aws_access_key_secret=...

It fails with the below error:

error downloading 'https://bucket.s3.us-east-1.amazonaws.com/folder?aws_access_key_id=...&aws_access_key_secret=...': NoSuchKey: The specified key does not exist.
        status code: 404, request id: ..., host id: ...

Is there anything I'm missing here?

I have the same issue. Do you managed to solve it or find workaround?

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