umami: Update script fails with new version of umami
I am using the dockerized version of umami.
The follwoing occurs repeatedly
Aug 10 06:43:24 tharg.myown-it.com start.bash[12428]: umami_1 | yarn run v1.22.19
Aug 10 06:43:24 tharg.myown-it.com start.bash[12428]: umami_1 | $ npm-run-all check-db update-tracker start-server
Aug 10 06:43:24 tharg.myown-it.com start.bash[12428]: umami_1 | $ node scripts/check-db.js
Aug 10 06:43:24 tharg.myown-it.com start.bash[12428]: umami_1 | ✓ DATABASE_URL is defined.
Aug 10 06:43:24 tharg.myown-it.com start.bash[12428]: umami_1 | ✓ Database connection successful.
Aug 10 06:43:25 tharg.myown-it.com start.bash[12428]: umami_1 | ✓ Database tables found.
Aug 10 06:43:25 tharg.myown-it.com start.bash[12428]: umami_1 | Running update...
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: db_1 | 2022-08-10 04:43:26.172 UTC [73] LOG: could not receive data from client: Connection reset by peer
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | Error: P3008
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 |
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | The migration `01_init` is already recorded as applied in the database.
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 |
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | ✗ Command failed: prisma migrate resolve --applied "01_init"
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | Error: P3008
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 |
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | The migration `01_init` is already recorded as applied in the database.
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 |
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 |
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | error Command failed with exit code 1.
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | ERROR: "check-db" exited with 1.
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | error Command failed with exit code 1.
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umami_1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Aug 10 06:43:26 tharg.myown-it.com start.bash[12428]: umamigit_umami_1 exited with code 1
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 21 (3 by maintainers)
Commits related to this issue
- Merge pull request #1394 from umami-software/um-31-prisma-deploy-bug Prisma Deploy 01_init already completed #1393 — committed to umami-software/umami by mikecao 2 years ago
1.37.0 has had it’s migration script updated. Users will need to pull the latest version, then run the following commands to resolve the 02_migration failure.
This issue appears to affect users who were using umami, prior to our migrations re-write. We have a PR up to resolve this issue.
PR: https://github.com/umami-software/umami/pull/1415
Looking a bit deeper into the history of the schema and my database, I can offer some clues (or at least a hypothesis) as to why my database, and perhaps others’, ran into some issues.
I’ve been running Umami for a couple of years now. As such, my database was initialized with
sql/schema.postgresql.sqlas it was a couple years ago. I noticed that 5e0c5643c6331d86f82b176de62087567d713cb7, which rewrotesql/schema.postgresql.sqlto the form/style that is001_init, doesn’t exactly match its predecessor – specifically, theaccount.username_uniqueindex did not exist in the pre-001_initschema. So when #1232 came around and users had to manually mark the prisma migration as already being applied, that was technically a lie because the database didn’t actually match the schema of001_init. That missing index didn’t appear to break normal Umami operation, but it did break applying02_add_event_datatoday. At least, for me.Hopefully this sheds some light on what’s happened and how we arrived here - Perhaps others can chime in and confirm whether their Umami installs were based on the older schema, if they have the
username_uniqueindex, etc and find some commonality (or prove that my breakage is unique).same here, same errors.
yarn run v1.22.19 $ /app/node_modules/.bin/prisma migrate status Prisma schema loaded from prisma/schema.prisma Datasource “db”: MySQL database “umami” at “10.0.0.194:3306”
2 migrations found in prisma/migrations
Your local migration history and the migrations table from your database are different:
The last common migration is: 01_init
The migration have not yet been applied: 02_add_event_data
The migration from the database are not found locally in prisma/migrations: 20220627184654_init Done in 3.00s.
Can either of you provide the following?