Troubleshooting Yarn Deployment Error: Corepack Fails to Download Yarn 1.22.19

I’m encountering a persistent issue during my project’s deployment process, specifically related to Yarn and Corepack. Despite previous successful deployments, this error has recently emerged, hindering my progress. Below, I’ve detailed the error

site name: https://riftswap.com/

During deployment, Corepack attempts to download Yarn version 1.22.19 but fails, resulting in an internal error message. Here’s the relevant part of the deployment log:

1:37:09 PM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal)
1:37:09 PM: buildbot version: c32e21f337d920d500f8f7b951fd63f528c2b7b9
1:37:09 PM: Building without cache
1:37:09 PM: Starting to prepare the repo for build
1:37:09 PM: No cached dependencies found. Cloning fresh repo
1:37:09 PM: git clone --filter=blob:none https://github.com/Cothurnal1/RiftSwap
1:37:10 PM: Preparing Git Reference refs/heads/main
1:37:13 PM: Starting to install dependencies
1:37:15 PM: Python version set to 3.8
1:37:15 PM: Attempting Ruby version 2.7.2, read from environment
1:37:16 PM: Using Ruby version 2.7.2
1:37:16 PM: Started restoring cached go cache
1:37:16 PM: Finished restoring cached go cache
1:37:18 PM: go version go1.19.13 linux/amd64
1:37:19 PM: Using PHP version 8.0
1:37:21 PM: Downloading and installing node v18.20.0...
1:37:21 PM: Downloading https://nodejs.org/dist/v18.20.0/node-v18.20.0-linux-x64.tar.xz...
1:37:21 PM: Computing checksum with sha256sum
1:37:21 PM: Checksums matched!
1:37:23 PM: Now using node v18.20.0 (npm v10.5.0)
1:37:23 PM: Enabling Node.js Corepack
1:37:23 PM: Started restoring cached build plugins
1:37:23 PM: Finished restoring cached build plugins
1:37:23 PM: Started restoring cached corepack dependencies
1:37:23 PM: Finished restoring cached corepack dependencies
1:37:23 PM: Started restoring cached yarn cache
1:37:23 PM: Finished restoring cached yarn cache
1:37:23 PM: Corepack is about to download https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz.
1:37:23 PM: Installing Yarn version 1.22.19
1:37:24 PM: Preparing yarn@1.22.19 for immediate activation...
1:37:24 PM: Internal Error: Error when performing the request to https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
1:37:24 PM:     at fetch (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22882:11)
1:37:24 PM:     at async fetchUrlStream (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22914:20)
1:37:24 PM:     at async installVersion (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23084:18)
1:37:24 PM:     at async Engine.ensurePackageManager (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23380:32)
1:37:24 PM:     at async PrepareCommand.execute (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:24147:27)
1:37:24 PM:     at async PrepareCommand.validateAndExecute (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:21173:22)
1:37:24 PM:     at async _Cli.run (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22148:18)
1:37:24 PM:     at async Object.runMain (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:24266:12)
1:37:24 PM: No yarn workspaces detected
1:37:24 PM: Started restoring cached node modules
1:37:24 PM: Finished restoring cached node modules
1:37:24 PM: Corepack is about to download https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz.
1:37:24 PM: Installing npm packages using Yarn version Internal Error: Error when performing the request to https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
1:37:24 PM:     at fetch (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22882:11)
1:37:24 PM:     at async fetchUrlStream (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22914:20)
1:37:24 PM:     at async installVersion (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23084:18)
1:37:24 PM:     at async Engine.ensurePackageManager (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23380:32)
1:37:24 PM:     at async executePackageManagerRequest (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:24236:23)
1:37:24 PM:     at async BinaryCommand.validateAndExecute (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:21173:22)
1:37:24 PM:     at async _Cli.run (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22148:18)
1:37:24 PM:     at async Object.runMain (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:24279:12)
1:37:24 PM: Corepack is about to download https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz.
1:37:24 PM: Corepack is about to download https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz.
1:37:24 PM: Internal Error: Error when performing the request to https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
1:37:24 PM:     at fetch (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22882:11)
1:37:24 PM:     at async fetchUrlStream (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22914:20)
1:37:24 PM:     at async installVersion (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23084:18)
1:37:24 PM:     at async Engine.ensurePackageManager (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23380:32)
1:37:24 PM:     at async executePackageManagerRequest (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:24236:23)
1:37:24 PM:     at async BinaryCommand.validateAndExecute (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:21173:22)
1:37:24 PM:     at async _Cli.run (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22148:18)
1:37:24 PM:     at async Object.runMain (/opt/buildhome/.nvm/versions/node/v18.20.0/lib/node_modules/corepack/dist/lib/corepack.cjs:24279:12)
1:37:24 PM: Error during Yarn install
1:37:24 PM: Failing build: Failed to install dependencies
1:37:24 PM: Finished processing build request in 15.235s
1:37:24 PM: Failed during stage "Install dependencies": dependency_installation script returned non-zero exit code: 1

my build settings:
Screenshot 2024-03-28 at 13.57.57

Looks like this is resolved.