Dd-trace-js: Yarn v2 fails to install dd-trace v0.22.0+ during a GitHub Actions workflow

Created on 6 Aug 2020  Â·  3Comments  Â·  Source: DataDog/dd-trace-js

Describe the bug
I've recently moved one of my repos over to use Yarn v2 and GitHub Actions as the CI. For some reason, the yarn install command fails with the following error when installing dd-trace-js:

➤ YN0007: │ dd-trace@npm:0.24.0 must be built because it never did before or the last one failed
➤ YN0009: │ dd-trace@npm:0.24.0 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-563671f2/build.log)
➤ YN0009: │ dd-trace@npm:0.24.0 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-563671f2/build.log)

Unfortunately, I wasn't able to access those files in GH Actions. This doesn’t happen at all locally (on a Mac Os X Catalina). Does anyone have an idea of why this could be? The GH Action is able to install the 0.21.0-beta.0 release but not the 0.22.0 one and above.

Environment

  • Operation system: Linux version 5.3.0-1032-aws (buildd@lgw01-amd64-026) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #34~18.04.2-Ubuntu SMP as given by cat /proc/version
  • Node version: 12.16.1
  • Tracer version: 0.22.0+
  • Agent version: N/A
bug community detooling

All 3 comments

I'm hitting the same problem. I believe it's because the install script exits with code 1 in CI environments: https://github.com/DataDog/dd-trace-js/blob/9f03306eab90db5621885946a8ba277036bd292e/scripts/should_rebuild.js#L6

A temporary solution for me is to install using CI=false yarn.

The intention of the "install": "node scripts/should_rebuild && node-gyp-build || exit 0" script looks like it should always exit with 0; however, I'm seeing that Yarn v2 does not handle the || exit 0 as expected when it runs this script. I found that if I add parentheses, as follows, the exit 0 is hit, as expected:

"install": "(node scripts/should_rebuild && node-gyp-build) || exit 0"

I'll open a PR for the above.

@vecerek This should be resolved on 0.24.1 or higher

@vecerek I will close this since as mentioned above a fix was released in 0.24.1. Please feel free to reopen if you are still experiencing issues related to the tracer and Yarn2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shortcircuit3 picture shortcircuit3  Â·  6Comments

lancedikson picture lancedikson  Â·  6Comments

wcoc picture wcoc  Â·  3Comments

TheComfyChair picture TheComfyChair  Â·  5Comments

bojand picture bojand  Â·  4Comments