toddsundsted / ktistec

Single user ActivityPub (https://www.w3.org/TR/activitypub/) server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"cannot instantiate abstract model Relationship::Content::Notification"

felixkrohn opened this issue · comments

since updating to v2.0.0-11 I have the above message when clicking on "Notifications" I get the above message.
In the logs it usually comes after:

2024-07-10T21:22:54.546321Z NOTICE - database: Slow query [   232.129ms] -- SELECT count(*) FROM relationships AS n LEFT JOIN activities AS a ON a.iri = n.to_iri LEFT JOIN actors AS c ON c.iri = a.actor_iri LEFT JOIN objects AS o ON o.iri = a.object_iri LEFT JOIN objects AS e ON e.iri = n.to_iri LEFT JOIN actors AS t ON t.iri = e.attributed_to_iri WHERE +n.from_iri = ? AND n.type IN ("Relationship::Content::Notification::Announce","Relationship::Content::Notification::Follow","Relationship::Content::Notification::Like","Relationship::Content::Notification::Mention","Relationship::Content::Notification::Reply","Relationship::Content::Notification::Follow::Hashtag","Relationship::Content::Notification::Follow::Mention","Relationship::Content::Notification::Follow::Thread","Relationship::Content::Notification")  AND "c".deleted_at IS NULL AND "c".blocked_at IS NULL   AND "o".deleted_at IS NULL AND "o".blocked_at IS NULL   AND "a".undone_at IS NULL   AND "e".deleted_at IS NULL AND "e".blocked_at IS NULL   AND "t".deleted_at IS NULL AND "t".blocked_at IS NULL   AND n.created_at > ? -- args: ["https://sozial.dezern.at/actors/felix", 2024-07-10 10:41:02.0 UTC]
2024-07-10T21:22:54.546576Z NOTICE - database: [{0, "SCAN n"}, {0, "SEARCH a USING INDEX idx_activities_iri (iri=?) LEFT-JOIN"}, {0, "SEARCH c USING INDEX idx_actors_iri (iri=?) LEFT-JOIN"}, {0, "SEARCH o USING INDEX idx_objects_iri (iri=?) LEFT-JOIN"}, {0, "SEARCH e USING INDEX idx_objects_iri (iri=?) LEFT-JOIN"}, {0, "SEARCH t USING INDEX idx_actors_iri (iri=?) LEFT-JOIN"}]

But I'm not 100% sure if it's related.

Again, not sure how to debug this further?

@felixkrohn it sounds like there is a record in your database with the type Relationship::Content::Notification which is abstract. that general type should have been migrated to more specific types in the past. (this migration i'm pretty sure.)

i'm considering a more durable fix for this, but the quick fix is to delete all records of type "Relationship::Content::Notification" from your database.

something like:

delete from relationships where type = "Relationship::Content::Notification";

what version of Ktistec are you running?

what version of Ktistec are you running?

v2.0.0-11

The delete from seems to have done the trick, there were 20 matching records.

thanks! i'm going to leave this open for a short time while i add a bit more resiliency here.