Citiverse
  • My hypothesis on why Lemmy is rejecting valid activities

    General Discussion
    2 4 0

    mradcliffe@nokoto.orgM
    4
    0

    I have not been able to successfully post to a Lemmy instance either as a post or a comment. A cryptic error message is returned where the error is unknown and the message is a generic message:

    {"error":"unknown","message":"data did not match any variant of untagged enum AnnouncableActivities"}

    From my logs, it seems this is happening:

    1. I make a valid ActivityPub request with the audience of a community (or cc a user).
    2. Lemmy makes an ActivityPub request back at me at /.
    3. My web site does not handle ActivityPub at /, and responds with a text/plain error message. This is default behavior in Drupal.
    4. Lemmy rejects my request with a 400 response with the error message above.

    I tested other instances by making the following get request to the root of each instance (thank you, Daniel Sternberg for maintaining curl):

    curl -v -H "Accept: application/activity+json" -H "Content-Type: application/activity+json" <url>
    • With the following results
      • Lemmy returns an Application Actor.
      • Misskey returns a 200 response in text/html.
      • Mastodon returns a 406 response in application/json.
      • NodeBB returns text/html.
      • GoToSocial returns a 406 response in application/json.
      • Mitra returns a 200 response in text/html.
      • Pixelfed returns a 200 response in text/html.
      • Peertube returns an empty 406 response.

    My hypothesis is that Lemmy is rejecting the request because I return text/plain and/or it cannot handle a response with that content type.

    To test that I am working on changing the default behavior. I will need to dynamically add a route based on system.site.page.front and return a 406 response in JSON. This is simple enough. If my hypothesis is correct, I can also make a merge request into drupal/activitypub module, which would have the same problem. If not, then I’ll need to go digging further.

  • silverpill@mitra.socialS
    9
    0

    @mradcliffe

    >Mitra returns a 200 response in text/html.

    But it federates with Lemmy

    >data did not match any variant of untagged enum AnnouncableActivities

    Did you wrap your activity in Announce?

  • mradcliffe@nokoto.orgM
    4
    0

    @silverpill

    >Mitra returns a 200 response in text/html.

    But it federates with Lemmy

    My hypothesis is it's the text/plain is the problem, and that everyone else is doing something acceptable.

    Did you wrap your activity in Announce?

    Is that necessary? I could not find that in the Federation documentation. I know that Lemmy sends Announces out when it forwards activities, but to me when the documentation states

    When a user creates a new post, it is sent to the respective community as Create/Page. Editing a previously created post sends an almost identical activity, except the type being Update.

    A reply to a post, or to another comment as Create/Note

    that means I should do similarly, right?

  • mradcliffe@nokoto.orgM
    4
    0

    If I do need to wrap it an Announce, then I think I will need to do the following based on how it works on my end.

    1. Create my post as normal, but don’t address it to the community initially.
    2. Announce my own post making sure I address it to the community.

    I guess that might show up as me boosting my own post on some instances (tooting my own horn? Horning my own toot?), which I would feel ashamed of.

     


Citiverse è un progetto che si basa su NodeBB ed è federato! | Categorie federate | Chat | 📱 Installa web app o APK | 🧡 Donazioni | Privacy Policy