2

I am having a nodejs(expressjs) application which runs fine locally but when I deploy it to Openshift i got an exception when i check the log file it has the following error when including this line in server.js.

var mongojs = require("mongojs");

DEBUG: Sending SIGTERM to child...
DEBUG: Running node-supervisor with
DEBUG:   program 'server.js'
DEBUG:   --watch '/var/lib/openshift/5522627bfcf9336fbc00016a/app-root/data/.nodewatch'
DEBUG:   --ignore 'undefined'
DEBUG:   --extensions 'node|js|coffee'
DEBUG:   --exec 'node'
DEBUG: Starting child process with 'node server.js'
DEBUG: Watching directory '/var/lib/openshift/5522627bfcf9336fbc00016a/app-root/data/.nodewatch' for changes.
[Error: /var/lib/openshift/5522627bfcf9336fbc00016a/app-root/runtime/repo/node_modules/mongojs/node_modules/mongodb/node_modules/bson/build/Release/bson.node: wrong ELF class: ELFCLASS32]
js-bson: Failed to load c++ bson extension, using pure JS version
App is running on  port : 3000

1 Answers1

3

It looks like your bson or mongodb was built for a 32 bit system but you are trying to load it on a 64 bit system (or some other architecture).

I imagine you have a 32 bit system and you are deploying built binaries as well.

How did you install mongodb on your system? Try reinstalling it on the target system from source (try removing the node_modules dir altogether and running npm install again).

As an advice for the future, it's usually a good idea to deploy only the package.json file of your project and perform npm install locally.

Octav Zlatior
  • 451
  • 4
  • 14