Broken federation for previously federated accounts if instance changed AP ID
If an instance changes AP ID existing federated accounts will no longer federate.
Example:
I reinstalled my Misskey instance after a fugged db and thus have a new AP ID.
My account on there is now in a state of limbo on Pleroma instances that have already federated with it e.g.:
https://neckbeard.xyz/users/9kjbRO8ZgCGlfHZodk
https://patch.cx/users/9iocGql4PF0zG537E8
However, Mastodon (and presumably Misskey) instances are unaffected and will federate with it without issue.
This only affects incoming activities from previously federated accounts. New accounts on the instance federate as expected.
Editing to add example Pleroma log output:
Jul 12 06:56:04 neckbeard.xyz mix[23436]: 06:56:04.128 request_id=FbCtb0YNQJtkG_gADEEx [info] Fetching object https://skippers-bin.com/users/7v1w1r8ce6 via AP
Jul 12 06:56:04 neckbeard.xyz mix[23436]: 06:56:04.985 request_id=FbCtb3lM13FGQocADEFB [info] GET /api/v1/timelines/tag/fediverse
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.003 request_id=FbCtb3lM13FGQocADEFB [info] Sent 200 in 18ms
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.214 request_id=FbCtb4byg2t2uE8ADEFR [info] GET /api/v1/timelines/home
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.221 request_id=FbCtb4dh_Dk_NCUADEFh [info] GET /api/v1/notifications
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.233 request_id=FbCtb4dh_Dk_NCUADEFh [info] Sent 200 in 11ms
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.282 request_id=FbCtb4byg2t2uE8ADEFR [info] Sent 200 in 68ms
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.289 request_id=FbCtb0YNQJtkG_gADEEx [error] Internal server error: %Ecto.ConstraintError{constraint: "conversation_participations_user_id_fkey", message: "constraint error when attempting to insert struct:\n\n * conversation_participations_user_id_fkey (foreign_key_constraint)\n\nIf you would like to stop this constraint violation from raising an\nexception and instead add it as an error to your changeset, please\ncall `foreign_key_constraint/3` on your changeset with the constraint\n`:name` as an option.\n\nThe changeset defined the following constraints:\n\n * users_nickname_index (unique_constraint)\n", type: :foreign_key}
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.289 request_id=FbCtb0YNQJtkG_gADEEx [info] Sent 500 in 1163ms
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.289 request_id=FbCtb0YNQJtkG_gADEEx [info] Converted error Ecto.ConstraintError to 500 response
Jul 12 06:56:05 neckbeard.xyz mix[23436]: 06:56:05.293 [error] #PID<0.256.9> running Pleroma.Web.Endpoint (connection #PID<0.255.9>, stream id 1) terminated
Jul 12 06:56:05 neckbeard.xyz mix[23436]: Server: neckbeard.xyz:80 (http)
Jul 12 06:56:05 neckbeard.xyz mix[23436]: Request: POST /users/sjw/inbox
Jul 12 06:56:05 neckbeard.xyz mix[23436]: ** (exit) an exception was raised:
Jul 12 06:56:05 neckbeard.xyz mix[23436]: ** (Ecto.ConstraintError) constraint error when attempting to insert struct:
Jul 12 06:56:05 neckbeard.xyz mix[23436]: * conversation_participations_user_id_fkey (foreign_key_constraint)
Jul 12 06:56:05 neckbeard.xyz mix[23436]: If you would like to stop this constraint violation from raising an
Jul 12 06:56:05 neckbeard.xyz mix[23436]: exception and instead add it as an error to your changeset, please
Jul 12 06:56:05 neckbeard.xyz mix[23436]: call `foreign_key_constraint/3` on your changeset with the constraint
Jul 12 06:56:05 neckbeard.xyz mix[23436]: `:name` as an option.
Jul 12 06:56:05 neckbeard.xyz mix[23436]: The changeset defined the following constraints:
Jul 12 06:56:05 neckbeard.xyz mix[23436]: * users_nickname_index (unique_constraint)
Jul 12 06:56:05 neckbeard.xyz mix[23436]: (ecto) lib/ecto/repo/schema.ex:687: anonymous fn/4 in Ecto.Repo.Schema.constraints_to_errors/3
Jul 12 06:56:05 neckbeard.xyz mix[23436]: (elixir) lib/enum.ex:1327: Enum."-map/2-lists^map/1-0-"/2
Jul 12 06:56:05 neckbeard.xyz mix[23436]: (ecto) lib/ecto/repo/schema.ex:672: Ecto.Repo.Schema.constraints_to_errors/3
Jul 12 06:56:05 neckbeard.xyz mix[23436]: (ecto) lib/ecto/repo/schema.ex:274: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
Jul 12 06:56:05 neckbeard.xyz mix[23436]: (ecto) lib/ecto/repo/schema.ex:914: anonymous fn/3 in Ecto.Repo.Schema.wrap_in_transaction/6
Jul 12 06:56:05 neckbeard.xyz mix[23436]: (ecto_sql) lib/ecto/adapters/sql.ex:887: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
Jul 12 06:56:05 neckbeard.xyz mix[23436]: (db_connection) lib/db_connection.ex:1415: DBConnection.run_transaction/4
Jul 12 06:56:05 neckbeard.xyz mix[23436]: (pleroma) lib/pleroma/user.ex:1202: Pleroma.User.insert_or_update_user/1