Xcode cloud builds are are failing

Xcode cloud builds were failing with the following error. It wasn't the problem before yesterday morning 26.Apr.2023 before 1:00 PM.

Please let me know what the issue is or if there is anything I can do to solve this.

Additional information:

The app is a react-native app.

error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502 fatal: expected flush after ref listing info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. [in /Volumes/workspace/repository/ios] [!] Invalid Podfile file: cannot load such file -- /Volumes/workspace/repository/node_modules/react-native/scripts/react_native_pods.

from /Volumes/workspace/repository/ios/Podfile:1

-------------------------------------------

require_relative '../node_modules/react-native/scripts/react_native_pods'

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

-------------------------------------------

Error Command exited with non-zero exit-code: 1

I'm having this issue also in my "Run ci_post_clone.sh script" step. I've beenseeing it since last friday (May 5th 2023). Here is th log. It happens during downloading packages, but every time it's with a different package.

[!] Error installing GoogleUtilities
[!] /usr/bin/git clone https://github.com/google/GoogleUtilities.git /Volumes/workspace/tmp/d20230508-7885-fjz83v --template= --single-branch --depth 1 --branch CocoaPods-7.11.0
Cloning into '/Volumes/workspace/tmp/d20230508-7885-fjz83v'...
error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502
fatal: expected flush after ref listing

It seems like there might not be enough memory on the machine for downloading the library?

If anyone on apple's side is looking into this, my log summary is here

I also started having the same issue this evening, the error persists even after multiple retries.

[!] Error installing FirebaseCoreDiagnostics
[!] /usr/bin/git clone https://github.com/firebase/firebase-ios-sdk.git /Volumes/workspace/tmp/d20230513-11348-iqm6nt --template= --single-branch --depth 1 --branch CocoaPods-9.2.0
Cloning into '/Volumes/workspace/tmp/d20230513-11348-iqm6nt'...
error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502
fatal: expected flush after ref listing
Error
Command exited with non-zero exit-code: 1

I also suspect it's a memory problem.

We are experiencing the same flakiness, every ±10th build fails, not always the same lib but always 502 curl 22 from github repos

I'm also experiencing this, would love if the apple dev's could provide some kind of solution as we're wasting cloud build hours

I've also been seeing this for the last month and a half since we started using Xcode Cloud. I really want to use Xcode Cloud but we have lots of failed builds, probably one in 5-10, which is way to frequent. Seems like maybe Github is rate limiting the Xcode Cloud servers or something. What makes you think it would be a memory issue?

Same:

[!] Error installing PromisesObjC

[!] /usr/bin/git clone https://github.com/google/promises.git /Volumes/workspace/tmp/d20231016-10650-c4fygs --template= --single-branch --depth 1 --branch 2.3.1

Seeing this happening a lot today, on more than 50% of xcode cloud builds. example:

 Could not resolve package dependencies:
  Couldn’t update repository submodules:
    Submodule 'external/catch' (https://github.com/catchorg/Catch2.git) registered for path 'external/catch'
    Submodule 'src/external/sha-1' (https://github.com/clibs/sha1.git) registered for path 'src/external/sha-1'
    Submodule 'src/external/sha-2' (https://github.com/kalven/sha-2.git) registered for path 'src/external/sha-2'
    Cloning into '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/external/catch'...
    error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502
    fatal: expected 'packfile'
    fatal: clone of 'https://github.com/catchorg/Catch2.git' into submodule path '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/external/catch' failed
    Failed to clone 'external/catch'. Retry scheduled
    Cloning into '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/src/external/sha-1'...
    error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502
    fatal: expected 'packfile'
    fatal: clone of 'https://github.com/clibs/sha1.git' into submodule path '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/src/external/sha-1' failed
    Failed to clone 'src/external/sha-1'. Retry scheduled
    Cloning into '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/src/external/sha-2'...
    fatal: unable to access 'http://github.com/kalven/sha-2.git/': The requested URL returned error: 502
    fatal: clone of 'https://github.com/kalven/sha-2.git' into submodule path '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/src/external/sha-2' failed
    Failed to clone 'src/external/sha-2'. Retry scheduled
    Cloning into '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/external/catch'...
    Cloning into '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/src/external/sha-1'...
    fatal: unable to access 'http://github.com/clibs/sha1.git/': The requested URL returned error: 502
    fatal: clone of 'https://github.com/clibs/sha1.git' into submodule path '/Volumes/workspace/DerivedData/SourcePackages/checkouts/realm-core/src/external/sha-1' failed
    Failed to clone 'src/external/sha-1' a second time, aborting
  Couldn’t update repository submodules:

I'm seeing the same a lot today, on about 75 percent of builds.

I'm also affected by randomly occurring 502 errors, e.g.:

[!] Error installing FirebaseCrashlytics

[!] /usr/bin/git clone https://github.com/firebase/firebase-ios-sdk.git /Volumes/workspace/tmp/d20240814-8997-10c5blv --template= --single-branch --depth 1 --branch CocoaPods-10.24.0

Cloning into '/Volumes/workspace/tmp/d20240814-8997-10c5blv'...

fatal: unable to access 'http://github.com/firebase/firebase-ios-sdk.git/': The requested URL returned error: 502

error Command failed with exit code 1.

I suspect that it's an issue with XCode Cloud, as our CI pipelines hosted elsewhere don't have trouble connecting to GitHub.

Restarting the build usually works, but it's tedious (and expensive!)

set -x

export HOMEBREW_NO_INSTALL_CLEANUP=TRUE brew install cocoapods

Install Node Version Manager (nvm) and Node.js

brew install nvm export NVM_DIR="$HOME/.nvm" source $(brew --prefix nvm)/nvm.sh

NODE_VER="20.16.0" nvm install $NODE_VER nvm use $NODE_VER

Verify Node.js installation

node -v npm -v

Install Yarn

brew install yarn

Install dependencies

yarn --frozen-lockfile

Change to the ios directory and run pod install

cd ios pod install

Xcode cloud builds are are failing
 
 
Q