Closed freaktechnik closed 1 month ago
I am facing the same issue, the mautrix container keeps restarting
Same isssue with my instance:
@tulir Could you please explain as to why this issue was closed?
Sadly:
Oct 10, 2024 14:51:49 INF Initializing bridge built_at=2024-10-10T12:22:48Z go_version=go1.23.2 name=mautrix-whatsapp version=0.11.0+dev.f758401b
Oct 10, 2024 14:51:49 DBG Initializing database connection
Oct 10, 2024 14:51:49 INF Detected legacy database, migrating... action="migrate legacy db"
Oct 10, 2024 14:51:49 FTL Failed to migrate legacy database error="FOREIGN KEY constraint failed" db_section=main
Still failing:
Oct 16, 2024 14:06:41 INF Initializing bridge built_at=2024-10-16T11:08:42Z go_version=go1.23.2 name=mautrix-whatsapp version=0.11.0
Oct 16, 2024 14:06:41 DBG Initializing database connection
Oct 16, 2024 14:06:41 INF Detected legacy database, migrating... action="migrate legacy db"
Oct 16, 2024 14:06:41 FTL Failed to migrate legacy database error="FOREIGN KEY constraint failed" db_section=main
From trying to apply the migration to a local copy of the sqlite database (first doing the alter tables from https://github.com/mautrix/whatsapp/blob/main/cmd/mautrix-whatsapp/legacymigrate.go, then adding the new tables from https://github.com/mautrix/go/blob/main/bridgev2/database/upgrades/00-latest.sql and then running https://github.com/mautrix/whatsapp/blob/main/cmd/mautrix-whatsapp/legacymigrate.sql) it seems that it's failing on the user_portal insert. I think the problem are entries in user_portal
that have no matching jid
in portal_old
/portal_jid
in portal
. Adding AND EXISTS(SELECT 1 FROM portal WHERE user_portal_old.portal_jid=portal.id)
to the INSERT INTO user_portal
query makes it succeed locally.
This si fixed for me as of 220dc219b8f8cc74c39ff42521cf2675188899c9
Bridge isn't starting, failing with the same error every time.
Edit: identical logs with
version=0.11.0+dev.1f454a82
.