trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: Prisma Migration fails to execute on self-hosted due to inaccessible registry.npmjs.org

Open kirse opened this issue 1 year ago • 3 comments

Provide environment information

Receiving the error below when trying to docker compose up -d on a self-hosted v4 setup.

Tried to solve it with a custom .npmrc mounted inside the webapp docker-compose.yml (to point to an internal NPM registry), but no dice.

Any reason why executing the migrations tries to reach out to the NPM Registry? And thoughts on a fix / workaround?

node@6478ec4b17a8:~$ pnpm --filter @trigger.dev/database db:migrate:deploy
Internal Error: Error when performing the request to https://registry.npmjs.org/pnpm; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:42195:14)
    at ClientRequest.emit (node:events:518:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:518:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Describe the bug

Expecting webapp to startup without having to reach out to NPM Registry to run DB migrations for node_modules that already exist on disk in the container.

Reproduction repo

N/A

To reproduce

Follow the basic Trigger.dev v4 guide inside a network-limited WSL2 Ubuntu vanilla install.

Additional information

No response

kirse avatar Jun 16 '25 20:06 kirse

Hey @kirse - I've seen this before and I think it's caused by a corepack issue during build. pnpm isn't available in the final image so the shim tries to download it when running the migrations. Will try to get this fixed asap!

nicktrn avatar Jun 17 '25 17:06 nicktrn

@kirse The PR above will hopefully fix this for you! I've built a prerelease image that you can use to test this with. Use this tag for the webapp image instead of v4-beta: corepack-offline-rc.0

nicktrn avatar Jun 18 '25 10:06 nicktrn

@nicktrn Thanks for the quick turn!

(Edit: Moving the follow-on issues to a separate bug)

kirse avatar Jun 18 '25 15:06 kirse