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

Incompatible version of node in latest GitHub ubuntu 20.04 image #53

Closed
fcollonval opened this issue Dec 3, 2021 · 8 comments · Fixed by #55
Closed

Incompatible version of node in latest GitHub ubuntu 20.04 image #53

fcollonval opened this issue Dec 3, 2021 · 8 comments · Fixed by #55
Assignees
Labels
p0-critical bugs & errors

Comments

@fcollonval
Copy link

In https://github.com/actions/virtual-environments/pull/4395/files, NodeJS 16 has been added to the ubuntu image. I think this is the reason we are hitting that error in our CI although we are using the GitHub actions to use NodeJS 14. Is there a workaround? Or do we need to wait for iterative/cml#825?

@casperdcl
Copy link
Contributor

casperdcl commented Dec 6, 2021

failing due to an update of NodeJS in the ubuntu image that is incompatible with CML action (to publish the benchmark image).

Error: The module '/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/build/Release/magic.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 83.

-- jupyterlab/jupyterlab#11606

93 corresponds to node 16. We could also bump to that version in the benchmarks CI workflow?

The trouble is the cml installation that does not apparently use the specified version of node JS but rather one it finds on the os. As GitHub recently added nodejs 16 to the Ubuntu 20.04 image, that breaks CML. This is not related to our code. I opened an issue upstream. No answer yet

-- jupyterlab/jupyterlab#11607 (comment)

Other relevant info to the above issues:

jobs:
  test:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/setup-node@v2
        with:
          node-version: '14.x'
      - uses: iterative/setup-cml@v1
      - env:
          REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: cml-publish ./benchmark-results/lab-benchmark.png --md >> ./benchmark-results/lab-benchmark.md

Note that setup-cml itself just uses npm found on $PATH to install things:

`${sudoPath} npm install -g canvas@2 vega@5 vega-cli@5 vega-lite@4 @dvcorg/cml${

Unsure of how best to go about fixing this.

@casperdcl casperdcl added the p0-critical bugs & errors label Dec 6, 2021
@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Dec 6, 2021

Original error message

internal/modules/cjs/loader.js:1144
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The module '/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/build/Release/magic.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 83. 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:1144:18)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/lib/index.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
  code: 'ERR_DLOPEN_FAILED'
}

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Dec 6, 2021

Simplified reproducible example

on: workflow_dispatch
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2
      with:
        node-version: '14.x'
    - uses: iterative/setup-cml@v1
    - run: cml-publish /dev/null
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Run actions/checkout@v2

Syncing repository: ···
Getting Git version info
Deleting the contents of '/home/runner/work/···/···'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
Determining the checkout info
Checking out the ref
/usr/bin/git log -1 --format='%H'
'···'

Run actions/setup-node@v2

with:
  node-version: 14.x
  always-auth: false
  check-latest: false
  token: ***
Found in cache @ /opt/hostedtoolcache/node/14.18.1/x64

Run iterative/setup-cml@v1

Uninstalling previous CML
Installing CML version latest

Run cml-publish /dev/null

internal/modules/cjs/loader.js:1144
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The module '/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/build/Release/magic.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 83. 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:1144:18)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/lib/index.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
  code: 'ERR_DLOPEN_FAILED'
}

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Dec 6, 2021

Minimal reproducible example

on: workflow_dispatch
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/setup-node@v2
      with:
        node-version: '14.x'
    - run: |
        set -x
        sudo npm --version
        npm --version
        sudo node --version
        node --version

Run actions/setup-node@v2

Found in cache @ /opt/hostedtoolcache/node/14.18.1/x64

Run set -x

+ sudo npm --version
8.1.0
+ npm --version
6.14.15
+ sudo node --version
v16.13.0
+ node --version
v14.18.1

@0x2b3bfa0
Copy link
Member

Minimal working example

on: workflow_dispatch
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2
      with:
        node-version: '14.x'
    - uses: iterative/setup-cml@v1
      with:
        sudo: false
    - run: cml-publish /dev/null
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@0x2b3bfa0
Copy link
Member

Apparently, setup-node@v2 install the requested node version at the user level, not at the system level.

On the other hand, setup-cml@v1 uses sudo by default for the installation process, causing mmmagic to build against the default node version, as opposed to the specified one.

Subsequent workflow steps will try to run cml with the specified node version, but resorting to the native modules built for the default version.

@casperdcl
Copy link
Contributor

@fcollonval should be fixed now!

@0x2b3bfa0 0x2b3bfa0 self-assigned this Dec 6, 2021
@fcollonval
Copy link
Author

Thanks a lot @0x2b3bfa0 and @casperdcl for fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p0-critical bugs & errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants