Umami not responding
-
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?
-
@guyds said in Umami not responding:
Isn't there any way I can try to manually run the migration script in recovery mode?
Sure, you should be able to run the migration script in recovery mode. But the issue was that the upstream migration script is not working/complete in all situations, from what I remember. But yes, give it a try .
As for backups, restoring should work. What was the issue there? Just clone the app from backup and check the logs?
-
@girish said in Umami not responding:
@guyds said in Umami not responding:
Isn't there any way I can try to manually run the migration script in recovery mode?
Sure, you should be able to run the migration script in recovery mode. But the issue was that the upstream migration script is not working/complete in all situations, from what I remember. But yes, give it a try .
And how can I do that?
I already tried the instructions from the Umami website, but that doesn't work at all (some npm errors about prisma)As for backups, restoring should work. What was the issue there? Just clone the app from backup and check the logs?
The issue was that whenever I restored a backup, recent or from several weeks ago, the app still didn't start with the same errors in the logs.
-
@guyds so, I had to go back and look since it's been a while since Umami 2 was released. The changelog for package v3.0.0 already says that all event data is lost - https://git.cloudron.io/cloudron/umami-app/-/blob/master/CHANGELOG?ref_type=heads#L134 . Note that this is what upstream does - https://umami.is/docs/migrate-v1-v2#important . Bullet point 3 "The script will NOT migrate any event data into v2."
So, you have only two options:
- Either roll back to v2.4.2 package (which is the last release of umami 1). But of course, you are stuck here forever.
- Just start afresh. You lose all data anyway. Only thing retained with the migration is the websites. Even the tracker code/script is different.
Maybe we should have made a completely separate app for Umami 2 because for all practical purposes it's a different app from Umami 1...
-
@girish I understand this is not Cloudron's fault in any way.
i'm also aware that v2 is not backwards compatible with v1 in that the events can't be migrated.
And while that's definitely a real bummer, it should still be possible according to their docs to upgrade from v1 to v2 and keep all the existing accounts as well as all the websites and therefore also all the website ID's which are used by other people to look into the stats.
If I have to reinstall, I'll lose all the accounts and website id's.Rolling back to v2.4.2 is obviously not the best solution, but even if that could temporarily solve the situation I still can't because the backups can't be restored to a running state for some reason.
But yeah, I guess I have no other option than just starting from scratch.
That'll conclude a nice end of the week after having to deal with several other incompatible software upgrades this weekThanks anyway for you support!
And I know it's not your (nor Cloudron's) fault -
@guyds we are in sync about the situation
But to clarify, you should still be able to follow upstream instructions. It might be a bit different on Cloudron but you should atleast be able to try them out.
- You have to put the app in recovery mode. Repair -> Recovery
- Then, in a web terminal of the app, you can run whatever commands you want.
https://git.cloudron.io/cloudron/umami-app/-/blob/master/start.sh?ref_type=heads is the startup script of Cloudron. When in recovery mode, the app container is created but the start up script is not executed. So, you have to then execute the exports at https://git.cloudron.io/cloudron/umami-app/-/blob/master/start.sh?ref_type=heads#L11 manually in the web terminal. Hopefully, all this makes sense (if you have dealt with Docker before, it should be straightforward).
-
@girish said in Umami not responding:
@guyds we are in sync about the situation
Haha
But to clarify, you should still be able to follow upstream instructions. It might be a bit different on Cloudron but you should atleast be able to try them out.
- You have to put the app in recovery mode. Repair -> Recovery
- Then, in a web terminal of the app, you can run whatever commands you want.
https://git.cloudron.io/cloudron/umami-app/-/blob/master/start.sh?ref_type=heads is the startup script of Cloudron. When in recovery mode, the app container is created but the start up script is not executed. So, you have to then execute the exports at https://git.cloudron.io/cloudron/umami-app/-/blob/master/start.sh?ref_type=heads#L11 manually in the web terminal. Hopefully, all this makes sense (if you have dealt with Docker before, it should be straightforward).
Thanks for the pointers regarding the exports!
Initially, after the exports, I got the same error:
npx @umami/migrate-v1-v2@latest Running v0.15.0 /app/code/node_modules/.prisma/client/default.js:43 throw new Error( ^ Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again. In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report at new PrismaClient (/app/code/node_modules/.prisma/client/default.js:43:11) at /root/.npm/_npx/429c6c96e109f52c/node_modules/@umami/migrate-v1-v2/index.js:298:12 at Object.<anonymous> (/root/.npm/_npx/429c6c96e109f52c/node_modules/@umami/migrate-v1-v2/index.js:323:3) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12) at node:internal/main/run_main_module:23:47 Node.js v18.18.0
But I was able to locate the schema.prisma file, run prisma generate and then fix some other node issues until the migration finally worked:
npx @umami/migrate-v1-v2@latest Running v0.15.0 ✓ DATABASE_URL is defined. ✓ Database connection successful. ✓ Database v1 tables ready for migration. ✓ Database v2 tables found. ✓ Database is ready for migration. ✓ Starting v2 data migration. Please do no cancel this process, it may take a while. ✓ Ran sql file /db/postgresql/data-migration-v2.sql. ✓ Data migration from V1 to V2 tables completed. ✔ Do you want to delete V1 database tables? (Y/N) … n ✓ Migration successfully completed.
Now let's try to restart the app...
-
Unfortunately the app still won't start after the successful database migration.
It seams it tries to run another database migration during startup
Any clues?/app/pkg/start.sh ==> Changing ownership NOTICE: extension "pgcrypto" already exists, skipping CREATE EXTENSION => Running build script that generates the migrations yarn run v1.22.19 $ npm-run-all check-env build-db check-db build-tracker build-geo build-app $ node scripts/check-env.js $ npm-run-all copy-db-files build-db-client $ node scripts/copy-db-files.js Database type detected: postgresql Copied /app/code/db/postgresql to /app/code/prisma $ prisma generate Prisma schema loaded from prisma/schema.prisma ✔ Generated Prisma Client (v5.12.1) to ./node_modules/@prisma/client in 219ms Start using Prisma Client in Node.js (See: https://pris.ly/d/client)
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)
import { PrismaClient } from '@prisma/client/edge'
const prisma = new PrismaClient()See other ways of importing Prisma Client: http://pris.ly/d/importing-client ┌────────────────────────────────────────────────────────────────┐ │ Supercharge your Prisma Client with global database caching, │ │ scalable connection pooling and real-time database events. │ │ Explore Prisma Accelerate: https://pris.ly/cli/-accelerate │ │ Explore Prisma Pulse: https://pris.ly/cli/-pulse │ └────────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────┐ │ Update available 5.12.1 -> 5.13.0 │ │ Run the following to update │ │ yarn add --dev prisma@latest │ │ yarn add @prisma/client@latest │ └─────────────────────────────────────────────────────────┘ $ node scripts/check-db.js ✓ DATABASE_URL is defined. ✓ Database connection successful. ✓ Database version check successful. Error: P3005 The database schema is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline ✗ Command failed: prisma migrate deploy Error: P3005 The database schema is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline 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.
-