> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Yarn Package invalid key

### **Version/Environment (if relevant):**

Not Domino version specific. Applies to any Domino compute environment using the yarn package.

## **Issue:**

A Domino environment build fails with a GPG signature error related to the yarn package, similar to the following:

```
GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures
were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@dan.cx>
```

## **Root Cause:**

The GPG key used to sign the yarn package repository has expired or become invalid. The environment's Dockerfile is using a stale key that can no longer be verified, causing the build to fail.

## **Resolution:**

Add one of the following to the top of the environment's Dockerfile to refresh the yarn package key. Try each option in order if the previous one does not work, as the correct approach may vary depending on your specific environment version.

**Option 1 — Standard key refresh (try this first):**

```
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
```

**Option 2 — Alternative using gpg dearmor:**

```
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg|gpg --dearmor|sudo tee /usr/share/keyrings/yarnkey.gpg>/dev/null
```

**Option 3 — Recommended if apt-key is deprecated in your environment:**

```
ENV YARNKEY=yarn-keyring.gpg
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo gpg --dearmour -o /usr/share/keyrings/$YARNKEY && \
 echo "deb [signed-by=/usr/share/keyrings/$YARNKEY] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
```

### **Notes/Information:**

* These are best-effort suggestions that have been verified to work in a standard Domino environment. Results may vary depending on your specific environment configuration.
* `apt-key` is becoming deprecated in newer Linux distributions. If Options 1 and 2 do not work, use Option 3 which uses the modern `gpg --dearmour` approach with a signed-by keyring.
* If you are seeing a similar error for an Nvidia GPG key rather than yarn, refer to the related article: **Build error for Nvidia GPG key**.
* While Domino Support will assist where possible, environment build issues are primarily the responsibility of local admins. If these steps do not resolve the issue, the best first step is to engage your local environment administrators.


## Related topics

- [Troubleshooting](/knowledge-base/troubleshooting-overview.md)
- [Connect to an Amazon EMR cluster from Domino](/cloud/platform-capabilities/features/compute-clusters-hpc/spark/hadoop-and-spark/amazon-emr-cluster.md)
- [Invalid Client Credentials When Generating A Service Account Token](/knowledge-base/invalid-client-credential-when-generating-service-account-token.md)
- ["Invalid host" error when trying to connect MiniO server as a Generic S3 data source](/knowledge-base/invalid-host-error-when-trying-to-connect-minio-server-as-a-generic-s3-data-source.md)
