umami: v2.18 runs into file system errors in Kubernetes
Describe the Bug
First of all, thanks a lot for the new version - data-before-send looks like it is exactly what we need and saves us from implementing a custom tracker wrapper.
Unfortunately, I haven’t been able to deploy the image (docker.umami.is/umami-software/umami:postgresql-v2.17.0) into our Kubernetes cluster yet. I get the file-system-permission-related error below in the migration step, more precisely when running applyMigration(). If I skip the migration step, it fails a bit later writing the manifest (log output also below).
I can’t say for sure that the issue isn’t on our side, but everything is working fine with v2.17.0. Unfortunately, I haven’t been able to reproduce the issue locally (on Mac, if that’s relevant), running the image via docker-compose works. Sorry I can’t produce a minimal reproducible example.
Database
PostgreSQL
Relevant log output
> umami@2.18.0 start-docker /app
> npm-run-all check-db update-tracker set-routes-manifest start-server
> umami@2.18.0 check-db /app
> node scripts/check-db.js
✓ DATABASE_URL is defined.
✓ Database connection successful.
✓ Database version check successful.
Error: Can't write to /app/node_modules/.pnpm/@prisma+engines@6.1.0/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/.pnpm/@prisma+engines@6.1.0/node_modules/@prisma/engines please make sure you install "prisma" with the right permissions.
ELIFECYCLE Command failed with exit code 1.
ERROR: "check-db" exited with 1.
ELIFECYCLE Command failed with exit code 1.
---
> umami@2.18.0 start-docker /app
> npm-run-all check-db update-tracker set-routes-manifest start-server
> umami@2.18.0 check-db /app
> node scripts/check-db.js
✓ DATABASE_URL is defined.
✓ Database connection successful.
✓ Database version check successful.
> umami@2.18.0 update-tracker /app
> node scripts/update-tracker.js
> umami@2.18.0 set-routes-manifest /app
> node scripts/set-routes-manifest.js
Using original Next.js routes manifest
node:fs:2426
return binding.writeFileUtf8(
^
Error: EACCES: permission denied, open '/app/.next/routes-manifest.json'
at Object.writeFileSync (node:fs:2426:20)
at Object.<anonymous> (/app/scripts/set-routes-manifest.js:74:4)
at Module._compile (node:internal/modules/cjs/loader:1730:14)
at Object..js (node:internal/modules/cjs/loader:1895:10)
at Module.load (node:internal/modules/cjs/loader:1465:32)
at Function._load (node:internal/modules/cjs/loader:1282:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
at node:internal/main/run_main_module:36:49 {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/app/.next/routes-manifest.json'
}
Node.js v22.15.0
ELIFECYCLE Command failed with exit code 1.
ERROR: "set-routes-manifest" exited with 1.
ELIFECYCLE Command failed with exit code 1.
Which Umami version are you using? (if relevant)
v2.18.0
Which browser are you using? (if relevant)
irrelevant
How are you deploying your application? (if relevant)
Kubernetes via helm chart
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 6
- Comments: 20 (5 by maintainers)
Same issue with
docker-composedeployments.@mikaello Given your OpenShift setup, you could build you own image adding this instruction in Dockerfile before the USER line:
(as per OpenShift docs)
It could be more fine-grained, but it would work.
OR going your way, you might as well copy the entire app folder, I guess it would work too. Edited quote:
@desw0lf Could you please create another issue, sharing more details about your setup? Seems like you’re building you own image? (Issue is probably caused by
BASE_PATH, I’ll have a look at it). Edit: confirmed, users who build their own images withBASE_PATHwill have start issues, I’ll submit a fix.People here have permissions issues, and it’s most likely not new btw, high probability that their setups already failed in previous versions if runned with
COLLECT_API_ENDPOINT(update-tracker would have failed too).