serverless-dynamodb-local
serverless-dynamodb-local copied to clipboard
0.2.19 -> 0.2.20 breaks serverless offline start
Upgrading from 0.2.19 to 0.2.20 and any later release breaks the command
serverless offline start
serverless offline
still works.
I'm using serverless-webpack
plugins:
- serverless-webpack
- serverless-dynamodb-local
- serverless-offline
and versions are: sls-offline: 3.15.3 serverless-webpack: 2.2.2 and I've tried other versions with same result. serverless: 1.20.2
I don't see the release tags in this repo unfortunately. Also, the error is a bit unspecific:
SLS_DEBUG=* node_modules/.bin/serverless offline start
Serverless: WARNING: Plugin ServerlessWebpack uses deprecated hook before:deploy:createDeploymentArtifacts,
use package:createDeploymentArtifacts hook instead
Serverless: WARNING: Plugin ServerlessWebpack uses deprecated hook after:deploy:createDeploymentArtifacts,
use package:createDeploymentArtifacts hook instead
Serverless: Bundling with Webpack...
Time: 2423ms
Asset Size Chunks Chunk Names
handler.js 222 kB 0 [emitted] main
Serverless: Watching with Webpack...
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
at exports._errnoException (util.js:1018:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
Error: spawn java ENOENT
That looks like the java
executable could not be found. Can it be that dynamodb-local tries to start Java?
According to the plugin requirements you need a JRE (I assume accessible through your path settings in the environment).
Not at my machine but any chance that a java related requirement could be different from 0.2.19? Latter works just fine.
On 23 Aug 2017, at 12:44, Frank Schmid [email protected] wrote:
According to the plugin requirements you need a JRE (I assume accessible through your path settings in the environment).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Try running serverless dynamodb install
.
Actually, the plugins seems to "lost" the reference to the dynamodb-local executable after any change to the package.json (after running yarn add
for example)
Randomly I get this this error. Uninstalling dynamodb and reinstalling it solves the problem. I would really like to know what the root of the problem is.
Thanks @paqman and @Toosick. Leaving this open for owners to track.
@HyperBrain a co-worker had this same error today on his Mac, then he patch upgraded Java and that went away. He got the whole webpack->db->sls instance to start, tables seeded fine, but whenever he made a post to an endpoint it would just hang. Mine is working fine, btw. Same package-lock.json, same node-modules versions. You ever find a solution?
@btburton42 I only commented here as maintainer of serverless-webpack
to add some thoughts to the issue 😄 . Originally @bebbi came up with the issue over there. @bebbi did you manage to solve it or did you also experience the hangs?
@btburton42 Try uninstalling some npm package and reinstalling something. Let me know if the error comes back.
@Toosick coworker tried rm'ing and reinstalling but no luck. he is using nvm, think that might do it?
@btburton42 do sls dynamodb remove && sls dynamodb install
@Toosick thanks! will do on monday and let you know.
@Toosick that didn't work for my colleague. I'll let him chime in when he has a moment of free time.
Hi everyone @btburton42 @Toosick @HyperBrain , did you manage to solve the issue? I am experiencing the same error when I run a Docker container (node:6.10) using
- "serverless" : "1.24.1"
- "serverless-dynamodb-local": "0.2.26",
- "serverless-offline": "3.16.0"
However, it works when I run it from my host pc.
I tried many combination of installing/uninstalling npm packages and dynamodb local within the docker container. In case you need for more information about the issue I will be happy to provide with more details.
Many thanks in advance
@danielesalvatore sls dynamodb remove && sls dynamodb install
is the workaround I used for the time being.
@Toosick thank you very much for your reply. In my case the error was generated because the Docker container used didn't have Java on it. Thank you for your support
@danielesalvatore Step 1: install Java 🥇
Looks like the bin folder in node_modules/dynamodb-localhost/dynamodb
gets deleted for me occasionally, resulting in the Error: spawn java ENOENT
error.
Not sure why it's getting deleted, but reinstalling does temporarily fix it.
I guess it's a matter of figuring out if this repo is causing the issue or if https://github.com/99xt/dynamodb-localhost is.
This happens for me every time I add/remove new dependencies (using yarn
)
For me, when I reorganized my package, this error would not go away despite running sls dynamodb remove && sls dynamodb install
. Turns out that the installation wasn't happening at all - dynamodb-local
expects to find the AWS-provided binary within .dynamodb/
in your package root, and I had to copy it there manually.
For those who are stuck with this issue, the following solution worked for me
npm uninstall serverless-dynamodb-local
sls dynamodb uninstall
npm install [email protected]
sls dynamodb install
@sohailalam2 's workaround works. seemed to be broken somewhere between 0.2.36 & 0.2.31
Any updates on if this is fixed in the latest release?
@salmankhann still happening. I had to lock dynamodb-localhost
in package.json at v0.0.5
for this to work
"resolutions": {
"dynamodb-localhost": "0.0.5"
}