umami-software / umami

Umami is a simple, fast, privacy-focused alternative to Google Analytics.
https://umami.is
MIT License
22.15k stars 4.13k forks source link

install "prisma" with the right permissions #2886

Closed sayzlim closed 1 month ago

sayzlim commented 1 month ago

Describe the Bug

I recently rebased my local commits onto the latest changes from the master repository, but the migration is incomplete due to the following errors in the logs. I'm still struggling to resolve the permission issues with Prisma. Do you have any suggestions on how to address this error?

yarn run v1.22.19

$ npm-run-all check-db update-tracker start-server

$ node scripts/check-db.js

✓ DATABASE_URL is defined.

✓ Database connection successful.

✓ Database version check successful.

Error: Can't write to /app/node_modules/@prisma/engines please make sure you install "prisma" with the right permissions.

✗ Command failed: prisma migrate deploy

Error: Can't write to /app/node_modules/@prisma/engines please make sure you install "prisma" with the right permissions.

error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

ERROR: "check-db" exited with 1.

error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Database

PostgreSQL

Relevant log output

No response

Which Umami version are you using? (if relevant)

No response

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Railway

mikecao commented 1 month ago

It might be related to this, https://github.com/prisma/prisma/issues/25020

Can you try rolling back your Prisma version to 5.17?

mikecao commented 1 month ago

It looks like you also need to pin the Prisma version to 5.17 in the docker file

RUN set -x \
    && apk add --no-cache curl \
    && yarn add npm-run-all dotenv semver prisma@5.17.0
sayzlim commented 1 month ago

When I check the Prisma version in the yarn.lock file, it shows that the version is already 5.14. Do I need to upgrade the version or keep 5.14?

prisma@5.14.0:
  version "5.14.0"
  resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.14.0.tgz#ffc4696a43b044b636c3303b7aa98c13c2ade4dd"
  integrity sha512-gCNZco7y5XtjrnQYeDJTiVZmT/ncqCr5RY1/Cf8X2wgLRmyh9ayPAGBNziI4qEE4S6SxCH5omQLVo9lmURaJ/Q==
  dependencies:
    "@prisma/engines" "5.14.0"
sayzlim commented 1 month ago

Thank you, @mikecao! I followed your instructions and updated the Dockerfile, and I’m pleased to report that the deployment is now successful.