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

Bcrypt #267

Closed
CaptainChemist opened this issue Sep 1, 2016 · 10 comments
Closed

Bcrypt #267

CaptainChemist opened this issue Sep 1, 2016 · 10 comments

Comments

@CaptainChemist
Copy link

CaptainChemist commented Sep 1, 2016

I am having an issue with mup deploy . It sets up great but when I run deploy I get the following error:

    -----------------------------------STDERR-----------------------------------
    s/server/npm/node_modules/bcrypt
    > node-gyp rebuild

    make: Entering directory '/bundle/bundle/programs/server/npm/node_modules/bcrypt/build'
      CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
      CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
      CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
    /opt/meteord/run_app.sh: line 21:     8 Killed                  npm install --unsafe-perm

    > meteor-dev-bundle@0.0.0 install /bundle/bundle/programs/server
    > node npm-rebuild.js


    > bcrypt@0.8.7 install /bundle/bundle/programs/server/npm/node_modules/bcrypt
    > node-gyp rebuild

    make: Entering directory '/bundle/bundle/programs/server/npm/node_modules/bcrypt/build'
      CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
      CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
      CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
    /opt/meteord/run_app.sh: line 21:     8 Killed                  npm install --unsafe-perm

    => Redeploying previous version of the app

When I look at the logs, I get the following error:

npm WARN meteor-dev-bundle@0.0.0 No description
npm WARN meteor-dev-bundle@0.0.0 No repository field.
npm WARN meteor-dev-bundle@0.0.0 No license field.
npm ERR! Linux 4.4.0-36-generic
npm ERR! argv "/opt/nodejs/bin/node" "/usr/bin/npm" "install" "--unsafe-perm"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! meteor-dev-bundle@0.0.0 install: `node npm-rebuild.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the meteor-dev-bundle@0.0.0 install script 'node npm-rebuild.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the meteor-dev-bundle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node npm-rebuild.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs meteor-dev-bundle
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls meteor-dev-bundle
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /bundle/bundle/programs/server/npm-debug.log

I suspect that it may be due to the docker image that I am using in my setup file but this particular image has gotten me the furthest. I am using Meteor 1.4.1 which uses node 4.5 instead of the 4.4.7 which docker is apparently using above. I wonder if that is part of the issue. Also, at meteor's recommendation I switched to the newer bcrypt (npm I think?) because it said that it was significantly faster than the native one- I started having issues around that time.

module.exports = {
  servers: {
    one: {
      host: 'x.x.x.x',
      username: 'root',
      pem: '/Users/user/.ssh/digitalocean'
    }
  },

  meteor: {
    name: 'meteor',
    path: '/Users/user/development/meteor-project',
    servers: {
      one: {}
    },
    buildOptions: {
      serverOnly: true,
    },
    env: {
      ROOT_URL: 'x.x.x.x',
      MONGO_URL: 'mongodb://user:pass@.mlab.com:39685/test-production'

    },

    dockerImage: 'abernix/meteord:base',
    deployCheckWaitTime: 60
  },

  mongo: {
    oplog: true,
    port: 27017,
    servers: {
      one: {},
    },
  },
};

@ivandaho
Copy link

ivandaho commented Sep 6, 2016

I have the same issue with bcrypt. I am also using that abernix/meteord:base image. This bcrypt thing happened after updating Meteor to either 1.4 or 1.4.1.

I think I know the problem but I am not knowledgeable enough to solve it.

So I think bcrypt requires node-gyp installed in npm to compile.
I am trying to solve it by building a docker image from the abernix:base image, and install node-gyp in it. However, I don't know enough about docker to confirm whether my image made any difference.

Dockerfile I used:

FROM abernix/meteord:base

RUN npm install -g node-gyp

Then I ran docker build . and pushed my meteord to ivandaho/meteord

Then I set my mup.js to use my meteord image instead of abernix's

Tried to Run mup deploy with bcrypt in my package.json, and got the same error.

If I took off bcrypt in my package.json the deploy would end with a warning, but the app would be deployed fine. mup logs --tail=50 had the same message Meteor's console was giving me about doing meteor npm install --save bcrypt to use the npm implementation of bcrypt.

edit: By increasing deployCheckWaitTime from 15 to 60, mup would return SUCCESS when verifying deployment. However the app is still not using the native bcrypt.

@CaptainChemist
Copy link
Author

Thanks for reporting a possible solution- I was able to fix this issue by removing the npm bcrypt package. I wish that I knew more about how I can roll my own docker package so that I could do this but if anyone has any good guides for how to do it I'd be happy to give it a try.

@avishaan
Copy link

If you need to keep the bcrypt package and also use Meteor 1.4 I would highly recommend using the v1.4-build tag of https://github.com/CyCoreSystems/docker-meteor from @Ulexus

@guillim
Copy link
Contributor

guillim commented Nov 29, 2016

I had the same issue. I needed two things: update node to its latest v6 version, and install the node-gyp to fix it.

A very simple way to try that out is to use the docker image i created to fix that:
dockerImage:"guillim/meteord"

Now it works great !

It is bascially the docker created by abernix but where I updated node (from v4 to v6) and installed some npm packages i needed (including node-gyp)

Let me know if it helped

@ivandaho
Copy link

ivandaho commented Dec 8, 2016

@guillim
Tried it, doesn't work for me - still can't run node's bcrypt - it gives the same node-gyp error. docker ps in my droplet shows that your image is the one installed. Both my local machine and my droplet is 16.04 if it matters.

@avishaan
Copy link

avishaan commented Dec 8, 2016

@ivandaho which version of Meteor are you trying to deploy?

@ivandaho
Copy link

ivandaho commented Dec 8, 2016

@codehatcher 1.4.1.1

@doronsever
Copy link

@guillim I've change my mup.js to use your docker but when i deploy it i get

Error response from daemon: No such container: anatwaterworks
Error response from daemon: No such container: anatwaterworks-frontend
Tag latest not found in repository docker.io/guillim/meteord
Unable to find image 'guillim/meteord:latest' locally
Pulling repository docker.io/guillim/meteord
docker: Tag latest not found in repository docker.io/guillim/meteord.
See 'docker run --help'.
-----------------------------------STDOUT-----------------------------------
Using default tag: latest
Pulling repository docker.io/guillim/meteord

Am i missing something?

@ivandaho
Copy link

@doronsever the docker repo doesn't have a latest tag, use any of the tags at https://hub.docker.com/r/guillim/meteord/tags/ instead, for example

dockerImage:"guillim/meteord:node6.9.1V3"

@doronsever
Copy link

doronsever commented Dec 15, 2016

Do i need to kill previous docker containers?
When i try to deploy i get errors.

Do i need to install Node 6.9.1 on my computer also in order for this to work?

mrauhu added a commit to mrauhu/npm that referenced this issue Jul 15, 2017
When try to deploy a Meteor project from the Windows host to the Linux server
using the `mup deploy` or `meteor build --architecture os.linux.x86_64`
all binary packages broken, because NPM try to rebuild packages,
and failed on `node-sshpk` dependency of `bcrypt`.

Linked issues:

* meteor/meteor#7401
* abernix/meteord#8
* zodern/meteor-up#267
mrauhu added a commit to mrauhu/npm that referenced this issue Jul 17, 2017
When try to deploy a Meteor project from the Windows host to the Linux server
using the `mup deploy` or `meteor build --architecture os.linux.x86_64`
all binary packages broken, because NPM try to rebuild packages,
and failed on `node-sshpk` dependency of `bcrypt`.

Linked issues:

* meteor/meteor#7401
* abernix/meteord#8
* zodern/meteor-up#267
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

7 participants