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

Error during pnpm install in Dockerfile due to corepack signature verification failure #1372

Open
YI-WebDev opened this issue Feb 25, 2025 · 1 comment

Comments

@YI-WebDev
Copy link

YI-WebDev commented Feb 25, 2025

Describe the bug

The following error occurs when executing the RUN corepack enable pnpm && pnpm install command within the Dockerfile.

=> ERROR [base 4/5] RUN corepack enable pnpm && pnpm install                         0.5s
------
 > [base 4/5] RUN corepack enable pnpm && pnpm install:
0.402 /usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535
0.402   if (key == null || signature == null) throw new Error(`Cannot find matching keyid: ${JSON.stringify({ signatures, keys })}`);
0.402                                               ^
0.402 
0.402 Error: Cannot find matching keyid: {"signatures":[{"sig":"MEYCIQDbcyRXEEpUvMj22WsicmOsvx+ctqHZv1vLScf3/247EAIhANfMkRDNAHdtTDNZ34BVH2z2z0Ef8o5VK4osH6ES9RHW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}
0.402     at verifySignature (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535:47)
0.402     at fetchLatestStableVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21553:5)
0.402     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)    
0.402     at async fetchLatestStableVersion2 (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21672:14)
0.402     at async Engine.getDefaultVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22292:23)
0.402     at async Engine.executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22390:47)
0.402     at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23096:5)
0.402
0.402 Node.js v20.18.0

Link to the Bolt URL that caused the error

None (cuz it's still a build stage)

Steps to reproduce

  1. Build the Docker image using the provided Dockerfile.
  2. The error occurs during the RUN corepack enable pnpm && pnpm install step.

Expected behavior

pnpm install should complete successfully, and the dependencies should be installed.

Screen Recording / Screenshot

Image

Image

Image

Platform

  • OS: Windows
  • Node.js: v20.18.0
  • Using Dockerfile

Provider Used

No response

Model Used

No response

Additional context

I was able to resolve the issue by changing line 9 in the Dockerfile.

Original line:
RUN corepack enable pnpm && pnpm install

Modified line:
RUN npm install -g pnpm && pnpm install

By replacing the original line with the modified line, which uses npm install -g pnpm instead of corepack enable pnpm, the build process now completes successfully. The issue might be specifically related to corepack's handling of pnpm in this environment 🤔

@Bitboy71960
Copy link

j'ai eu le même problème merci de mettre à jour le git avec la solution qui fonctionne et clore le problème
Ligne originale :
RUN corepack enable pnpm && pnpm install

Ligne modifiée :
RUN npm install -g pnpm && pnpm install

Décrivez le bug

L'erreur suivante se produit lors de l'exécution de la RUN corepack enable pnpm && pnpm installcommande dans le Dockerfile.

=> ERROR [base 4/5] RUN corepack enable pnpm && pnpm install                         0.5s
------
 > [base 4/5] RUN corepack enable pnpm && pnpm install:
0.402 /usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535
0.402   if (key == null || signature == null) throw new Error(`Cannot find matching keyid: ${JSON.stringify({ signatures, keys })}`);
0.402                                               ^
0.402 
0.402 Error: Cannot find matching keyid: {"signatures":[{"sig":"MEYCIQDbcyRXEEpUvMj22WsicmOsvx+ctqHZv1vLScf3/247EAIhANfMkRDNAHdtTDNZ34BVH2z2z0Ef8o5VK4osH6ES9RHW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}
0.402     at verifySignature (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535:47)
0.402     at fetchLatestStableVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21553:5)
0.402     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)    
0.402     at async fetchLatestStableVersion2 (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21672:14)
0.402     at async Engine.getDefaultVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22292:23)
0.402     at async Engine.executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22390:47)
0.402     at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23096:5)
0.402
0.402 Node.js v20.18.0

Lien vers l'URL Bolt qui a provoqué l'erreur

Aucun (car c'est encore une étape de construction)

Étapes à suivre pour reproduire

  1. Créez l’image Docker à l’aide du Dockerfile fourni.
  2. L'erreur se produit pendant l' RUN corepack enable pnpm && pnpm installétape.

Comportement attendu

pnpm installdevrait se terminer avec succès et les dépendances devraient être installées.

Enregistrement d'écran / Capture d'écran

Image

Image

Image

Plate-forme

  • Système d'exploitation : Windows
  • Node.js : v20.18.0
  • Utilisation de Dockerfile

Fournisseur utilisé

Aucune réponse

Modèle utilisé

Aucune réponse

Contexte supplémentaire

J'ai pu résoudre le problème en modifiant la ligne 9 dans le Dockerfile.

Ligne originale : RUN corepack enable pnpm && pnpm install

Ligne modifiée : RUN npm install -g pnpm && pnpm install

En remplaçant la ligne d'origine par la ligne modifiée, qui utilise npm install -g pnpmà la place de corepack enable pnpm, le processus de construction se termine désormais avec succès. Le problème peut être spécifiquement lié à corepackla gestion de pnpmdans cet environnement 🤔

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

No branches or pull requests

2 participants