question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker images module version mismatch

See original GitHub issue

Description

Docker images don’t start, says a module was compiled against a different Nodejs version.

Same results with latest, and v1.9.20 (except the NODE_MODULE_VERSIONs are different)

> sudo docker run cncjs/cncjs
[sudo] password for y: 
Unable to find image 'cncjs/cncjs:latest' locally
latest: Pulling from cncjs/cncjs
c5e155d5a1d1: Pull complete 
221d80d00ae9: Pull complete 
4250b3117dca: Pull complete 
3b7ca19181b2: Pull complete 
425d7b2a5bcc: Pull complete 
69df12c70287: Pull complete 
ad53476a61f2: Pull complete 
204bb8bac4a1: Pull complete 
f72f5ced5338: Pull complete 
6fe64b0754e2: Pull complete 
a6dfb1f83469: Pull complete 
b8a063378942: Pull complete 
Digest: sha256:aa682ea3616a6a2a5ef0f9573f31650a79361a2f1c2e29c958bde1d7fcffdcbc
Status: Downloaded newer image for cncjs/cncjs:latest
Error: Error: The module '/dist/cncjs/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:730:18)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at bindings (/dist/cncjs/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/dist/cncjs/node_modules/@serialport/bindings/lib/linux.js:1:98)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/dist/cncjs/node_modules/@serialport/bindings/lib/index.js:14:22)

And 1.9.20:

> docker run cncjs/cncjs:v1.9.20
[sudo] password for y: 
Unable to find image 'cncjs/cncjs:v1.9.20' locally
v1.9.20: Pulling from cncjs/cncjs
e79bb959ec00: Pull complete 
d4b7902036fe: Pull complete 
1b2a72d4e030: Pull complete 
d54db43011fd: Pull complete 
69d473365bb3: Pull complete 
6e2490ee2dc8: Pull complete 
24bcfd3d8296: Pull complete 
4c485b32137c: Pull complete 
10c7ea03b1e0: Pull complete 
7da3ff434f8a: Pull complete 
306d2f7957ad: Pull complete 
4ce325a7a1f4: Pull complete 
Digest: sha256:51a130be239e7a1686125eb484d921ab5e70dd5b9f227d4dc3b55b864142103f
Status: Downloaded newer image for cncjs/cncjs:v1.9.20
Error: Error: The module '/dist/cnc/node_modules/serialport/build/Release/serialport.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:682:18)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at bindings (/dist/cnc/node_modules/bindings/bindings.js:81:44)
    at Object.<anonymous> (/dist/cnc/node_modules/serialport/lib/bindings/linux.js:2:36)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/dist/cnc/node_modules/serialport/lib/bindings/auto-detect.js:16:22)

Versions

  • CNCjs: 1.9.20, latest

How Do You Install CNCjs?

Docker

Hardware

  • Desktop or Laptop

Operating System

  • Linux

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
voneidencommented, Jul 14, 2019

On a Linux host you can get the image rolling with the following dockerfile

FROM cncjs/cncjs:v1.9.20
RUN apt-get update
RUN apt-get install -y udev          
RUN ./node_modules/.bin/electron-rebuild -f -v 2.0.18 --module-dir /dist/cnc/

Explanation: 1.9.20 uses nodejs v8 as the system default, but the build uses a electrum version that uses a newer and custom nodejs version that is incompatible with the system. When attempting to run the image, it uses again the system nodejs and therefore fails. The dockerfile above recompiles the serialport dependency against an older electrum version which is compatible with the system version (ABI 57).

Note: This “fix” will not work with the latest version, because latest raises the system nodejs to v10 (ABI 64) and there’s no matching ABI from electron.

1reaction
proffalkencommented, Jan 18, 2021

It would be great to get this rolled in to the “official” Docker container at https://hub.docker.com/r/cncjs/cncjs - I’m not sure if feature-next is what I should be using, but :latest definitely has this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module version mismatch. Expected 48, got 51 - Stack Overflow
It seems the number refers to NODE MODULE version, 48 is node 6, 57 is node 8. We were running our pm2 processes...
Read more >
2. Using PF_RING with Docker - NTOP
The version of the pf_ring kernel module loaded on the host and the pf_ring library/application version running in the container have to be...
Read more >
NVIDIA DGX OS Server Release 4.6
DGX OS Server Release 4.6, version 4.6.0, is provided as an ISO image which is available from NVIDIA Enterprise Support in the event...
Read more >
Develop with Docker Engine SDKs
The version of the Docker Engine API you should use depends upon the version of your Docker daemon and ... "github.com/docker/docker/api/types/container" ...
Read more >
FAQ — Singularity container 2.6 documentation
Singularity is using standard container principals and methods so if you are leveraging any kernel version specific or external patches/module functionality ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found