WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.39k stars 4.15k forks source link

Dependencies installation fails on MacOS machine (GitHub actions) with npm version 7.6.0 #29527

Open fluiddot opened 3 years ago

fluiddot commented 3 years ago

Description

The jobs executed on MacOS machines fail after installing the npm version 7.6.0 and running npm ci, it produces the following error:

npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://codeload.github.com/wordpress-mobile/react-native-reanimated/tar.gz/ed48f510fba751cd75da7629e92276166766be91 failed, reason: getaddrinfo ENOTFOUND codeload.github.com
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
I tried to re-run the jobs multiple times just in case was a network issue but keeps throwing the error.

_Related workflow run: https://github.com/WordPress/gutenberg/pull/28886/checks?check_run_id=1960307813_

Step-by-step reproduction instructions

  1. Create a test branch
  2. Install npm version 7.6.0
  3. Remove <7 condition from the npm engine section of package.json file (example)
  4. Run npm install
  5. Add the following code to a GitHub actions workflow executed on a MacOS machine (like React Native E2E Tests (iOS)):

    - name: Use Node.js 14.x
      uses: actions/setup-node@v1
      with:
        node-version: 14.x
    
    - name: Install latest NPM version
      run: npm install -g npm@7.6.0

    The code has to be placed after the checkout and npm cache restore, here is an example.

  6. Push the changes
  7. Create a test PR
  8. Observe that the modified workflow is failing

Expected behaviour

The dependencies installation should succeed.

Actual behaviour

he dependencies install fails with the error described above.

Screenshots or screen recording (optional)

N/A

Code snippet (optional)

WordPress information

Device information

ockham commented 3 years ago

This one is pretty weird :thinking: I've done a bit of Googling, and it seems like this might be related to IPv6 not being available for GitHub Actions, and in case of their macOS environments, not properly falling back to IPv4: https://github.com/actions/virtual-environments/issues/2705.

If that is true, we might have to contact GH about this :thinking:

Edit: This might be because Docker for macOS doesn't support IPv6, see https://docs.docker.com/docker-for-mac/troubleshoot/#known-issues.