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

Receiving 403 response when downloading dynamodb_local_latest.tar.gz from s3 bucket #79

Closed
katesclau opened this issue Mar 3, 2023 · 10 comments

Comments

@katesclau
Copy link

katesclau commented Mar 3, 2023

Hey 👋

My first contribution here - seems to be a regression of #37

latest tar.gz was updated yesterday

<ContentsContents>
  <Key>dynamodb_local_latest.tar.gz</Key>
  <LastModified>2023-02-02T18:02:28.000Z</LastModified>
  <ETag>"265a5d3d71889672d30e2bce91e83387-6"</ETag>
  <Size>42739735</Size>
  <StorageClass>STANDARD</StorageClass>
</Contents>

But starting dynamodb fails with

Started downloading dynamodb-local from http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz into .../.dynamodb. Process may take few minutes.
✖ Uncaught exception
Environment: linux, node 14.17.0, framework 3.24.1 (local), plugin 6.2.2, SDK 4.3.2
Credentials: Local, "..." profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: Error getting DynamoDb local latest tar.gz location undefined: 403
    at ClientRequest.<anonymous> (/.../node_modules/dynamodb-localhost/dynamodb/installer.js:29:15)

Unsure who owns the s3 bucket, but it is not reachable programmatically, but reachable through browser download https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz

Checking if we are missing any headers

@dough654
Copy link

dough654 commented Mar 3, 2023

This appears to be an issue where the file is not accessible via HTTP, but is available via HTTPS. This is causing issues in downstream packages as well such as serverless-dynamodb-local.

Looks like the URL is hard coded here as of now. https://github.com/99x/dynamodb-localhost/blob/63eb919715496950a64272eb62f36e18fa12737a/dynamodb/config.json#LL3C10-L3C10

@katesclau
Copy link
Author

That's our case - what we did to mitigate the issue is to upload to our s3 bucket and update the config.json

@sachet-mittal
Copy link

#78 (review) fixes this issue

@lukasapp
Copy link

lukasapp commented Mar 6, 2023

For now, I created a work around.

Instead of call serverless dynamodb install you can use following script:

curl <download URL> --output dynamodb.tar.gz
mkdir ./.dynamodb
tar -zxf dynamodb.tar.gz --directory ./.dynamodb

You can find the download URL for your region here. (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html)
Replace <download URL> in the snipped with your selected URL. Just make sure to select the .tar.gz link.

@katesclau
Copy link
Author

Fixed in #78 🎉

@huseyin-caglayan-cko
Copy link

Why mark this as fixed? The PR is still open.

@jonnixt17
Copy link

Also, when will this become available via NPM?

@vkarponen
Copy link

Ping @AshanFernando can we have a version bump to get this live please?

@Alavi1412
Copy link

I am still getting this error:

Started downloading dynamodb-local from http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz into /home/user/Desktop/tractatus/api-management-service/.dynamodb. Process may take few minutes.
✖ Uncaught exception
Environment: linux, node 20.2.0, framework 3.32.2 (local) 3.32.2v (global), plugin 6.2.3, SDK 4.3.2
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

My package.json:

"devDependencies": {
    "serverless-dynamodb-local": "^0.2.40",
    "serverless-python-requirements": "^6.0.0",
    "serverless-wsgi": "^3.0.1"
  }

@gothriveandy
Copy link

I'm still getting this error:

Started downloading dynamodb-local from http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz into C:\Sites\GoThrive\gothrive.web\gothrive-serverless-http-api.dynamodb. Process may take few minutes.
× Uncaught exception
Environment: win32, node 18.16.0, framework 3.35.2, plugin 7.0.5, SDK 4.4.0
Credentials: Serverless Framework Provider: "default" (https://app.serverless.com/gothrive/apps/gothrive-serverless-http-api/gothrive-serverless-http-api/dev/us-east-1/providers)
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues

Error:
Error: Error getting DynamoDb local latest tar.gz location undefined: 403

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

9 participants