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

Error when build through cli - Code 137 #315

Closed
bilicio opened this issue Nov 6, 2018 · 6 comments
Closed

Error when build through cli - Code 137 #315

bilicio opened this issue Nov 6, 2018 · 6 comments

Comments

@bilicio
Copy link

bilicio commented Nov 6, 2018

What is the problem?
At the end of the deployment through CLI it cames with this error:

Killed

{"code":137,"message":"The command '/bin/sh -c npm install && npm cache clean --force' returned a non-zero code: 137"}
The command '/bin/sh -c npm install && npm cache clean --force' returned a non-zero code: 137
----------------------
Deploy failed!
Error: {"code":137,"message":"The command '/bin/sh -c npm install && npm cache clean --force' returned a non-zero code: 137"}
The command '/bin/sh -c npm install && npm cache clean --force' returned a non-zero code: 137

Something bad happened. Cannot deploy "santander-app"

If applicable, content of captain-definition file:
the same as the site

Steps to reproduce the problem:
Using the CLI to deploy the app

Answers to the following questions where applicable:

  • Your OS and version?
    Ubuntu 16.04
    Docker 18

  • RAM?
    1gb

@githubsaturn
Copy link
Collaborator

githubsaturn commented Nov 6, 2018

There could more information in the logs before this line:

{"code":137,"message":"The command '/bin/sh -c npm install && npm cache clean --force'

Otherwise, if there is no other error/warning before that line, most likely, your machine is running out of memory. See these:

docker/compose#1554

https://stackoverflow.com/questions/34674325/error-build-process-returned-exit-code-137-during-docker-build-on-tutum

To fix, either up your RAM to 2GB or more. Alternatively, if this is a frontend app, you can use something like this:
https://caprover.com/docs/recipe-deploy-create-react-app.html

Even if it's a backend app, you can use this technique (with some modifications). Use the same technique to install your dependencies and make the app locally. Then use the advance version of node: https://caprover.com/docs/captain-definition-file.html#advanced-version

Except, you should remove this line from the captain-definition: RUN npm install && npm cache clean --force.

@bilicio
Copy link
Author

bilicio commented Nov 6, 2018

Thank you Kasra,
is there any easy way to deploy a compiled app instead of compiling all in the server, like upload a ready .tar file to the server?

@bilicio
Copy link
Author

bilicio commented Nov 6, 2018

by the way, raising the ram to 1024 solved the problem! :)

@githubsaturn
Copy link
Collaborator

githubsaturn commented Nov 7, 2018

is there any easy way to deploy a compiled app instead of compiling all in the server, like upload a ready .tar file to the server?

yes, it's in the sample that I included in the previous comment: https://caprover.com/docs/recipe-deploy-create-react-app.html

@bilicio
Copy link
Author

bilicio commented Nov 7, 2018

thank you kasra!
One more thing please, in my app i work with socket on port 3031, and i tried to follow your guide to play with nginx without success. can you give me a tip on how to expose this port outside the captain for external access?

@bilicio
Copy link
Author

bilicio commented Nov 7, 2018

I gotit !
I needed change captain-definition file with this ( "EXPOSE 3031") and create Port Mapping on captain to Server Public Port: 3031 and Container Port: 80. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants