Plugin fails because of wrong installation path
See original GitHub issueIssue Description
Actual Behaviour
Plugin silently failing at installation
sls dynamodb install
Expected Behaviour
Some feedback when it fails.
Steps to reproduce it
- serverless
1.30.1
- macOS High Sierra
10.13.4
- Node
v7.2.1
$ serverless create --template aws-python3 --path python-dynamo-tmp
...
$ npm install --save serverless-dynamodb-local
...
sls dynamodb install
Installing dynamodb does nothing.
This is my serverless.yml
service: python-dynamo-tmp
provider:
name: aws
runtime: python3.6
plugins:
- serverless-dynamodb-local
LogCat for the issue
After several hours of a headache since I just started looking into serverless and I’m not a Node.js developer it occurred to me to search the code base for something and I landed on the utils.js
inside $project_path/node_modules/dynamodb-localhost/dynamodb/
and I added console.log(..
to print out the absolute path of the installation folder since nothing was being created and nothing was being printed to the terminal, this was the output…
/Users/fcastellanos/Projects/serverless/python-dynamo-tmp/node_modules/dynamodb-localhost/dynamodb//Users/fcastellanos/Projects/serverless/python-dynamo-tmp/.dynamodb
Which was weird so what I did was to rewrite the absPath
to just return the relPath
parameter…
var absPath = function (relPath) {
return relPath;
};
After that change I ran again the installation again but now successfully creating the .dynamodb
directory in my project’s path, but now whenever I try to start the dynamodb service I get this…
$ sls dynamodb start
Dynamodb Local Started, Visit: http://localhost:8000/shell
Error: Unable to access jarfile DynamoDBLocal.jar
DynamoDB Local failed to start with code 1
I added a bunch more loggers all over the place and ended up in $project_path/node_modules/dynamodb-localhost/dynamodb/config.json
where the install_path
is just /bin
so I changed it to…
{
"setup": {
"download_url": "http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz",
"install_path": "/Users/fcastellanos/Projects/serverless/python-dynamo-tmp/.dynamodb",
"jar": "DynamoDBLocal.jar"
},
"start": {
"port": 8000
}
}
After making those changes everything works, I mean, I run sls dynamodb start
without any errors and I can even go to http://localhost:8000/shell and see the DynamoDB Web Shell
Would you like to work on the issue?
I’m no node.js developer or serverless expert but I can help however I can.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:9
@fcastellanos I found the same issue with serverless version 1.30.1 and serverless-dynamodb-local version 0.2.31.
Downgrading serverless-dynamodb-local to version 0.2.30 fixed the issue.
Visiting here from stack overflow. I have been on v
0.2.35
with no problems until today with the release of0.2.36
. I am staying on 35 and watching this for resolution.