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

0.2.19 -> 0.2.20 breaks serverless offline start #127

Open
bebbi opened this issue Aug 23, 2017 · 24 comments
Open

0.2.19 -> 0.2.20 breaks serverless offline start #127

bebbi opened this issue Aug 23, 2017 · 24 comments

Comments

@bebbi
Copy link

bebbi commented Aug 23, 2017

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)
@HyperBrain
Copy link

Error: spawn java ENOENT

That looks like the java executable could not be found. Can it be that dynamodb-local tries to start Java?

@HyperBrain
Copy link

According to the plugin requirements you need a JRE (I assume accessible through your path settings in the environment).

@bebbi
Copy link
Author

bebbi commented Aug 23, 2017 via email

@paqman
Copy link

paqman commented Aug 31, 2017

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)

@prestontighe
Copy link

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.

@bebbi
Copy link
Author

bebbi commented Sep 1, 2017

Thanks @paqman and @TooSick. Leaving this open for owners to track.

@btburton42
Copy link

btburton42 commented Sep 29, 2017

@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?

@HyperBrain
Copy link

@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?

@prestontighe
Copy link

@btburton42 Try uninstalling some npm package and reinstalling something. Let me know if the error comes back.

@btburton42
Copy link

@TooSick coworker tried rm'ing and reinstalling but no luck. he is using nvm, think that might do it?

@prestontighe
Copy link

@btburton42 do sls dynamodb remove && sls dynamodb install

@btburton42
Copy link

@TooSick thanks! will do on monday and let you know.

@btburton42
Copy link

@TooSick that didn't work for my colleague. I'll let him chime in when he has a moment of free time.

@danielesalvatore
Copy link

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

@prestontighe
Copy link

@danielesalvatore sls dynamodb remove && sls dynamodb install is the workaround I used for the time being.

@danielesalvatore
Copy link

@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

@prestontighe
Copy link

@danielesalvatore Step 1: install Java 🥇

@idmontie
Copy link

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.

@byF
Copy link

byF commented Jun 13, 2018

This happens for me every time I add/remove new dependencies (using yarn)

@kalzoo
Copy link

kalzoo commented Nov 29, 2018

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.

@sohailalam2
Copy link

For those who are stuck with this issue, the following solution worked for me

npm uninstall serverless-dynamodb-local
sls dynamodb uninstall

npm install serverless-dynamodb-local@0.2.30
sls dynamodb install

@shierro
Copy link

shierro commented Jan 15, 2019

@sohailalam2 's workaround works. seemed to be broken somewhere between 0.2.36 & 0.2.31

@salmankhann
Copy link

Any updates on if this is fixed in the latest release?

@uccmen
Copy link

uccmen commented May 6, 2019

@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"
}

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