ReceiverWorker nil crash in side effects of like/announce/update handling #888

Open
opened 2025-03-21 01:57:06 +00:00 by Oneric · 0 comments
Member

Your setup

From source

Extra details

Alpine 3.21

Version

current master (74182abb5b)

PostgreSQL version

17

What’s the issue?

Errors like this have long since showed up in my logs, but i initially didn’t pay too much attention to them assuming (since no further errors are logged) they fix themselves in a retry. However, when I actually checked an examples recently the announce wasn't listed on the announced post. All other examples do however get listed, maybe this one activity just happened to actually get retracted by its actor?

At first look I’m confused by how this can be nil here when it must have been non-nil and locally known for the main processing to conclude before.
Either way it would probably be best to move all DB alterations related to an activity into the same, single transaction.

Noting it down here so it doesn't keep getting forgotten and to also allow others to pick this up.

Stacktraces

All received activities originated from (almost) up-to-date (stable or develop) Akkoma instances

Announce Stacktrace

** (KeyError) key :data not found in: nil

If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map
    (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/utils.ex:300: Pleroma.Web.ActivityPub.Utils.update_element_in_object/4
    (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/side_effects.ex:255: Pleroma.Web.ActivityPub.SideEffects.handle/2
    (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/pipeline.ex:50: Pleroma.Web.ActivityPub.Pipeline.do_common_pipeline/2
    (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1400: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4

Like Stacktrace

** (KeyError) key :data not found in: nil

If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map
    (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/utils.ex:424: Pleroma.Web.ActivityPub.Utils.fetch_likes/1
    (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/utils.ex:405: Pleroma.Web.ActivityPub.Utils.add_like_to_object/2
    (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/side_effects.ex:182: Pleroma.Web.ActivityPub.SideEffects.handle/2
    (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/pipeline.ex:50: Pleroma.Web.ActivityPub.Pipeline.do_common_pipeline/2

Update Stacktrace

** (KeyError) key :data not found in: nil

If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map
    (pleroma 3.15.2-wf-56-gd50bca56-u74182abb5-trunk) lib/pleroma/web/activity_pub/side_effects.ex:428: Pleroma.Web.ActivityPub.SideEffects.handle_update_object/2
    (pleroma 3.15.2-wf-56-gd50bca56-u74182abb5-trunk) lib/pleroma/web/activity_pub/pipeline.ex:50: Pleroma.Web.ActivityPub.Pipeline.do_common_pipeline/2
    (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1400: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
    (db_connection 2.7.0) lib/db_connection.ex:1756: DBConnection.run_transaction/4

Severity

I can manage

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Your setup From source ### Extra details Alpine 3.21 ### Version current master (74182abb5b4b1186e4c68c426ad6ee680ebc804d) ### PostgreSQL version 17 ### What’s the issue? Errors like this have long since showed up in my logs, but i initially didn’t pay too much attention to them assuming (since no further errors are logged) they fix themselves in a retry. However, when I actually checked an examples recently the announce wasn't listed on the announced post. All other examples do however get listed, maybe this one activity just happened to actually get retracted by its actor? At first look I’m confused by how this can be `nil` here when it must have been non-nil and locally known for the main processing to conclude before. Either way it would probably be best to move _all_ DB alterations related to an activity into the same, single transaction. Noting it down here so it doesn't keep getting forgotten and to also allow others to pick this up. ### Stacktraces All received activities originated from (almost) up-to-date (stable or develop) Akkoma instances **Announce Stacktrace** ``` ** (KeyError) key :data not found in: nil If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/utils.ex:300: Pleroma.Web.ActivityPub.Utils.update_element_in_object/4 (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/side_effects.ex:255: Pleroma.Web.ActivityPub.SideEffects.handle/2 (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/pipeline.ex:50: Pleroma.Web.ActivityPub.Pipeline.do_common_pipeline/2 (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1400: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4 ``` **Like Stacktrace** ``` ** (KeyError) key :data not found in: nil If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/utils.ex:424: Pleroma.Web.ActivityPub.Utils.fetch_likes/1 (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/utils.ex:405: Pleroma.Web.ActivityPub.Utils.add_like_to_object/2 (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/side_effects.ex:182: Pleroma.Web.ActivityPub.SideEffects.handle/2 (pleroma 3.15.2-wf-66-g34fdf125-u74182abb5-trunk) lib/pleroma/web/activity_pub/pipeline.ex:50: Pleroma.Web.ActivityPub.Pipeline.do_common_pipeline/2 ``` **Update Stacktrace** ``` ** (KeyError) key :data not found in: nil If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map (pleroma 3.15.2-wf-56-gd50bca56-u74182abb5-trunk) lib/pleroma/web/activity_pub/side_effects.ex:428: Pleroma.Web.ActivityPub.SideEffects.handle_update_object/2 (pleroma 3.15.2-wf-56-gd50bca56-u74182abb5-trunk) lib/pleroma/web/activity_pub/pipeline.ex:50: Pleroma.Web.ActivityPub.Pipeline.do_common_pipeline/2 (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1400: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4 (db_connection 2.7.0) lib/db_connection.ex:1756: DBConnection.run_transaction/4 ``` ### Severity I can manage ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
Oneric added the
bug
label 2025-03-21 01:57:06 +00:00
Oneric changed title from [bug] nil crash in side effects of like/announce/update handling to [bug] nil ReceiverWorker crash in side effects of like/announce/update handling 2025-03-21 01:58:51 +00:00
Oneric changed title from [bug] nil ReceiverWorker crash in side effects of like/announce/update handling to ReceiverWorker nil crash in side effects of like/announce/update handling 2025-03-21 01:59:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: AkkomaGang/akkoma#888
No description provided.