Hi - are there any known issues with Pact and GitL...
# pact-js
m
Hi - are there any known issues with Pact and GitLab CI/CD? My pipeline fails with the below error when running
yarn install
on GitLab but having no issues locally.
error ../node_modules/@pact-foundation/pact-core: Command failed.
👋 1
m
Any more details than that? e.g. logs? What version of yarn? Is it running in a container (and if so, have you seen https://github.com/pact-foundation/pact-js/blob/master/docs/troubleshooting.md
t
I can confirm that pact works fine in GitLab
m
Thanks for the replies - @Matt (pactflow.io / pact-js / pact-go) and @Timothy Jones! It is running in a container and using yarn 1.22.19. These are the logs:
Copy code
[09:22:24] $ rm $logging_pipe
[09:22:24] $ echo "logging: Started."
[09:22:24] logging: Started.
[09:22:24] $ yarn install --frozen-lock
[09:22:24] yarn install v1.22.19
[09:22:24] [1/4] Resolving packages...
[09:22:24] [2/4] Fetching packages...
[09:22:41] [3/4] Linking dependencies...
[09:22:41] warning " > ts-jest@28.0.8" has incorrect peer dependency "jest@^28.0.0".
[09:22:59] [4/4] Building fresh packages...
[09:23:00] warning Error running install script for optional dependency: "/builds/next-gen/channel-team/microservice/availability-bff/node_modules/unix-dgram: Command failed.
[09:23:00] Exit code: 1
[09:23:00] Command: node-gyp rebuild
[09:23:00] Arguments:
[09:23:00] Directory: /builds/next-gen/channel-team/microservice/availability-bff/node_modules/unix-dgram
[09:23:00] Output:
[09:23:00] gyp info it worked if it ends with ok
[09:23:00] gyp info using node-gyp@9.0.0
[09:23:00] gyp info using node@16.16.0 | linux | x64
[09:23:00] gyp info find Python using Python version 3.7.3 found at \"/usr/bin/python3\"
[09:23:00] gyp http GET <https://nodejs.org/download/release/v16.16.0/node-v16.16.0-headers.tar.gz>
[09:23:00] gyp http 200 <https://nodejs.org/download/release/v16.16.0/node-v16.16.0-headers.tar.gz>
[09:23:00] gyp http GET <https://nodejs.org/download/release/v16.16.0/SHASUMS256.txt>
[09:23:00] gyp http 200 <https://nodejs.org/download/release/v16.16.0/SHASUMS256.txt>
[09:23:00] gyp info spawn /usr/bin/python3
[09:23:00] gyp info spawn args [
[09:23:00] gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
[09:23:00] gyp info spawn args   'binding.gyp',
[09:23:00] gyp info spawn args   '-f',
[09:23:00] gyp info spawn args   'make',
[09:23:00] gyp info spawn args   '-I',
[09:23:00] gyp info spawn args   '/builds/next-gen/channel-team/microservice/availability-bff/node_modules/unix-dgram/build/config.gypi',
[09:23:00] gyp info spawn args   '-I',
[09:23:00] gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
[09:23:00] gyp info spawn args   '-I',
[09:23:00] gyp info spawn args   '/root/.cache/node-gyp/16.16.0/include/node/common.gypi',
[09:23:00] gyp info spawn args   '-Dlibrary=shared_library',
[09:23:00] gyp info spawn args   '-Dvisibility=default',
[09:23:00] gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.16.0',
[09:23:00] gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
[09:23:00] gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.16.0/<(target_arch)/node.lib',
[09:23:00] gyp info spawn args   '-Dmodule_root_dir=/builds/next-gen/channel-team/microservice/availability-bff/node_modules/unix-dgram',
[09:23:00] gyp info spawn args   '-Dnode_engine=v8',
[09:23:00] gyp info spawn args   '--depth=.',
[09:23:00] gyp info spawn args   '--no-parallel',
[09:23:00] gyp info spawn args   '--generator-output',
[09:23:00] gyp info spawn args   'build',
[09:23:00] gyp info spawn args   '-Goutput_dir=.'
[09:23:00] gyp info spawn args ]
[09:23:00] gyp ERR! build error
[09:23:00] gyp ERR! stack Error: not found: make
[09:23:00] gyp ERR! stack     at getNotFoundError (/usr/local/lib/node_modules/npm/node_modules/which/which.js:10:17)
[09:23:00] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:18
[09:23:00] gyp ERR! stack     at new Promise (<anonymous>)
[09:23:00] gyp ERR! stack     at step (/usr/local/lib/node_modules/npm/node_modules/which/which.js:54:21)
[09:23:00] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:71:22
[09:23:00] gyp ERR! stack     at new Promise (<anonymous>)
[09:23:00] gyp ERR! stack     at subStep (/usr/local/lib/node_modules/npm/node_modules/which/which.js:69:33)
[09:23:00] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:80:22
[09:23:00] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
[09:23:00] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
[09:23:00] gyp ERR! System Linux 5.15.0-1020-aws
[09:23:00] gyp ERR! command \"/usr/local/bin/node\" \"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
[09:23:00] gyp ERR! cwd /builds/next-gen/channel-team/microservice/availability-bff/node_modules/unix-dgram
[09:23:00] gyp ERR! node -v v16.16.0
[09:23:00] gyp ERR! node-gyp -v v9.0.0
[09:23:00] gyp ERR! not ok"
[09:23:00] info This module is OPTIONAL, you can safely ignore this error
[09:23:01] error /builds/next-gen/channel-team/microservice/availability-bff/node_modules/@pact-foundation/pact-core: Command failed.
[09:23:01] Exit code: 1
[09:23:01] Command: node-gyp rebuild
[09:23:01] Arguments:
[09:23:01] Directory: /builds/next-gen/channel-team/microservice/availability-bff/node_modules/@pact-foundation/pact-core
[09:23:01] Output:
[09:23:01] gyp info it worked if it ends with ok
[09:23:01] gyp info using node-gyp@9.0.0
[09:23:01] gyp info using node@16.16.0 | linux | x64
[09:23:01] gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
[09:23:01] gyp http GET <https://nodejs.org/download/release/v16.16.0/node-v16.16.0-headers.tar.gz>
[09:23:01] gyp http 200 <https://nodejs.org/download/release/v16.16.0/node-v16.16.0-headers.tar.gz>
[09:23:01] gyp http GET <https://nodejs.org/download/release/v16.16.0/SHASUMS256.txt>
[09:23:01] gyp http 200 <https://nodejs.org/download/release/v16.16.0/SHASUMS256.txt>
[09:23:01] gyp info spawn /usr/bin/python3
[09:23:01] gyp info spawn args [
[09:23:01] gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
[09:23:01] gyp info spawn args   'binding.gyp',
[09:23:01] gyp info spawn args   '-f',
[09:23:01] gyp info spawn args   'make',
[09:23:01] gyp info spawn args   '-I',
[09:23:01] gyp info spawn args   '/builds/next-gen/channel-team/microservice/availability-bff/node_modules/@pact-foundation/pact-core/build/config.gypi',
[09:23:01] gyp info spawn args   '-I',
[09:23:01] gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
[09:23:01] gyp info spawn args   '-I',
[09:23:01] gyp info spawn args   '/root/.cache/node-gyp/16.16.0/include/node/common.gypi',
[09:23:01] gyp info spawn args   '-Dlibrary=shared_library',
[09:23:01] gyp info spawn args   '-Dvisibility=default',
[09:23:01] gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.16.0',
[09:23:01] gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
[09:23:01] gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.16.0/<(target_arch)/node.lib',
[09:23:01] gyp info spawn args   '-Dmodule_root_dir=/builds/next-gen/channel-team/microservice/availability-bff/node_modules/@pact-foundation/pact-core',
[09:23:01] gyp info spawn args   '-Dnode_engine=v8',
[09:23:01] gyp info spawn args   '--depth=.',
[09:23:01] gyp info spawn args   '--no-parallel',
[09:23:01] gyp info spawn args   '--generator-output',
[09:23:01] gyp info spawn args   'build',
[09:23:01] gyp info spawn args   '-Goutput_dir=.'
[09:23:01] gyp info spawn args ]
[09:23:01] gyp ERR! build error
[09:23:01] gyp ERR! stack Error: not found: make
[09:23:01] gyp ERR! stack     at getNotFoundError (/usr/local/lib/node_modules/npm/node_modules/which/which.js:10:17)
[09:23:01] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:18
[09:23:01] gyp ERR! stack     at new Promise (<anonymous>)
[09:23:01] gyp ERR! stack     at step (/usr/local/lib/node_modules/npm/node_modules/which/which.js:54:21)
[09:23:01] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:71:22
[09:23:01] gyp ERR! stack     at new Promise (<anonymous>)
[09:23:01] gyp ERR! stack     at subStep (/usr/local/lib/node_modules/npm/node_modules/which/which.js:69:33)
[09:23:01] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:80:22
[09:23:01] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
[09:23:01] gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
[09:23:01] gyp ERR! System Linux 5.15.0-1020-aws
[09:23:01] gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
[09:23:01] gyp ERR! cwd /builds/next-gen/channel-team/microservice/availability-bff/node_modules/@pact-foundation/pact-core
[09:23:01] gyp ERR! node -v v16.16.0
[09:23:01] gyp ERR! node-gyp -v v9.0.0
[09:23:01] gyp ERR! not ok
[09:23:01] info Visit <https://yarnpkg.com/en/docs/cli/install> for documentation about this command.
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
I saw someone had a similar issue so have been trying to g++ to our runner image but no luck as of yet.
m
What kind of container?
It won't work with alpine, just FYI
m
It's a docker container - managed to sort it for now by adding
apt update -y && apt install -y build-essential gcc g++
. Going to create a custom image going forward to fit our requirements better. Thanks again for the help 🙂