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

"Install dependencies" phase takes longer then expected error android eas build #2493

Open
itajenglish opened this issue Aug 13, 2024 · 21 comments

Comments

@itajenglish
Copy link

itajenglish commented Aug 13, 2024

Build/Submit details page URL

https://expo.dev/accounts/listedb/projects/ListedB/builds/118ab276-82f5-428f-bb89-846ef03973d2

Summary

EAS Android builds have started to fail due to dependencies install errors. Previous internal builds with similar dependences worked as expected and now all builds internal or production are failing with this error. It only happens to Android builds and only on EAS. I've tried building locally using the EAS CLI on Mac and the build works so my guess is something is off with the Linux environment the Android builds are being created in.

Managed or bare?

Bare

Environment

Expo Env:

expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 14.6.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
      Yarn: 1.22.22 - ~/.yarn/bin/yarn
      npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
      Watchman: 2024.07.08.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.15.2 - /Users/tajenglish/.gem/ruby/2.7.5/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 23.4, iOS 17.4, macOS 14.4, tvOS 17.4, visionOS 1.1, watchOS 10.4
      Android SDK:
        API Levels: 29, 31, 32, 33, 34, 35
        Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0, 33.0.0, 33.0.0, 33.0.1, 33.0.2, 34.0.0, 34.0.0, 35.0.0
        System Images: android-32 | Google APIs ARM 64 v8a, android-33 | Google APIs ARM 64 v8a, android-34 | Google APIs ARM 64 v8a, android-34 | Google Play ARM 64 v8a, android-35 | Google APIs ARM 64 v8a, android-35 | Google Play ARM 64 v8a
    IDEs:
      Android Studio: 2024.1 AI-241.18034.62.2411.12169540
      Xcode: 15.3/15E204a - /usr/bin/xcodebuild
    npmPackages:
      expo: ^51.0.0 => 51.0.26 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.74.5 => 0.74.5 
      react-native-web: ~0.19.10 => 0.19.12 
    npmGlobalPackages:
      eas-cli: 10.2.3
    Expo Workflow: bare

Expo Doctor:

✔ Check Expo config for common issues
✖ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check npm/ yarn versions
✔ Check for issues with metro config
✔ Check for common project setup issues
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check native tooling versions
✖ Check that packages match versions required by installed Expo SDK
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that native modules use compatible support package versions for installed Expo SDK

Detailed check results:

The following scripts in package.json conflict with the contents of node_modules/.bin: prettier.

The following packages should be updated for best compatibility with the installed expo version:
  @sentry/[email protected] - expected version: ~5.22.0
  @shopify/[email protected] - expected version: 1.6.4
Your project may not work correctly until you install the expected versions of the packages.
Found outdated dependencies
Advice: Use 'npx expo install --check' to review and upgrade your dependencies.

One or more checks failed, indicating possible issues with the project.

Failing EAS Build Env:

AMD, 4 vCPUs, 16 GB RAM
Using image "ubuntu-22.04-jdk-17-ndk-26.1.10909125" based on "ubuntu-2204-jammy-v20240614"
Installed software:
- NDK 26.1.10909125
- Node.js 18.18.0
- Bun 1.1.13
- Yarn 1.22.21
- pnpm 9.3.0
- npm 9.8.1
- Java 17
- node-gyp 10.1.0
Resolved builder image to 'sdk-51'.

Last Successful EAS Build Env: - The server size was changed but I have tested both in recent builds and both still fail
Build URL

AMD, 8 vCPUs, 32 GB RAM
Using image "ubuntu-22.04-jdk-17-ndk-26.1.10909125" based on "ubuntu-2204-jammy-v20240614"
Installed software:
- NDK 26.1.10909125
- Node.js 18.18.0
- Bun 1.1.13
- Yarn 1.22.21
- pnpm 9.3.0
- npm 9.8.1
- Java 17
- node-gyp 10.1.0
Resolved builder image to 'sdk-51'.

Error output

"Install dependencies" phase takes longer then expected and it did not produce any logs in the past 15 minutes. Consider evaluating your package.json file for possible issues with dependencies
"Install dependencies" phase takes a very long time and it did not produce any logs in the past 30 minutes. Most likely an unexpected error happened with your dependencies which caused the process to hang and it will be terminated
"Install dependencies" phase was inactive for over 30 minutes. Please evaluate your package.json file
Build failed

