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

Signatures changed in the latest version of pnpm #15386

Closed
1 task
hgsanguk opened this issue Feb 2, 2025 · 17 comments · Fixed by #15387
Closed
1 task

Signatures changed in the latest version of pnpm #15386

hgsanguk opened this issue Feb 2, 2025 · 17 comments · Fixed by #15387
Labels
⚠️bug? This might be a bug

Comments

@hgsanguk
Copy link

hgsanguk commented Feb 2, 2025

💡 Summary

When building through Docker compose without modifying any commands in Dockerfile, the following error occurs.
The same error occurs and does not run even if the existing misskey-web container is restarted by docker compose.

 => ERROR [web target-builder 11/11] RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked    0.4s
 => [web native-builder 12/19] COPY --link [packages/misskey-js/package.json, ./packages/misskey-js/]              0.0s
 => [web native-builder 13/19] COPY --link [packages/misskey-reversi/package.json, ./packages/misskey-reversi/]    0.0s
 => [web native-builder 14/19] COPY --link [packages/misskey-bubble-game/package.json, ./packages/misskey-bubble-  0.0s
 => CANCELED [web native-builder 15/19] RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locke  0.7s
------
 > [web target-builder 11/11] RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked        pnpm i --frozen-lockfile --aggregate-output:
0.374 /usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535
0.374   if (key == null || signature == null) throw new Error(`Cannot find matching keyid: ${JSON.stringify({ signatures, keys })}`);
0.374                                               ^
0.374
0.374 Error: Cannot find matching keyid: {"signatures":[{"sig":"MEQCIHGqHbvc2zImUPEPFpT4grh6rMYslel+lAjFArx8+RUdAiBfnJA+bgmUvO5Lctfkq+46KKDQdx/8RhLPge3pA+EdHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}
0.374     at verifySignature (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535:47)
0.374     at fetchLatestStableVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21553:5)
0.374     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
0.374     at async fetchLatestStableVersion2 (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21672:14)
0.374     at async Engine.getDefaultVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22292:23)
0.374     at async Engine.executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22390:47)
0.374     at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23096:5)
0.374
0.374 Node.js v22.11.0
------
failed to solve: process "/bin/sh -c pnpm i --frozen-lockfile --aggregate-output" did not complete successfully: exit code: 1

