serverless-dynamodb-local icon indicating copy to clipboard operation
serverless-dynamodb-local copied to clipboard

serverless dynamodb install fails

Open daviskoh opened this issue 8 years ago • 11 comments
trafficstars

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 https://github.com/99xt/serverless-dynamodb-local/issues/70 & https://github.com/99xt/serverless-dynamodb-local/issues/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?

daviskoh avatar Aug 21 '17 21:08 daviskoh

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

rehrumesh avatar Aug 23 '17 03:08 rehrumesh

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

lakindu95 avatar Aug 23 '17 04:08 lakindu95

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 avatar Aug 23 '17 18:08 daviskoh

nvm...

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

daviskoh avatar Aug 23 '17 20:08 daviskoh

Same.

nadeemja avatar Sep 10 '17 15:09 nadeemja

Solved by yarn add [email protected]

nadeemja avatar Sep 10 '17 15:09 nadeemja

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

Kazolah avatar May 13 '18 02:05 Kazolah

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)

muswain avatar Oct 10 '18 10:10 muswain

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.

scionwest avatar Mar 16 '19 22:03 scionwest

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

rallarsvingen avatar Mar 20 '19 15:03 rallarsvingen

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

GuerreiroLeonardo avatar Jul 08 '23 00:07 GuerreiroLeonardo