Earlier this week Umami was still working fine, but today I noticed I couldn't access it anymore.
In the Cloudron logs there were a lot of errors related to yarn.
I tried restoring to several older backup versions, but they all resulted in the same errors.
Also updating to newer Umami versions didn't help.
Since the host was still running Ubuntu 20.04 I decided to update to Ubuntu 22.04 as explained in the docs.
Unfortunately there were several issues during the upgrade process (rebuilding the containers hanged for several hours, nginx couldn't start because config file was missing, ...) but in the end I got everything up and running again... except Umami.
So I decided to again restore to an older backup from several weeks ago, a point in time I'm sure it was working fine, but still the app didn't start.
Then I updated again, version after version, to the most recent version 2.11.2 (package version 3.11.2) but still it won't start.
I have the impression that the cause might be that the database isn't migrated correctly from v1 to v2, but I have no clue how I can verify and/or fix this manually.
Here are the relevant log entries:
Apr 25 22:19:00 box:apptask startApp: starting container
Apr 25 22:19:00 box:tasks update 7264: {"percent":90,"message":"Configuring reverse proxy"}
Apr 25 22:19:00 ==> Changing ownership
Apr 25 22:19:00 box:tasks update 7264: {"percent":100,"message":"Done"}
Apr 25 22:19:00 box:taskworker Task took 87.51 seconds
Apr 25 22:19:00 box:tasks setCompleted - 7264: {"result":null,"error":null}
Apr 25 22:19:00 box:tasks update 7264: {"percent":100,"result":null,"error":null}
Apr 25 22:19:01 NOTICE: extension "pgcrypto" already exists, skipping
Apr 25 22:19:01 CREATE EXTENSION
Apr 25 22:19:01 => Running build script that generates the migrations
Apr 25 22:19:01 yarn run v1.22.19
Apr 25 22:19:01 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable. <30>1 2024-04-25T20:19:01Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:01 $ npm-run-all check-env build-db check-db build-tracker build-geo build-app
Apr 25 22:19:01 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:01 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:01 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:01 $ node scripts/check-env.js
Apr 25 22:19:01 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:02 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:02 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:02 $ npm-run-all copy-db-files build-db-client
Apr 25 22:19:02 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:02 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable. <30>1 2024-04-25T20:19:02Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:02 $ node scripts/copy-db-files.js
Apr 25 22:19:02 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:02 Database type detected: postgresql
Apr 25 22:19:02 Copied /app/code/db/postgresql to /app/code/prisma
Apr 25 22:19:03 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:03 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:03 $ prisma generate
Apr 25 22:19:03 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:03 Prisma schema loaded from prisma/schema.prisma
Apr 25 22:19:04 <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ✔ Generated Prisma Client (v5.12.1) to ./node_modules/@prisma/client in 219ms <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - Start using Prisma Client in Node.js (See: https://pris.ly/d/client) <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ``` <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - import { PrismaClient } from '@prisma/client' <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - const prisma = new PrismaClient() <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ``` <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)
Apr 25 22:19:04 ``` <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - import { PrismaClient } from '@prisma/client/edge' <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - const prisma = new PrismaClient() <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ``` <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - See other ways of importing Prisma Client: http://pris.ly/d/importing-client <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ┌────────────────────────────────────────────────────────────────┐ <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ Supercharge your Prisma Client with global database caching, │ <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ scalable connection pooling and real-time database events. │ <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ Explore Prisma Accelerate: https://pris.ly/cli/-accelerate │ <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ Explore Prisma Pulse: https://pris.ly/cli/-pulse │ <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - └────────────────────────────────────────────────────────────────┘ <30>1 2024-04-25T20:19:04Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 -
Apr 25 22:19:05 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable. <30>1 2024-04-25T20:19:05Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:05 $ node scripts/check-db.js
Apr 25 22:19:05 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:05 ✓ DATABASE_URL is defined.
Apr 25 22:19:05 ✓ Database connection successful.
Apr 25 22:19:05 ✓ Database version check successful.
Apr 25 22:19:05 ✗ Umami v1 tables detected. For how to upgrade from v1 to v2 go to https://umami.is/docs/migrate-v1-v2.
Apr 25 22:19:05 error Command failed with exit code 1.
Apr 25 22:19:05 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Apr 25 22:19:05 ERROR: "check-db" exited with 1.
Apr 25 22:19:05 error Command failed with exit code 1.
Apr 25 22:19:05 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Apr 25 22:19:06 ==> Changing ownership
Apr 25 22:19:06 NOTICE: extension "pgcrypto" already exists, skipping <30>1 2024-04-25T20:19:06Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - CREATE EXTENSION
Apr 25 22:19:06 => Running build script that generates the migrations
Apr 25 22:19:06 yarn run v1.22.19
Apr 25 22:19:06 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:06 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:06 $ npm-run-all check-env build-db check-db build-tracker build-geo build-app
Apr 25 22:19:06 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:07 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:07 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:07 $ node scripts/check-env.js
Apr 25 22:19:07 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:07 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:07 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:07 $ npm-run-all copy-db-files build-db-client
Apr 25 22:19:07 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:07 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:07 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:08 $ node scripts/copy-db-files.js
Apr 25 22:19:08 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:08 Database type detected: postgresql
Apr 25 22:19:08 Copied /app/code/db/postgresql to /app/code/prisma
Apr 25 22:19:08 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:08 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:08 $ prisma generate
Apr 25 22:19:08 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:09 Prisma schema loaded from prisma/schema.prisma
Apr 25 22:19:09 <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ✔ Generated Prisma Client (v5.12.1) to ./node_modules/@prisma/client in 207ms <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - Start using Prisma Client in Node.js (See: https://pris.ly/d/client) <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ``` <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - import { PrismaClient } from '@prisma/client' <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - const prisma = new PrismaClient() <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ```
Apr 25 22:19:09 or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate) <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ``` <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - import { PrismaClient } from '@prisma/client/edge' <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - const prisma = new PrismaClient() <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ``` <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - See other ways of importing Prisma Client: http://pris.ly/d/importing-client <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - ┌────────────────────────────────────────────────────────────────┐ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ Supercharge your Prisma Client with global database caching, │ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ scalable connection pooling and real-time database events. │ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ Explore Prisma Accelerate: https://pris.ly/cli/-accelerate │ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ Explore Prisma Pulse: https://pris.ly/cli/-pulse │ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - └────────────────────────────────────────────────────────────────┘ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 -
Apr 25 22:19:09 ┌─────────────────────────────────────────────────────────┐ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ Update available 5.12.1 -> 5.13.0 │ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ Run the following to update │ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ yarn add --dev prisma@latest │ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - │ yarn add @prisma/client@latest │ <30>1 2024-04-25T20:19:09Z cloudron-host-01 b6acced1-aa35-45f1-a274-2badf0b1b962 781 b6acced1-aa35-45f1-a274-2badf0b1b962 - └─────────────────────────────────────────────────────────┘
Apr 25 22:19:10 => Healtheck error: Error: connect ECONNREFUSED 172.18.16.182:3000
Apr 25 22:19:10 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
Apr 25 22:19:10 warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0".
Apr 25 22:19:10 $ node scripts/check-db.js
Apr 25 22:19:10 warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn"
Apr 25 22:19:10 ✓ DATABASE_URL is defined.
Apr 25 22:19:10 ✓ Database connection successful.
Apr 25 22:19:10 ✓ Database version check successful.
Apr 25 22:19:10 ✗ Umami v1 tables detected. For how to upgrade from v1 to v2 go to https://umami.is/docs/migrate-v1-v2.
Apr 25 22:19:10 error Command failed with exit code 1.
Apr 25 22:19:10 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Apr 25 22:19:10 ERROR: "check-db" exited with 1.
Apr 25 22:19:10 error Command failed with exit code 1.
Apr 25 22:19:10 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
How can I get Umami up and running again?