[bug] Remote followed user disappeared #516

Open
opened 2023-03-28 11:39:18 +00:00 by floogulinc · 7 comments

Your setup

OTP

Extra details

Ubuntu 22.04

Version

2023.03

PostgreSQL version

14.6 (Ubuntu 14.6-0ubuntu0.22.04.1)

What were you trying to do?

I followed a remote user on misskey.io a week or so ago.

What did you expect to happen?

The user continues to be followed and their posts are visible.

What actually happened?

The follow disappeared and their posts are gone. This is what I see now:
chrome_WgsUtwwORh

Yet when I look at their profile on the remote instance it still shows me as following them. When I try to click follow again it doesn't work and produces the output below. Also trying to view the profile (https://headpat.cafe/users/ATQEjLlHtQOB5TN9Zg) when not signed in results in "Can't find user".

Logs

11:29:31.624 request_id=F1CRzTkBHnMl2jIAADmD [error] Internal server error: %Protocol.UndefinedError{protocol: Jason.Encoder, value: #Ecto.Changeset<action: :insert, changes: %{actor: "https://headpat.cafe/users/alice", id: "https://headpat.cafe/activities/8b332128-b113-4b87-9ad6-7b7c9232a77b", object: "https://misskey.io/users/9c17fadval", to: ["https://misskey.io/users/9c17fadval"], type: "Follow"}, errors: [object: {"user is deactivated", []}], data: #Pleroma.Web.ActivityPub.ObjectValidators.FollowValidator<>, valid?: false>, description: "Jason.Encoder protocol must always be explicitly implemented.\n\nIf you own the struct, you can derive the implementation specifying which fields should be encoded to JSON:\n\n    @derive {Jason.Encoder, only: [....]}\n    defstruct ...\n\nIt is also possible to encode all fields, although this should be used carefully to avoid accidentally leaking private information when new fields are added:\n\n    @derive Jason.Encoder\n    defstruct ...\n\nFinally, if you don't own the struct you want to encode to JSON, you may use Protocol.derive/3 placed outside of any module:\n\n    Protocol.derive(Jason.Encoder, NameOfTheStruct, only: [...])\n    Protocol.derive(Jason.Encoder, NameOfTheStruct)\n"}
11:29:31.624 [error] #PID<0.6800.0> running Pleroma.Web.Endpoint (connection #PID<0.6748.0>, stream id 17) terminated
Server: headpat.cafe:80 (http)
Request: POST /api/v1/accounts/ATQEjLlHtQOB5TN9Zg/follow
** (exit) an exception was raised:
    ** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for #Ecto.Changeset<action: :insert, changes: %{actor: "https://headpat.cafe/users/alice", id: "https://headpat.cafe/activities/8b332128-b113-4b87-9ad6-7b7c9232a77b", object: "https://misskey.io/users/9c17fadval", to: ["https://misskey.io/users/9c17fadval"], type: "Follow"}, errors: [object: {"user is deactivated", []}], data: #Pleroma.Web.ActivityPub.ObjectValidators.FollowValidator<>, valid?: false> of type Ecto.Changeset (a struct), Jason.Encoder protocol must always be explicitly implemented.
If you own the struct, you can derive the implementation specifying which fields should be encoded to JSON:
    @derive {Jason.Encoder, only: [....]}
    defstruct ...
It is also possible to encode all fields, although this should be used carefully to avoid accidentally leaking private information when new fields are added:
    @derive Jason.Encoder
    defstruct ...
Finally, if you don't own the struct you want to encode to JSON, you may use Protocol.derive/3 placed outside of any module:
    Protocol.derive(Jason.Encoder, NameOfTheStruct, only: [...])
    Protocol.derive(Jason.Encoder, NameOfTheStruct)
. This protocol is implemented for the following type(s): Any, Atom, BitString, Date, DateTime, Decimal, Ecto.Association.NotLoaded, Ecto.Schema.Metadata, Float, Function, Integer, Jason.Fragment, Jason.OrderedObject, List, Map, NaiveDateTime, OpenApiSpex.JsonErrorResponse, OpenApiSpex.OpenApi, Pleroma.Emoji.Pack, Pleroma.Healthcheck, Pleroma.Object, Pleroma.User.NotificationSetting, Pleroma.Web.ActivityPub.ObjectValidators.AnswerValidator, Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidator, Pleroma.Web.ActivityPub.ObjectValidators.AudioVideoValidator, Pleroma.Web.ActivityPub.ObjectValidators.BlockValidator, Pleroma.Web.ActivityPub.ObjectValidators.EventValidator, Pleroma.Web.ActivityPub.ObjectValidators.QuestionValidator, Pleroma.Web.ApiSpec.Schemas.Account, Pleroma.Web.ApiSpec.Schemas.AccountField, Pleroma.Web.ApiSpec.Schemas.AccountRelationship, Pleroma.Web.ApiSpec.Schemas.ActorType, Pleroma.Web.ApiSpec.Schemas.Announcement, Pleroma.Web.ApiSpec.Schemas.ApiError, Pleroma.Web.ApiSpec.Schemas.App, Pleroma.Web.ApiSpec.Schemas.Attachment, Pleroma.Web.ApiSpec.Schemas.BooleanLike, Pleroma.Web.ApiSpec.Schemas.Conversation, Pleroma.Web.ApiSpec.Schemas.Emoji, Pleroma.Web.ApiSpec.Schemas.FlakeID, Pleroma.Web.ApiSpec.Schemas.List, Pleroma.Web.ApiSpec.Schemas.Poll, Pleroma.Web.ApiSpec.Schemas.PushSubscription, Pleroma.Web.ApiSpec.Schemas.ScheduledStatus, Pleroma.Web.ApiSpec.Schemas.Status, Pleroma.Web.ApiSpec.Schemas.Tag, Pleroma.Web.ApiSpec.Schemas.VisibilityScope, Regex, Time, Tuple
        (jason 1.4.0) lib/jason.ex:213: Jason.encode_to_iodata!/2
        (phoenix 1.6.16) lib/phoenix/controller.ex:281: Phoenix.Controller.json/2
        (pleroma 3.7.1-0-gfef4bae) lib/pleroma/web/mastodon_api/controllers/account_controller.ex:5: Pleroma.Web.MastodonAPI.AccountController.action/2
        (pleroma 3.7.1-0-gfef4bae) lib/pleroma/web/mastodon_api/controllers/account_controller.ex:5: Pleroma.Web.MastodonAPI.AccountController.phoenix_controller_pipeline/2
        (phoenix 1.6.16) lib/phoenix/router.ex:354: Phoenix.Router.__call__/2
        (pleroma 3.7.1-0-gfef4bae) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2
        (pleroma 3.7.1-0-gfef4bae) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2
        (phoenix 1.6.16) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4

Severity

I cannot use it as easily as I'd like

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Your setup OTP ### Extra details Ubuntu 22.04 ### Version 2023.03 ### PostgreSQL version 14.6 (Ubuntu 14.6-0ubuntu0.22.04.1) ### What were you trying to do? I followed a remote user on misskey.io a week or so ago. ### What did you expect to happen? The user continues to be followed and their posts are visible. ### What actually happened? The follow disappeared and their posts are gone. This is what I see now: ![chrome_WgsUtwwORh](/attachments/7f3ba315-eee1-4b13-b503-5504bbad71b8) Yet when I look at their profile on the remote instance it still shows me as following them. When I try to click follow again it doesn't work and produces the output below. Also trying to view the profile (https://headpat.cafe/users/ATQEjLlHtQOB5TN9Zg) when not signed in results in "Can't find user". ### Logs ``` 11:29:31.624 request_id=F1CRzTkBHnMl2jIAADmD [error] Internal server error: %Protocol.UndefinedError{protocol: Jason.Encoder, value: #Ecto.Changeset<action: :insert, changes: %{actor: "https://headpat.cafe/users/alice", id: "https://headpat.cafe/activities/8b332128-b113-4b87-9ad6-7b7c9232a77b", object: "https://misskey.io/users/9c17fadval", to: ["https://misskey.io/users/9c17fadval"], type: "Follow"}, errors: [object: {"user is deactivated", []}], data: #Pleroma.Web.ActivityPub.ObjectValidators.FollowValidator<>, valid?: false>, description: "Jason.Encoder protocol must always be explicitly implemented.\n\nIf you own the struct, you can derive the implementation specifying which fields should be encoded to JSON:\n\n @derive {Jason.Encoder, only: [....]}\n defstruct ...\n\nIt is also possible to encode all fields, although this should be used carefully to avoid accidentally leaking private information when new fields are added:\n\n @derive Jason.Encoder\n defstruct ...\n\nFinally, if you don't own the struct you want to encode to JSON, you may use Protocol.derive/3 placed outside of any module:\n\n Protocol.derive(Jason.Encoder, NameOfTheStruct, only: [...])\n Protocol.derive(Jason.Encoder, NameOfTheStruct)\n"} 11:29:31.624 [error] #PID<0.6800.0> running Pleroma.Web.Endpoint (connection #PID<0.6748.0>, stream id 17) terminated Server: headpat.cafe:80 (http) Request: POST /api/v1/accounts/ATQEjLlHtQOB5TN9Zg/follow ** (exit) an exception was raised: ** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for #Ecto.Changeset<action: :insert, changes: %{actor: "https://headpat.cafe/users/alice", id: "https://headpat.cafe/activities/8b332128-b113-4b87-9ad6-7b7c9232a77b", object: "https://misskey.io/users/9c17fadval", to: ["https://misskey.io/users/9c17fadval"], type: "Follow"}, errors: [object: {"user is deactivated", []}], data: #Pleroma.Web.ActivityPub.ObjectValidators.FollowValidator<>, valid?: false> of type Ecto.Changeset (a struct), Jason.Encoder protocol must always be explicitly implemented. If you own the struct, you can derive the implementation specifying which fields should be encoded to JSON: @derive {Jason.Encoder, only: [....]} defstruct ... It is also possible to encode all fields, although this should be used carefully to avoid accidentally leaking private information when new fields are added: @derive Jason.Encoder defstruct ... Finally, if you don't own the struct you want to encode to JSON, you may use Protocol.derive/3 placed outside of any module: Protocol.derive(Jason.Encoder, NameOfTheStruct, only: [...]) Protocol.derive(Jason.Encoder, NameOfTheStruct) . This protocol is implemented for the following type(s): Any, Atom, BitString, Date, DateTime, Decimal, Ecto.Association.NotLoaded, Ecto.Schema.Metadata, Float, Function, Integer, Jason.Fragment, Jason.OrderedObject, List, Map, NaiveDateTime, OpenApiSpex.JsonErrorResponse, OpenApiSpex.OpenApi, Pleroma.Emoji.Pack, Pleroma.Healthcheck, Pleroma.Object, Pleroma.User.NotificationSetting, Pleroma.Web.ActivityPub.ObjectValidators.AnswerValidator, Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidator, Pleroma.Web.ActivityPub.ObjectValidators.AudioVideoValidator, Pleroma.Web.ActivityPub.ObjectValidators.BlockValidator, Pleroma.Web.ActivityPub.ObjectValidators.EventValidator, Pleroma.Web.ActivityPub.ObjectValidators.QuestionValidator, Pleroma.Web.ApiSpec.Schemas.Account, Pleroma.Web.ApiSpec.Schemas.AccountField, Pleroma.Web.ApiSpec.Schemas.AccountRelationship, Pleroma.Web.ApiSpec.Schemas.ActorType, Pleroma.Web.ApiSpec.Schemas.Announcement, Pleroma.Web.ApiSpec.Schemas.ApiError, Pleroma.Web.ApiSpec.Schemas.App, Pleroma.Web.ApiSpec.Schemas.Attachment, Pleroma.Web.ApiSpec.Schemas.BooleanLike, Pleroma.Web.ApiSpec.Schemas.Conversation, Pleroma.Web.ApiSpec.Schemas.Emoji, Pleroma.Web.ApiSpec.Schemas.FlakeID, Pleroma.Web.ApiSpec.Schemas.List, Pleroma.Web.ApiSpec.Schemas.Poll, Pleroma.Web.ApiSpec.Schemas.PushSubscription, Pleroma.Web.ApiSpec.Schemas.ScheduledStatus, Pleroma.Web.ApiSpec.Schemas.Status, Pleroma.Web.ApiSpec.Schemas.Tag, Pleroma.Web.ApiSpec.Schemas.VisibilityScope, Regex, Time, Tuple (jason 1.4.0) lib/jason.ex:213: Jason.encode_to_iodata!/2 (phoenix 1.6.16) lib/phoenix/controller.ex:281: Phoenix.Controller.json/2 (pleroma 3.7.1-0-gfef4bae) lib/pleroma/web/mastodon_api/controllers/account_controller.ex:5: Pleroma.Web.MastodonAPI.AccountController.action/2 (pleroma 3.7.1-0-gfef4bae) lib/pleroma/web/mastodon_api/controllers/account_controller.ex:5: Pleroma.Web.MastodonAPI.AccountController.phoenix_controller_pipeline/2 (phoenix 1.6.16) lib/phoenix/router.ex:354: Phoenix.Router.__call__/2 (pleroma 3.7.1-0-gfef4bae) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2 (pleroma 3.7.1-0-gfef4bae) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2 (phoenix 1.6.16) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4 ``` ### Severity I cannot use it as easily as I'd like ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
floogulinc added the
bug
label 2023-03-28 11:39:18 +00:00

"user is deactivated"

this implies that a local admin has deactivated the user in question, in which case "disappearing" would be the expected outcome

>"user is deactivated" this implies that a local admin has deactivated the user in question, in which case "disappearing" would be the expected outcome
Author

Oh heck. I don't remember deactivating them and there is no record of that in the moderation log in the admin UI but I have reactivated the account and it seems to be working again.

Oh heck. I don't remember deactivating them and there is no record of that in the moderation log in the admin UI but I have reactivated the account and it seems to be working again.
Author

Also this user followed me and it still says they follow me on their profile on misskey but it no longer says so on my end, is there any way to fix that?

Also this user followed me and it still says they follow me on their profile on misskey but it no longer says so on my end, is there any way to fix that?

sadly not without asking them to unfollow/refollow - a deactivation will cut off all local relationships

you might want to make them force-unfollow you ("Remove Follower") before that just to keep the state nice and synchronised though

sadly not without asking them to unfollow/refollow - a deactivation will cut off all local relationships you might want to make them force-unfollow you ("Remove Follower") before that just to keep the state nice and synchronised though
Author

Oh now that I'm reading their profile they apparently deleted their account on misskey.io and then reactivated it... I assume the deletion is what deactivated it on my end. So I guess that's a thing you can do on that platform and it probably isn't handled very well on other instances.

Oh now that I'm reading their profile they apparently deleted their account on misskey.io and then reactivated it... I assume the deletion is what deactivated it on my end. So I guess that's a thing you can do on that platform and it probably isn't handled very well on other instances.

ah yes that would make sense - i wonder why it didn't reactivate on your end?

I'll have to look into if misskey sends a reactivation message

ah yes that would make sense - i wonder why it didn't reactivate on your end? I'll have to look into if misskey sends a reactivation message

ah yes that would make sense - i wonder why it didn't reactivate on your end?

I'll have to look into if misskey sends a reactivation message

This is a known issue. *oma doesn't handle Undo[Delete] on users (for good reason). I personally don't like user deactivation being communicated as Delete on users, as it hinders any possibility of actual user deletion. As far as I'm aware, only Mastodon deletes users after receiving Delete, as a delayed job. GoToSocial might also do this. Misskey and *oma decide to deactivate the user for some forsaken reason.

If you plan to implement this (which, in my opinion, shouldn't be done), it is then mandatory to separate remote deactivation and local deactivation (no one would want people to re-activate themselves on instances that deactivated them).

> ah yes that would make sense - i wonder why it didn't reactivate on your end? > > I'll have to look into if misskey sends a reactivation message This is a known issue. *oma doesn't handle `Undo[Delete]` on users (for good reason). I personally don't like user deactivation being communicated as `Delete` on users, as it hinders any possibility of actual user deletion. As far as I'm aware, only Mastodon deletes users after receiving `Delete`, as a delayed job. GoToSocial might also do this. Misskey and *oma decide to deactivate the user for some forsaken reason. If you plan to implement this (which, in my opinion, shouldn't be done), it is then mandatory to separate remote deactivation and local deactivation (no one would want people to re-activate themselves on instances that deactivated them).
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
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#516
No description provided.