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

Deploy from MAC to Linux - "bcrypt_lib.node: invalid ELF header" #377

Closed
nchokoev opened this issue Apr 15, 2015 · 41 comments
Closed

Deploy from MAC to Linux - "bcrypt_lib.node: invalid ELF header" #377

nchokoev opened this issue Apr 15, 2015 · 41 comments

Comments

@nchokoev
Copy link

Hello,

I'm trying to deploy a meteor app from MAC OS to Linux.

The deployment fails:
✘ Invoking deployment process: FAILED

with log:
...app/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header

It looks like MUP is uploading the local MAC bcrypt. I'm not sure if MUP does build bcrypt on the target Linux machine, and if it does it probably doesn't clean-up the old (MAC) binaries.

If I go to the Linux machine and I do:
cd ...app/programs/server
rm -rf npm/npm-bcrypt/node_modules/bcrypt
npm install bcrypt

then I can start service and all works.

Strangely If I don't delete the bcrypt and just do:
cd ...app/programs/server
npm install bcrypt
it doesn't work. I tried to rebuild bcrypt, etc. - no success until I delete the old binaries.

Is there an easy fix for it? Am I doing something wrong or I'm missing something...?

@joaopiopedreira
Copy link

Hi,

Try this:

  • Make sure you have node 0.10.36 specified in your mup.json file
  • upgrade to the latest version of mup (npm install -g mup)

If the problem persists, copy/paste your mup.json file here together with the full error stack. Also, it would help to know the Meteor version you're running.

Enviado do meu iPhone

No dia 15/04/2015, às 21:25, nickich notifications@github.com escreveu:

Hello,

I'm trying to deploy a meteor app from MAC OS to Linux.

The deployment fails:
✘ Invoking deployment process: FAILED

with log:
...app/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header

It looks like MUP is uploading the local MAC bcrypt. I'm not sure if MUP does build bcrypt on the target Linux machine, and if it does it probably doesn't clean-up the old (MAC) binaries.

If I go to the Linux machine and I do:
cd ...app/programs/server
rm -rf npm/npm-bcrypt/node_modules/bcrypt
npm install bcrypt

then I can start service and all works.

Strangely If I don't delete the bcrypt and just do:
cd ...app/programs/server
npm install bcrypt
it doesn't work. I tried to rebuild bcrypt, etc. - no success until I delete the old binaries.

Is there an easy fix for it? Am I doing something wrong or I'm missing something...?


Reply to this email directly or view it on GitHub.

@nchokoev
Copy link
Author

Hi,

On the MAC:
The Meteor version is:
Meteor 1.1.0.1
MUP is updated.

On the target node version is: v0.10.38.

The upstart log is (beginning and end of it, rest is repeated...):

/opt/myapp/app/programs/server/node_modules/fibers/future.js:245
throw(ex);
^
Error: /opt/myapp/app/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/opt/myapp/app/programs/server/npm/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15)
at Object. (/opt/myapp/app/programs/server/npm/npm-bcrypt/node_modules/bcrypt/bcrypt.js:3:35)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
error: Forever detected script exited with code: 8
error: Script restart attempt #1

......

/opt/myapp/app/programs/server/node_modules/fibers/future.js:245
throw(ex);
^
Error: Cannot find module './middleware/compress'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Function.load as compress
at runWebAppServer (packages/webapp/webapp_server.js:575:1)
at Package (packages/webapp/webapp_server.js:763:1)
at /opt/myapp/app/programs/server/packages/webapp.js:818:4
at /opt/myapp/app/programs/server/packages/webapp.js:829:3
at /opt/myapp/app/programs/server/boot.js:222:10
error: Forever detected script exited with code: 8

stepping down to gid: meteoruser
stepping down to uid: meteoruser

Thanks.

@joaopiopedreira
Copy link

Try to downgrade your node version to 0.10.36 in the target by specifying it in your mup.json file.

  • Change your mup.json file (setup node: yes; node version: 0.10.36)
  • Run "mup setup"
  • Run "mup deploy"

Should work!

Enviado do meu iPhone

No dia 16/04/2015, às 19:25, nickich notifications@github.com escreveu:

Hi,

