Skip to content

SimplePolicy reasons: handle legacy config

Alex Gleason requested to merge mrf-tuples-fix into develop

@NEETzsche was encountering this error:

Jan 22 20:09:46 iddqd mix[16703]: ** (exit) an exception was raised:
Jan 22 20:09:46 iddqd mix[16703]:     ** (FunctionClauseError) no function clause matching in anonymous fn/1 in Pleroma.Web.ActivityPub.MRF.instance_list_from_tuples/1
Jan 22 20:09:46 iddqd mix[16703]:         (pleroma 2.4.51-594-g4ac36ad1-develop) lib/pleroma/web/activity_pub/mrf.ex:107: anonymous fn("baraag.net") in Pleroma.Web.ActivityPub.MRF.instance_list_from_tuples/1                                          
Jan 22 20:09:46 iddqd mix[16703]:         (elixir 1.13.2) lib/enum.ex:1593: Enum."-map/2-lists^map/1-0-"/2
Jan 22 20:09:46 iddqd mix[16703]:         (pleroma 2.4.51-594-g4ac36ad1-develop) lib/pleroma/web/activity_pub/mrf/simple_policy.ex:31: Pleroma.Web.ActivityPub.MRF.SimplePolicy.check_reject/2
Jan 22 20:09:46 iddqd mix[16703]:         (pleroma 2.4.51-594-g4ac36ad1-develop) lib/pleroma/web/activity_pub/mrf/simple_policy.ex:233: Pleroma.Web.ActivityPub.MRF.SimplePolicy.filter/1
Jan 22 20:09:46 iddqd mix[16703]:         (elixir 1.13.2) lib/enum.ex:2396: Enum."-reduce/3-lists^foldl/2-0-"/3
Jan 22 20:09:46 iddqd mix[16703]:         (pleroma 2.4.51-594-g4ac36ad1-develop) lib/pleroma/web/activity_pub/activity_pub.ex:1615: Pleroma.Web.ActivityPub.ActivityPub.user_data_from_user_object/1                                                     
Jan 22 20:09:46 iddqd mix[16703]:         (pleroma 2.4.51-594-g4ac36ad1-develop) lib/pleroma/web/activity_pub/activity_pub.ex:1624: Pleroma.Web.ActivityPub.ActivityPub.fetch_and_prepare_user_from_ap_id/1                                              
Jan 22 20:09:46 iddqd mix[16703]:         (pleroma 2.4.51-594-g4ac36ad1-develop) lib/pleroma/web/activity_pub/activity_pub.ex:1708: Pleroma.Web.ActivityPub.ActivityPub.make_user_from_ap_id/1

It seems to be caused by !3314 (merged), and is happening despite running the database migrations and having no legacy config on the filesystem.

We don't know why the config didn't get updated, but rather than failing so hard I see no reason why to not just handle the legacy config.

Merge request reports

Loading