expo / expo/eas-cli

Corepack/pnpm Signature Verification Error on EAS Android Build

Open
#3,032 1 comment 0 reactions 0 assignees View on GitHub
needs review
Dominant language
TypeScript
Stars
1.4k
Forks
236
Avg merge
3d 1h
Merged PRs (30d)
91

Description

### Build/Submit details page URL

https://expo.dev/accounts/smallgis_app/projects/pzl/builds/9faff94a-1803-4c95-a4c0-30b725a4534a

### Summary

**Summary:**
When building my project on EAS (Android), I encounter the following error:

```
Error: Cannot find matching keyid: {"signatures":[...],"keys":[...]}
```

- This issue occurs **only on Android builds in EAS cloud**.
- **iOS builds on EAS**, and **both Android and IOS build locally** (`eas build --local`) without problems.
- The error is thrown when Corepack attempts to use pnpm, even after forcing a Corepack update (`npm install -g corepack@latest`).
- It appears the EAS Android build environment uses an **outdated Corepack version** that does not recognize the latest npm signature keys and cannot verify the pnpm signature, or at least that is what [this article](https://vercel.com/guides/corepack-errors-github-actions) suggest (same issue but on vercel)
- Adding `"packageManager": "pnpm@10.11.0"` to `package.json` does **not** resolve the issue.
- Attempting to update Corepack in the pre-install script does not help, it causes the build to fail even earlier (on _pre-install hook_ stage, instead of failing on _installing dependencies_ stage).
- I tried it with both EAS_NO_FROZEN_LOCKFILE set to `0` and `1`, nothing helped
- I tried using ``--clear-cache` flag, but it didn't help

It was working fine like a month ago. But for past three weeks I can't fix it.

### Managed or bare?

Managed

### Environment

It's EAS remote, locally it works as it should...

```console
Creating new worker instance
AMD, 4 vCPUs, 16 GB RAM
Using image "ubuntu-22.04-jdk-17-ndk-26.1.10909125" based on "ubuntu-2204-jammy-v20250112"
Installed software:
- NDK 26.1.10909125
- Node.js 20.18.3
- Bun 1.2.4
- Yarn 1.22.22
- pnpm 9.15.5
- npm 10.8.2
- Java 17
- node-gyp 11.1.0
Resolved builder image to 'sdk-53'.
Project environment variables:
APP_ENV=development
__API_SERVER_URL=https://api.expo.dev/
EAS_NO_FROZEN_LOCKFILE=1
EXPO_PUBLIC_AUTH0_DOMAIN=[HIDDEN]
EXPO_PUBLIC_AUTH0_CLIENT_ID=[HIDDEN]
EXPO_PUBLIC_DISABLE_PIN_IN_DEV_MODE=true
Environment secrets:
EXPO_TOKEN=********
GOOGLE_MAPS_API_KEY_ANDROID=********
GOOGLE_MAPS_API_KEY_IOS=********
EAS Build environment variables:
SHELL=/bin/sh
NVM_INC=/home/expo/.nvm/versions/node/v20.18.3/include/node
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
PWD=/usr/local/eas-build-worker
LOGNAME=expo
SYSTEMD_EXEC_PID=841
HOME=/home/expo
LANG=en_US.UTF-8
INVOCATION_ID=e6d9fc62e41c43eea459efabad887f68
ANDROID_NDK_HOME=/home/expo/Android/Sdk/ndk/26.1.10909125
NVM_DIR=/home/expo/.nvm
ANDROID_HOME=/home/expo/Android/Sdk
USER=expo
SHLVL=0
ANDROID_SDK_ROOT=/home/expo/Android/Sdk
JOURNAL_STREAM=8:4662
PATH=/home/expo/workingdir/bin:/home/expo/.nvm/versions/node/v20.18.3/bin:/opt/bundletool:/home/expo/Android/Sdk/build-tools/29.0.3:/home/expo/Android/Sdk/build-tools/35.0.0:/home/expo/Android/Sdk/ndk/26.1.10909125:/home/expo/Android/Sdk/cmdline-tools/tools/bin:/home/expo/Android/Sdk/tools:/home/expo/Android/Sdk/tools/bin:/home/expo/Android/Sdk/platform-tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/expo/.bun/bin
LOGGER_LEVEL=info
NVM_BIN=/home/expo/.nvm/versions/node/v20.18.3/bin
EAS_BUILD_WORKER_DIR=/home/expo/eas-build-worker
_=/home/expo/.nvm/versions/node/v20.18.3/bin/node
CI=1
MAESTRO_DRIVER_STARTUP_TIMEOUT=120000
MAESTRO_CLI_NO_ANALYTICS=1
EAS_BUILD=true
EAS_BUILD_RUNNER=eas-build
EAS_BUILD_PLATFORM=android
NVM_NODEJS_ORG_MIRROR=http://10.4.0.203:8081/
EAS_BUILD_PROFILE=preview
EAS_BUILD_GIT_COMMIT_HASH=6439c11c7d3ca3ed405d0430f9b0184954108b44
EAS_BUILD_ID=90595491-33ef-464f-b4c0-fc24141846ce
EAS_BUILD_WORKINGDIR=/home/expo/workingdir/build
EAS_BUILD_PROJECT_ID=2264d897-aabb-4a09-b084-b91651b3b44d
EAS_BUILD_MAVEN_CACHE_URL=http://10.4.0.201:8081/
GRADLE_OPTS=-Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g -Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" -Dorg.gradle.parallel=true -Dorg.gradle.daemon=false
EAS_BUILD_ANDROID_VERSION_CODE=28
EAS_BUILD_USERNAME=michota-smallgis
__EAS_BUILD_ENVS_DIR=/home/expo/workingdir/env
Builder is ready, starting build

### Error output

```error
Running "pnpm install --no-frozen-lockfile" in /home/expo/workingdir/build directory
/home/expo/.nvm/versions/node/v20.18.3/lib/node_modules/corepack/dist/lib/corepack.cjs:21535
if (key == null || signature == null) throw new Error(`Cannot find matching keyid: ${JSON.stringify({ signatures, keys })}`);
^
Error: Cannot find matching keyid: {"signatures":[{"sig":"MEUCIH07VV+EDstCkRkwcTg0gjzTtm9iUgq/V+xUJS99sudvAiEAzpzYWNOVBzSfdPx3gKs+NBqizwhognhKKRF4AQyU5/s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}
at verifySignature (/home/expo/.nvm/versions/node/v20.18.3/lib/node_modules/corepack/dist/lib/corepack.cjs:21535:47)
at fetchLatestStableVersion (/home/expo/.nvm/versions/node/v20.18.3/lib/node_modules/corepack/dist/lib/corepack.cjs:21553:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async fetchLatestStableVersion2 (/home/expo/.nvm/versions/node/v20.18.3/lib/node_modules/corepack/dist/lib/corepack.cjs:21672:14)
at async Engine.getDefaultVersion (/home/expo/.nvm/versions/node/v20.18.3/lib/node_modules/corepack/dist/lib/corepack.cjs:22298:23)
at async Engine.executePackageManagerRequest (/home/expo/.nvm/versions/node/v20.18.3/lib/node_modules/corepack/dist/lib/corepack.cjs:22396:47)
at async Object.runMain (/home/expo/.nvm/versions/node/v20.18.3/lib/node_modules/corepack/dist/lib/corepack.cjs:23102:5)
Node.js v20.18.3
pnpm install --no-frozen-lockfile exited with non-zero code: 1
```

### Reproducible demo or steps to reproduce from a blank project

I simply use `eas build --clear-cache -p android -e preview`. It has worked with `--local` flag, but it didn't work on remote EAS.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.