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

serverless dynamodb install fails #126

Open
daviskoh opened this issue Aug 21, 2017 · 11 comments
Open

serverless dynamodb install fails #126

daviskoh opened this issue Aug 21, 2017 · 11 comments

Comments

@daviskoh
Copy link

Node version: 6.10.30
Yarn version: 0.27.5
Serverless version: 1.20.2

serverless-dynamodb-local version: 1.0.0

Seems related to previous isses #70 & #65.

Here is the stacktrace:

$ sls dynamodb install
Error: Error getting DynamoDb local latest tar.gz location: 307
    at ClientRequest.<anonymous> (/Users/daviskoh/project/node_modules/dynamodb-localhost/dynamodb/installer.js:14:26)
    at ClientRequest.g (events.js:292:16)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:473:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
    at Socket.socketOnData (_http_client.js:362:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)
_http_client.js:54
    throw new Error('Protocol "' + protocol + '" not supported. ' +
    ^

Error: Protocol "https:" not supported. Expected "http:"
    at new ClientRequest (_http_client.js:54:11)
    at Object.exports.request (http.js:31:10)
    at Object.exports.get (http.js:35:21)
    at ClientRequest.<anonymous> (/Users/daviskoh/project/node_modules/dynamodb-localhost/dynamodb/installer.js:16:18)
    at ClientRequest.g (events.js:292:16)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:473:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
    at Socket.socketOnData (_http_client.js:362:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)
error Command failed with exit code 1.

Is this another issue w/ the dependency https://github.com/99xt/dynamodb-localhost?

@rehrumesh
Copy link
Contributor

@daviskoh We will look into this issue soon.
CC @lakindu95

@lakindu95
Copy link
Contributor

Hi daviskoh,

Did you install all the dependencies? Check the link below which might help.
https://github.com/99xt/serverless-dynamodb-local/blob/v1/.travis.yml

@daviskoh
Copy link
Author

Dont think installing dependencies directly would seem to have anything to do with this issue as older versions of this pkg installs its dependencies fine and changing that would be an odd requirement for a pkg.

It looks like it has more to do w/ perhaps AWS changing the response & request requirements to download the tar.gz file as the 0.2.24 version is able to install the latest dynamodb fine w/ the latest "dynamodb-localhost": "^0.0.5" as a dependency.

Rather it seems to be that when installing serverless-dynamodb-local 1.0.0, it seems to point to "dynamodb-localhost": "0.0.2" which has a different /dynamodb/installer.js file:

http.get(downloadUrl, function (response) {
  if (302 != response.statusCode) {
    callback(new Error('Error getting DynamoDb local latest tar.gz location: ' + response.statusCode));
  }
  http.get(response.headers.location, function (redirectResponse) {
    var len = parseInt(redirectResponse.headers['content-length'], 10),
      bar = new ProgressBar('Downloading dynamodb-local [:bar] :percent :etas', {
        complete: '=',
        incomplete: ' ',
        width: 40,
        total: len
      });
    if (200 != redirectResponse.statusCode) {
      throw new Error('Error getting DynamoDb local latest tar.gz location ' + response.headers.location + ': ' + redirectResponse.statusCode);
    }
...

which differs from 0.0.5

Perhaps this somehow has to do w/ tagging releases? The v1 branch has the latest version as 0.2.24, but the latest tag is 1.0.0.

Also, the dynamodb-localhost doesnt seem to have any release tags at all...

@daviskoh
Copy link
Author

nvm...

sls dynamodb install on "serverless-dynamodb-local": "0.2.24" fails as well...

@nadeemja
Copy link

Same.

@nadeemja
Copy link

Solved by yarn add serverless-dynamodb-local@0.2.25

@Kazolah
Copy link

Kazolah commented May 13, 2018

sls dynamodb install on "serverless-dynamodb-local": "^0.2.30" is failing too with error:
Error: Error getting DynamoDb local latest tar.gz location http://103.1.138.149/s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz: 302

@muswain
Copy link

muswain commented Oct 10, 2018

sls dynamodb install fails every time it tries to download the jar.
"serverless-dynamodb-local": "^0.2.35"

C:\Code\Workspace\cmchecklist\api\node_modules\dynamodb-localhost\dynamodb\installer.js:24
throw new Error('Error getting DynamoDb local latest tar.gz location ' + response.headers.location + ': ' + response.statusCode);
^
Error: Error getting DynamoDb local latest tar.gz location undefined: 407
at ClientRequest. (C:\Code\Workspace\cmchecklist\api\node_modules\dynamodb-localhost\dynamodb\installer.js:24:23)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:115:23)
at Socket.socketOnData (_http_client.js:440:20)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:607:20)

@scionwest
Copy link

Is there an update on this? I'm experiencing the same issue over a year after the original post was made. I don't know what I'm supposed to do in order to move forward.

@rallarsvingen
Copy link

Edit config.json, "download_url" change to https.

@GuerreiroLeonardo
Copy link

this worked for me. I wonder why the hack nobody has ever fixed this. I just lost many hour because of it

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