On the MAC:
The Meteor version is:
Meteor 1.1.0.1
MUP is updated.

On the target node version is: v0.10.38.

The upstart log is (beginning and end of it, rest is repeated...):

/opt/myapp/app/programs/server/node_modules/fibers/future.js:245
throw(ex);
^
Error: /opt/myapp/app/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/opt/myapp/app/programs/server/npm/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15)
at Object. (/opt/myapp/app/programs/server/npm/npm-bcrypt/node_modules/bcrypt/bcrypt.js:3:35)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
error: Forever detected script exited with code: 8
error: Script restart attempt #1

......

/opt/myapp/app/programs/server/node_modules/fibers/future.js:245
throw(ex);
^
Error: Cannot find module './middleware/compress'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Function.load as compress
at runWebAppServer (packages/webapp/webapp_server.js:575:1)
at Package (packages/webapp/webapp_server.js:763:1)
at /opt/myapp/app/programs/server/packages/webapp.js:818:4
at /opt/myapp/app/programs/server/packages/webapp.js:829:3
at /opt/myapp/app/programs/server/boot.js:222:10
error: Forever detected script exited with code: 8

stepping down to gid: meteoruser
stepping down to uid: meteoruser

Thanks.


Reply to this email directly or view it on GitHub.

@nchokoev
Copy link
Author

Hello João,

Your suggestion seems to do the trick. Thanks!
So far it works great.

Thanks.
Nikolay

@joaopiopedreira
Copy link

Glad I could help :-)

On 17 April 2015 at 18:54, nickich notifications@github.com wrote:

Closed #377 zodern/meteor-up#377.


Reply to this email directly or view it on GitHub
zodern/meteor-up#377 (comment).

@vincro
Copy link

vincro commented Mar 31, 2016

Still seeing this with deployment from OSx to Ubuntu with .36-.43 in Meteor 1.3.
All manner of setup/deploy and npm command do not seem to work.
Is this merely an OSX to Ubuntu issue?

@piyushcoader
Copy link

@vincro same here facing same issue with deploying Meteor 1.3

@mlecoq
Copy link

mlecoq commented Apr 2, 2016

@piyushcoader same issue for me since I have upgraded to Meteor 1.3

@vincro
Copy link

vincro commented Apr 2, 2016

I have resorted to doing my own deploys on DigitalOcean and writing my own deploys using flightplans, not ideal but less of a black box and ultimate flexibility.

@piyushcoader
Copy link

I think the issue is with new meteor build system
meteor build --architecture targetArch
and i think can be solved by updating the build but i did by manual deploying

@mlecoq
Copy link

mlecoq commented Apr 2, 2016

I have manually updated the bcrypt dependency

app/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt
from 0.7.8 to 0.8.5 directly on my server

@TheRealmGaming
Copy link

@mlecoq How did you manually update bcrypt? It's definitely what's breaking my app.

Incidentally, is there a way to delete bcrypt from your app and re-add it now npm is supported?

@mlecoq
Copy link

mlecoq commented Apr 3, 2016

@TheRealmGaming I am not very proud of it :)

In the following directory :

/opt/myapp/app/programs/server/npm/node_modules/meteor/npm-bcrypt/

npm install bcrypt

@TheRealmGaming
Copy link

@mlecoq and then did you re-run mup deploy? Mine isn't deploying and I imagine re-running deploy would overwrite your changes.

@mlecoq
Copy link

mlecoq commented Apr 4, 2016

@TheRealmGaming no, i did not re-run mup deploy.

@standard-vision
Copy link

Hi @TheRealmGaming @mlecoq , I'm having the same issue. Thanks for your help with this. I was able to use the new bcrypt and re-run mup deploy by "fighting the clock" -- I made my "deployCheckWaitTime" value in mup.json long enough for me to be able to delete the bcrypt that is installed at /opt/app-name/app/programs/server/npm/node_modules/meteor/npm-bcrypt/ upon deployment, and reinstall the newest version (0.8.5). All I'm wondering now is whether I can automate this process or if I should open a new issue to try and get this resolved...

@mlecoq
Copy link

mlecoq commented Apr 4, 2016

