99x / dynamodb-localhost

Dynamodb localhost runner for development and testing
MIT License
35 stars 92 forks source link

Error downloading Dynamodb ECONNREFUSED #7

Closed csi-lk closed 7 years ago

csi-lk commented 7 years ago

During installation step, download is failing, where is it downloading from?

(using serverless-dynamodb-local)

Full stack trace:

sls dynamodb install
[Error: Error getting DynamoDb local latest tar.gz location: 404]
/Users/csilk/dev/project/node_modules/dynamodb-localhost/dynamodb/installer.js:43
                    throw Error("Error in downloading Dynamodb local " + err);
                    ^

Error: Error in downloading Dynamodb local Error: connect ECONNREFUSED 127.0.0.1:80
    at Error (native)
    at ClientRequest.<anonymous> (/Users/csilk/dev/project/node_modules/dynamodb-localhost/dynamodb/installer.js:43:27)
    at emitOne (events.js:90:13)
    at ClientRequest.emit (events.js:182:7)
    at Socket.socketErrorListener (_http_client.js:262:9)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at emitErrorNT (net.js:1246:8)
    at nextTickCallbackWith2Args (node.js:475:9)
    at process._tickDomainCallback (node.js:430:17)
$ sls dynamodb install
[Error: Error getting DynamoDb local latest tar.gz location: 404]
/Users/csilk/dev/project/node_modules/dynamodb-localhost/dynamodb/installer.js:43
                    throw Error("Error in downloading Dynamodb local " + err);
                    ^

Error: Error in downloading Dynamodb local Error: connect ECONNREFUSED 127.0.0.1:80
    at Error (native)
    at ClientRequest.<anonymous> (/Users/csilk/dev/project/node_modules/dynamodb-localhost/dynamodb/installer.js:43:27)
    at emitOne (events.js:90:13)
    at ClientRequest.emit (events.js:182:7)
    at Socket.socketErrorListener (_http_client.js:262:9)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at emitErrorNT (net.js:1246:8)
    at nextTickCallbackWith2Args (node.js:475:9)
    at process._tickDomainCallback (node.js:430:17)
csi-lk commented 7 years ago

Found the URL in config.json, weird thing is it downloads fine over curl...

curl "http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz" -o "dynamodb_local.tar.gz"

peterfotinis commented 7 years ago

This is weird, I was getting a 404 after visiting the URL this morning. Regardless, the code is looking for a 302 response then downloading from the new location. That URL is returning 200 without a redirect now.

Little workaround for those also using the serverless-dynamodb-local plugin, add npm-shrinkwrap.json in your root project directory with the following:

{
  "name": "npm-project-name-here",
  "version": "1.0.0",
  "dependencies": {
    "serverless-dynamodb-local": {
      "version": "^0.2.17",
      "dependencies": {
        "dynamodb-localhost": {
          "from": "https://github.com/peterfotinis/dynamodb-localhost.git"
        }
      }
    }
  }
}
jch254 commented 7 years ago

@peterfotinis thank you!

csi-lk commented 7 years ago

@peterfotinis, thanks mate great workaround

in case anyone else didn't know about npm shrinkwrap when in your project dir run

npm shrinkwrap

then add the:

      "dependencies": {
        "dynamodb-localhost": {
          "from": "https://github.com/peterfotinis/dynamodb-localhost.git"
        }
      }

to serverless-dynamodb-local's part of the npm-shrinkwrap.json file 👍

csi-lk commented 7 years ago

6 has been merged so now just need new release + NPM update

AshanFernando commented 7 years ago

@Si1kIfY New dynamodb-localhost (0.0.5) updated to npm and also added the newest version to severless-dynamodb-local (0.2.16)

@peterfotinis Thanks for the PR

csi-lk commented 7 years ago

Thanks @AshanFernando, closing....

ByteCommander commented 7 years ago

Seems like Amazon changed their URLs and we have the same issue again?

yashutanna commented 5 years ago

getting the same issue now. been working fine all day...

https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz yields a 403 when doing an sls dynamodb install