Signatures of pnpm has been changed since 10.1.0, and the issue seems to have occurred when the 9.15.5 version was released a few hours ago.
So corepack has deployed a new version of this change, but it has not been applied to Node.js 22.x, currently used by Misskey.(nodejs/corepack#612)

I modified Dockerfile in this way and ran it again successfully. I think you may have a better way.

.
.
 # Add explicit pnpm version
RUN corepack enable && corepack prepare [email protected] --activate
WORKDIR /misskey
.
.
RUN corepack enable && corepack prepare [email protected] --activate
WORKDIR /misskey
.
.
.
# Add explicit pnpm version tooo
RUN apt-get update \
	&& apt-get install -y --no-install-recommends \
	ffmpeg tini curl libjemalloc-dev libjemalloc2 \
	&& ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so \
	&& corepack enable \
	&& corepack prepare [email protected] --activate \ 
	&& groupadd -g "${GID}" misskey \
	&& useradd -l -u "${UID}" -g "${GID}" -m -d /misskey misskey \
.
.
.
# Disable integrity check to avoid crash when running container
ENV COREPACK_INTEGRITY_KEYS=0
HEALTHCHECK --interval=5s --retries=20 CMD ["/bin/bash", "/misskey/healthcheck.sh"]
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["pnpm", "run", "migrateandstart"]

🥰 Expected Behavior

Docker image is successfully built, and containers run successfully.

🤬 Actual Behavior

Docker image fails to build, or containers execution failed.

📝 Steps to Reproduce

Occurred in the following situations

  1. When building docker image
  2. When restarting an existing misskey-web container

💻 Frontend Environment

* Model and OS of the device(s):
* Browser:
* Server URL:
* Misskey:

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service: Docker compose
* Misskey: 2024.11.0 to 2025.1.0
* Node: 22.11.0 (from docker image)
* PostgreSQL: from docker image
* Redis: from docker image
* OS and Architecture: Ubuntu Server 24.04.1 LTS

Do you want to address this bug yourself?

  • Yes, I will patch the bug myself and send a pull request
@atsu1125
Copy link
Contributor

atsu1125 commented Feb 3, 2025

It also happens when I pulled Docker pre-built image from Docker Hub and start up.
My instance is down since then.

@Mar0xy
Copy link
Contributor

Mar0xy commented Feb 3, 2025

People also reported this over on our side at Sharkey I also checked the issue linked here and it seems corepack has a env which disables fetching the latest version of a package manager COREPACK_DEFAULT_TO_LATEST=0 setting this as an ENV during the docker build process should work as misskey specifies a pnpm version in package.json which it would then grab instead.

EDIT: example can be found here for any misskey members https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/883 our Dockerfile does differ but essentially it would be applied the same way before any corepack commands.

@atsu1125
Copy link
Contributor

atsu1125 commented Feb 3, 2025

compose.ymlのwebに以下の行を追加するととりあえずは起動します

environment:
 - COREPACK_DEFAULT_TO_LATEST=0

@anatawa12
Copy link
Member

anatawa12 commented Feb 3, 2025

I feel this is a bug of corepack since actual version we use is specified by packageManager field, and corepack downloads latest just for situations when packageManager field is absent, which should not affect when packageManager is specified.

Of course it's better to workaround issue in this project.

@Cnly
Copy link

Cnly commented Feb 3, 2025

@atsu1125 Thanks! Can confirm this works for docker-compose.

@daunJung-dev
Copy link

nodejs/corepack#612

It can help you to solve the problems

@M0o4
Copy link

M0o4 commented Feb 3, 2025

@Mar0xy Thanks!

@CGsama
Copy link
Contributor

CGsama commented Feb 3, 2025

also can try install again

RUN npm install -g corepack@latest
RUN corepack enable && corepack prepare pnpm@latest --activate

@Madhushan1996
Copy link

@atsu1125 Thanks! Can confirm this works for docker-compose.

How did you fix this for docker-compose?

@anatawa12
Copy link
Member

anatawa12 commented Feb 3, 2025

You can set COREPACK_DEFAULT_TO_LATEST=0 as atsu1125 suggests in #15386 (comment)

One full example would be like this. (click misskey/packages/backend/test-federation/compose.tpl.yml to jump to the full compose.yml)
Note: compose.yml is new name of docker-compose.yml. they have same format

- COREPACK_DEFAULT_TO_LATEST=0

@hyphenro
Copy link

hyphenro commented Feb 3, 2025

Make sure if you do fix your pnpm version to 9.15.4 to fix your packageManager version in package.json

"packageManager": "[email protected]",

Do this in all of your workspaces

@github-project-automation github-project-automation bot moved this from Todo to Done in [実験中] 管理用 Feb 3, 2025
marc-rutkowski added a commit to incubateur-ademe/territoires-en-transitions that referenced this issue Feb 3, 2025
cparthur pushed a commit to incubateur-ademe/territoires-en-transitions that referenced this issue Feb 3, 2025
marc-rutkowski added a commit to incubateur-ademe/territoires-en-transitions that referenced this issue Feb 3, 2025
@Danielmtv1
Copy link

@CGsama Thank you very much it worked perfectly, I added these two lines to the dockerFile and it solved the problem

@Eiji1002
Copy link

Eiji1002 commented Feb 3, 2025

@CGsama Thank you very much it worked perfectly, I added these two lines to the dockerFile and it solved the problem

can you help me?

@tai-cha tai-cha marked this as a duplicate of #15399 Feb 5, 2025
@plasenca-d
Copy link

@CGsama Thank you very much it worked perfectly, I added these two lines to the dockerFile and it solved the problem

can you help me?

You just have to add or run

RUN npm install -g corepack@latest
RUN corepack enable && corepack prepare pnpm@latest --activate

@DevlinRocha
Copy link

DevlinRocha commented Feb 5, 2025

you can also use node version 23.7

FROM node:23.7-alpine

RUN corepack enable

this fixed it for me

@longnguyendev
Copy link

RUN apk add --no-cache git \
    && npm install -g corepack@latest\
    && corepack enable pnpm && pnpm install --frozen-lockfile --ignore-scripts \
    && pnpm cache clean

add npm install -g corepack@latest before && corepack enable to your docker file, it works in my case

@crazy-to-bike
Copy link

crazy-to-bike commented Feb 7, 2025

I restarted my Sharkey Docker and now it doesn't start again (Cannot find matching keyid:). Unfortunately I don't know how to fix it with the suggestions made here.

Adding

environment:
 - COREPACK_DEFAULT_TO_LATEST=0

to my docker-compose.yml is running into
ERROR: for web 'ContainerConfig'

Suggestion of @CGsama: Where to run the npnm reinstall?

Edit:

environment:
 - COREPACK_DEFAULT_TO_LATEST=0

stopping the Sharkey docker, then docker system prune --all and starting the Sharkey docker to fetch the packages again solved the problem.

xtexx added a commit to AOSC-Dev/aosc-os-abbs that referenced this issue Feb 8, 2025
This backports node update of corepack to 0.31.0, updating npmjs.org
keys pinned by corepack.

This should fix the following error:

corepack install -g [email protected]
Installing [email protected]...
Internal Error: Cannot find matching keyid: {"signatures":[{"sig":"MEYCIQDkZyZZmBzkRcQowEEFiEcGp4/xV8GBLXxTEzz9QstrsAIhAPx6tvZixjTub6GPqJa82vcWFhUU39JCtoJvcoRK/K39","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}

Link: pnpm/pnpm#9014
Link: nodejs/corepack#612
Link: misskey-dev/misskey#15386
Link: https://github.com/nodejs/corepack/releases/tag/v0.31.0
Link: nodejs/node@63c1859
Link: nodejs/node#56795
Backport-of: 63c1859e019465cbb0b6b46ba0d481fb41d94a22
Reviewed-by: xtex <[email protected]>
Signed-off-by: xtex <[email protected]>
xtexx added a commit to AOSC-Dev/aosc-os-abbs that referenced this issue Feb 8, 2025
This backports node update of corepack to 0.31.0, updating npmjs.org
keys pinned by corepack.

The patch should be removed after nodejs 22.14.0 proposal gets released.

This should fix the following error:

corepack install -g [email protected]
Installing [email protected]...
Internal Error: Cannot find matching keyid: {"signatures":[{"sig":"MEYCIQDkZyZZmBzkRcQowEEFiEcGp4/xV8GBLXxTEzz9QstrsAIhAPx6tvZixjTub6GPqJa82vcWFhUU39JCtoJvcoRK/K39","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}

Link: nodejs/node#56910
Link: pnpm/pnpm#9014
Link: nodejs/corepack#612
Link: misskey-dev/misskey#15386
Link: https://github.com/nodejs/corepack/releases/tag/v0.31.0
Link: nodejs/node@63c1859
Link: nodejs/node#56795
Backport-of: 63c1859e019465cbb0b6b46ba0d481fb41d94a22
Reviewed-by: xtex <[email protected]>
Signed-off-by: xtex <[email protected]>
MingcongBai pushed a commit to AOSC-Dev/aosc-os-abbs that referenced this issue Feb 8, 2025
This backports node update of corepack to 0.31.0, updating npmjs.org
keys pinned by corepack.

The patch should be removed after nodejs 22.14.0 proposal gets released.

This should fix the following error:

corepack install -g [email protected]
Installing [email protected]...
Internal Error: Cannot find matching keyid: {"signatures":[{"sig":"MEYCIQDkZyZZmBzkRcQowEEFiEcGp4/xV8GBLXxTEzz9QstrsAIhAPx6tvZixjTub6GPqJa82vcWFhUU39JCtoJvcoRK/K39","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}

Link: nodejs/node#56910
Link: pnpm/pnpm#9014
Link: nodejs/corepack#612
Link: misskey-dev/misskey#15386
Link: https://github.com/nodejs/corepack/releases/tag/v0.31.0
Link: nodejs/node@63c1859
Link: nodejs/node#56795
Backport-of: 63c1859e019465cbb0b6b46ba0d481fb41d94a22
Reviewed-by: xtex <[email protected]>
Signed-off-by: xtex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
Development

Successfully merging a pull request may close this issue.