@sv-developer I may try to migrate to the new meteor-up : https://github.com/kadirahq/meteor-up

@mlecoq
Copy link

mlecoq commented Apr 8, 2016

@sv-developer I don't think it's a meteor-up issue. I have tried a manual build (meteor build ...) and the same issue occurs.

@mlecoq
Copy link

mlecoq commented Apr 10, 2016

\ o / Newer versions of the following indirect dependencies are available:

npm-bcrypt 0.7.8_2 (0.8.5 is available)

@mlecoq
Copy link

mlecoq commented Apr 11, 2016

@sv-developer @TheRealmGaming This issue will be fixed in Meteor 1.3.2
For the moment you can use 1.3-beta.11 to deploy

meteor update --release METEOR@1.3-beta.11

@standard-vision
Copy link

Great news! Thank you for researching this.

@lijoantony
Copy link

@mlecoq Looks like the fix is not included in the 1.3.2 or 1.3.2.1 releases.

@mlecoq
Copy link

mlecoq commented Apr 18, 2016

@lijoantony I did not test them directly with meteor up (last time I used meteor build). I will check. This issue is viewed as closed : meteor/meteor#6778

@mlecoq
Copy link

mlecoq commented Apr 19, 2016

@lijoantony you are right I still have the issue with meteor up

@lijoantony
Copy link

Not fixed in 1.3.2.2 either :(

@liuzhuotao
Copy link

Same issue here. Cannot deploy to a VM hosted by DigitalOcean.

Any help?

@lijoantony
Copy link

As mentioned by @mlecoq above, use METEOR@1.3-beta.11
Unfortunately I need 1.3.2 for some mobile fixes. Juggling with git branches now!

@vincro
Copy link

vincro commented Apr 21, 2016

I, in the end ditched MUP and rolled my own scripts. Not that hard, just not as quick as writing one line of code. The best thing you can do on DO is to make some snapshots and then all you need to do is deploy them and run deploy/build/npm install a number of time, which can be scripted anyhow.

@liuzhuotao
Copy link

In the end, I got no luck from mup.

I turned to mupx, the successor of mup. I update my meteor to 1.3.2.2. Then mupx smoothly deploys my app on a DigitalOcean VM with 3.13 linux kernel.

Best luck for everyone. :)

@mbateman
Copy link

Seems like this is affecting quite a few people. Is there any prospect of it getting resolved in the near future? It has been a problem for over a year.

@mlecoq
Copy link

mlecoq commented Apr 22, 2016

@mbateman I also use manual build. I think that we have to wait a release of https://github.com/kadirahq/meteor-up

@mbateman
Copy link

@mlecoq thanks for the reply. I assume you mean copy a local build to the target platform and start it there.

@mlecoq
Copy link

mlecoq commented Apr 22, 2016

@mbateman yes

@mbateman
Copy link

I just used the METEOR@1.3-beta.11 workaround which works fine too. It seems strange that it this is not in subsequent releases.

@mlecoq
Copy link

mlecoq commented Apr 22, 2016

@mbateman If you have a stacktrace with latest version (1.3.2.4), we can reopen this issue meteor/meteor#6778

@mbateman
Copy link

@mlecoq I have left a comment on meteor/meteor#6778.

@chuikoffru
Copy link

@zliuInspire Thanks! 1.3.2.2 + mupx - good works! Install to flops.ru ubuntu 14.04 linux 3.16.

@mbateman
Copy link

mbateman commented May 2, 2016

@mlecoq Is the plan to include the fix present in METEOR@1.3-beta.11 in the next release? (e.g. 1.3.2.5)

@lijoantony
Copy link

Switched to mupx. it works!

@Testato
Copy link

Testato commented Jun 20, 2016

same problem here on Meteor 1.3.3.1
the bcrypt version is 0.8.5, by manually npm update, like @mlecoq suggest, it go to bcrypt 0.8.7 and work.
But the porblem is always that after a deploy you must delete and reinstall bcrypt

@c9s
Copy link

c9s commented Jul 29, 2016

I forked this repo and started a new project from this basis, the deploy script will fix the bcrypt issue automatically. You can just install the mup from here https://github.com/c9s/meteor-up

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