"Install dependencies" phase was inactive for over 30 minutes. Please evaluate your package.json file

Reproducible demo or steps to reproduce from a blank project

Package.json

@itajenglish itajenglish added the needs review Issue is ready to be reviewed by a maintainer label Aug 13, 2024
@szdziedzic szdziedzic added eas build needs more info and removed needs review Issue is ready to be reviewed by a maintainer labels Aug 13, 2024
@szdziedzic
Copy link
Member

Hi @itajenglish,

Do you know what dependency-related changes may have been introduced between commit commit f97f3b15aa065b15321f4a7dc0b15831c90b93ee (last successful Android build) and commit 9711d56049c62ca7c60ecb7b2d6b12b8de558872 (first failing one)?

@szdziedzic
Copy link
Member

We have two similar reports:
#2491
#2480
but I haven't been able to reproduce the issue for them so far and any information might be helpful for me.

@szdziedzic
Copy link
Member

I tried to run yarn install using yarn 1.22.x on my local machine and the install got stuck as well for over 30 mins 🤔

@szdziedzic
Copy link
Member

I see that you are using a custom .npmrc file. May I ask what are the contents of this file?

@itajenglish
Copy link
Author

itajenglish commented Aug 13, 2024

Hi @itajenglish,

Do you know what dependency-related changes may have been introduced between commit commit f97f3b15aa065b15321f4a7dc0b15831c90b93ee (last successful Android build) and commit 9711d56049c62ca7c60ecb7b2d6b12b8de558872 (first failing one)?

The only dependency changes between the first and last was the addition of eslint-config-expo. Which I did remove in subsequent builds.

@itajenglish
Copy link
Author

I see that you are using a custom .npmrc file. May I ask what are the contents of this file?

//npm.pkg.github.com/:_authToken=${LISTEDB_GITHUB_NPM_TOKEN}
@listedb:registry=https://npm.pkg.github.com

@itajenglish
Copy link
Author

I tried to run yarn install using yarn 1.22.x on my local machine and the install got stuck as well for over 30 mins 🤔

Strange I ran the build locally with no issues the yarn install step only took a few seconds. I'll also note I removed the packages we have from the example package.json since you don't have a token to our repo.

@szdziedzic
Copy link
Member

szdziedzic commented Aug 13, 2024

@itajenglish Thanks, can you try to run your build with EAS_BUILD_DISABLE_NPM_CACHE=1?

{
  "build": {
    "production": {
      "env": {
        "EAS_BUILD_DISABLE_NPM_CACHE": "1"
      }
    }
  }
}

https://docs.expo.dev/build-reference/caching/#javascript-dependencies

@itajenglish
Copy link
Author

@itajenglish Thanks, can you try to run your build with EAS_BUILD_DISABLE_NPM_CACHE=1?

{
  "build": {
    "production": {
      "env": {
        "EAS_BUILD_DISABLE_NPM_CACHE": "1"
      }
    }
  }
}

https://docs.expo.dev/build-reference/caching/#javascript-dependencies

Build still failed unfortunately

@szdziedzic
Copy link
Member

Can you try to run yarn install --verbose in the pre-install hook so we can see more logs and get more information about where the install process gets stuck?

https://docs.expo.dev/build-reference/npm-hooks/#eas-build-lifecycle-hooks

@itajenglish
Copy link
Author

itajenglish commented Aug 13, 2024

Can you try to run yarn install --verbose in the pre-install hook so we can see more logs and get more information about where the install process gets stuck?

https://docs.expo.dev/build-reference/npm-hooks/#eas-build-lifecycle-hooks

👀 So here is a head scratcher. The build with pre-hook yarn install worked. Pre hook step took 1 min & 30 seconds and the actual install step took 1 sec, I'm assuming because of cache.

@szdziedzic
Copy link
Member

Oh, okay, it's even more confusing to me 😮 Why would yarn install --verbose work but yarn install in a build done 2h earlier would time out? 🤔

