abernix / meteord

MeteorD - Docker Runtime for Meteor Apps for Production Deployments
https://registry.hub.docker.com/u/meteorhacks/meteord/
MIT License
93 stars 129 forks source link

Failing to build dependency (fibers) on startup causes the container to crash #52

Closed rpesciotta closed 4 years ago

rpesciotta commented 4 years ago

Hi,

I'm trying for the first time to use this image. My app is using meteor 1.10.2 (node 12.16.1). I build it for os.linux.x86_64 and it always fails with error messages about failure to build fibers:

/root/.cache/node-gyp/12.16.1/include/node/v8.h:10424:6: note: declared here
 void ReturnValue<T>::Set(const Persistent<S>& handle) {
      ^~~~~~~~~~~~~~
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
fibers.target.mk:120: recipe for target 'Release/obj.target/fibers/src/fibers.o' failed
make: Leaving directory '/bundle/bundle/programs/server/npm/node_modules/fibers/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.76-linuxkit
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /bundle/bundle/programs/server/npm/node_modules/fibers
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
Alpine users please run: `sudo apk add python make g++`
sh: 1: nodejs: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fibers@2.0.0 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@2.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-06-13T21_00_21_483Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor-dev-bundle@ install: `node npm-rebuild.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor-dev-bundle@ install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-06-13T21_00_21_515Z-debug.log

I initially tried using meteorup on an ubuntu 18.04 ec2 instance on aws, and it failed. I found some discussions mentioning ubuntu 16.04 would be more compatible, so I tried it, but same error.

Since it could be related to the aws environment and/or what meteor does during deploying, I decided to try it locally on my machine (macOS), directly with the abernix/meteord:node-12-base image.

But unfortunately I get exactly the same error. I conclude the problem is then in the image itself. Anyone having the same problem?

rpesciotta commented 4 years ago

I sorted it out. For some reason I had fibers@2.0.0 in my package.json from a long time ago, no longer needed. I'm still not entirely sure why it was not able to be compiled, but since I removed it, everything else works fine.