I will double-check if it is possible to be some sort of networking issue, but our service health metrics are all normal and we didn't see any spikes in errors.

the actual install step took 1 sec I'm assuming because of cache

yeah, it makes sense

@itajenglish
Copy link
Author

Oh, okay, it's even more confusing to me 😮 Why would yarn install --verbose work but yarn install in a build done 2h earlier would time out? 🤔

I will double-check if it is possible to be some sort of networking issue, but our service health metrics are all normal and we didn't see any spikes in errors.

the actual install step took 1 sec I'm assuming because of cache

yeah, it makes sense

Yep! Super strange. I will continue to test over the next few weeks as we push more releases and let you know if it starts to work again haha.

@itajenglish
Copy link
Author

It looks like this last build with the yarn install --verbose may have been a one off 😢. It did eventually fail due to some memory issues so I added "NODE_OPTIONS": "--max_old_space_size=7680" along with some other changes "image": "latest" (To test the new Github integration within the Expo dashboard) to the EAS config and installed a dev dependency (react-native-bundle-visualizer). This second build started to get hung up on the pre-install step. I created a new builds removing each of the changes I made from the first one and all of got hung up on the pre-install step

@itajenglish
Copy link
Author

itajenglish commented Aug 14, 2024

Another update: I removed the "EAS_BUILD_DISABLE_NPM_CACHE": "1" env and yarn install --verbose pre-install hook and added the yarn v1 cache pre-install hook and the install step worked 😅🤷🏽‍♂️

https://expo.dev/accounts/listedb/projects/ListedB/builds/7b07dcae-cc37-4c33-ab22-e82ed8ae49a6

@itajenglish
Copy link
Author

Still have issues with the install step. Any updates on what might be causing the issue @szdziedzic?

@itajenglish
Copy link
Author

@szdziedzic I think this issue may be linked to the new build infrastructure for Android. I turned it off in settings and my previous staging and production Android builds have been successful. I will try the new infrastructure again in our next app release to confirm this is the case and open a separate issue.

Staging Build: https://expo.dev/accounts/listedb/projects/ListedB/builds/13591bf8-fb05-4e2f-9ca5-f572dc597563
Production Build: https://expo.dev/accounts/listedb/projects/ListedB/builds/07398a30-8c78-4105-91fa-e7765b732a90

@szdziedzic
Copy link
Member

Thanks for the updates @itajenglish!

I think this issue may be linked to the new build infrastructure for Android

Interesting, I believe I used old N2 machines when trying to replicate your issue, I will test it as well.

Any updates on what might be causing the issue

I'm really puzzled about what might be going on. I didn't see any other similar reports recently and it seems like your Android builds (when not using the cache) are using unmodified yarn installed on a Linux machine with unmodified settings 🤔 I start to wonder whether this might be a bug in yarn 🤔?

@szdziedzic
Copy link
Member

Hey, it seems like you have both successful and failed builds on C3D (AMD) so it doesn't seem to be related 🤔 We also didn't see any issues for C3D for other users 🤔

@itajenglish
Copy link
Author

Thanks for the updates @itajenglish!

I think this issue may be linked to the new build infrastructure for Android

Interesting, I believe I used old N2 machines when trying to replicate your issue, I will test it as well.

Any updates on what might be causing the issue

I'm really puzzled about what might be going on. I didn't see any other similar reports recently and it seems like your Android builds (when not using the cache) are using unmodified yarn installed on a Linux machine with unmodified settings 🤔 I start to wonder whether this might be a bug in yarn 🤔?

Hey @szdziedzic, I don't think it's yarn. I also tried switching to NPM in one of the builds and the install process still hung. We should be doing another build this week! Will report back on any findings.

@HasithaJayatilake
Copy link

HasithaJayatilake commented Sep 6, 2024

Hi @szdziedzic I've been facing the exact same issue for the past couple of weeks as well. Been trying the different approaches on this thread but they unfortunately have not worked out for me either.

We're on:

eas-cli 12.0.0
expo sdk 51
node 18.20.4

using yarn

Here's the most recent one:

https://expo.dev/accounts/fill-up-today/projects/fill-up-today/builds/f0c8b9b3-f3d0-439d-9ced-6e466ce008e2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants