Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

My hypothesis on why Lemmy is rejecting valid activities

General Discussion
10 4 47
  • 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.

  • 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.

    @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

    >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?

    @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?

  • 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.

    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.

     

  • 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.

     

    mradcliffe@nokoto.org no, Lemmy doesn't check the root for an Application actor (and as you discovered, NodeBB doesn't send one either, and we federate with Lemmy fine.)

    Can you share a sample Create you're sending Lemmy? You should only need to have the group actor ID in to or cc, and probably as:Public somewhere in there too.

  • 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.

     

    @mradcliffe

    >Is that necessary? I could not find that in the Federation documentation.

    The error message says that server expects an Announce activity. But yes, group's inbox should also accept replies wrapped in Create, as well as Likes.

  • @mradcliffe

    >Is that necessary? I could not find that in the Federation documentation.

    The error message says that server expects an Announce activity. But yes, group's inbox should also accept replies wrapped in Create, as well as Likes.

    silverpill@mitra.social the group's inbox should, if the post is in local category, but what if it's a post in a remote category? It doesn't ever make it over to the remote server...

  • 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.

    Hi, I had a look at the activities sent from your account. Looks like the only problem is that you are missing a @context field. After adding that it parses just fine. What you serve from / is irrelevant, that one is completely optional.

  • Hi, I had a look at the activities sent from your account. Looks like the only problem is that you are missing a @context field. After adding that it parses just fine. What you serve from / is irrelevant, that one is completely optional.

    nutomic oh that's interesting, does Lemmy do JSON-LD validation? I didn't think it would.

  • 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.

    Actually I was wrong, there is a context so thats fine. The problem is that audience should be a simple string but you are sending an error, thats why it fails. Anyway that field is optional, so you can leave it out and put the community in to or cc instead.

    julian No but still the field is mandatory (mainly because that hasnt caused any problems so far).


Gli ultimi otto messaggi ricevuti dalla Federazione
  • @mariusor@metalhead.club That's great context; thanks!

    read more

  • @silverpill@mitra.social That makes sense. I guess I was getting a little bit spun around by the idea that the keyId is not the Actor id and thinking too hard about it.

    read more

  • @jdt the fragment in a JSON-LD document IRI has a semantic meaning that goes back to RDF: https://www.w3.org/TR/rdf11-concepts/#section-fragID

    > a secondary resource that is usually a part of, view of, defined in, or described in the primary resource, and the precise semantics depend on the set of representations that might result from a retrieval action on the primary resource.

    read more

  • @jdt You're supposed to fetch the keyId first, then fetch its owner (or controller).
    But in practice its either /main-key (GoToSocial) or fragment ID, so it is indeed possible to save a HTTP request.

    read more

  • keyId is a problem.

    Generally speaking, most Actors have a `keyId' that looks something like:

    https://enigmatick.social/user/jdt#main-key

    When an inbox POST arrives from an unknown user, we can chop off the bit including #main-key and we can pull the remaining URL as the Actor's ID.

    But some implementations decided they should use /main-key instead. That indicates that the keyId format is unreliable and not well-specified. So I switched to deferring this header check for unknown Actors deeper into my ingestion pipeline so that I could retrieve the actor string from the object being sent. That works pretty well.

    But GET requests. Like followers_synchronization. Dammit. There's no object to refer to. So we're back to parsing the keyId and hoping for meaning.

    Out of 124,007 Actors in my database, 587 do not comply with the #main-key convention.

    enigmatick=> select count(*) from actors where as_public_key->>'id' NOT LIKE '%#main-key'; count ------- 587 (1 row)

    For full coverage, I need to accommodate /main-key and #key as well

    #ActivityPub

    read more

  • @reiver I'd consider interoperating social networks to be "federated", but I know it's not a precise term. There are similar ambiguities with other commonly used terms: decentralization, server, node, instance, and so on. We have our personal definitions but find that others have a different mental model than ours. It might be interesting to have a collaborative social web glossary that captures the variations of how these terms are used.

    read more

  • @rimu@mastodon.nzoss.nz Definitely. Offloading the static assets to nginx is a big win. Varnish adds a layer of serving from memory that takes it up a notch. Like having your own Fastly pop.

    It does require some configuration nuance to be sure you aren't serving cached assets to the wrong connections (e.g., authenticated GET requests that shouldn't be shared beyond a specific session).

    read more

  • @eyeinthesky

    Only as a metaphor.

    Federation happens between servers / nodes, not between networks.

    read more
Post suggeriti
  • #FediNews

    Moved Uncategorized fedinews fediverso activitypub
    1
    1
    0 Votes
    1 Posts
    6 Views
    #FediNews Lanzamiento de una herramienta para mejorar la interoperabilidad: El Applied Social Media Lab lanzó recientemente "The ActivityPub Fuzzer", un programa diseñado para emular datos en todo el #fediverso para ayudar a mejorar la interoperabilidad entre diferentes plataformasEl ActivityPub Fuzzer | Laboratorio de Redes Sociales Aplicadas - YouTubehttps://www.youtube.com/watch?v=EGo7ZaBG-4s #ActivityPub
  • 0 Votes
    1 Posts
    10 Views
    The big feature in release v3.2.2 of Ktistec is pinned posts with support for the Mastodon Featured Posts collection. Federation works both ways—pin a post on Ktistec and it will show up as a pinned post on Mastodon and vice versa. When you refresh an actor profile, Ktistec also fetches and updates the actor's pinned posts. This is another small step in the direction of supporting all features that Mastodon-compatible client applications expect to access via the API. It's also useful in its own right. The other major feature, which I posted a short video demonstrating here, is X-Ray Mode. X-Ray Mode is a developer and power-user tool for inspecting ActivityPub JSON-LD representations of actors, objects, and other content. Pressing Ctrl+Shift+X on any page displays the data behind the page—like an x-ray. You can:Cached Version: View the local JSON-LD representation stored in the Ktistec databaseRemote Version: Fetch and view the original JSON-LD representation from the source serverNavigation: Click on any ActivityPub IRI to navigate to that objectHistory: Use Alt+Left and Alt+Right to navigate through your viewing historyThis feature is useful for debugging federation issues, understanding ActivityPub structures, and verifying how content is stored and represented.Here's the full changelog for the release:AddedSupport for pinned posts and the Mastodon "featured posts" collection.X-Ray Mode for viewing and navigating JSON-LD resource (actor, object, etc.) representations.Back links on thread pages for easier navigation. (fixes #1)License page for LibreJS compliance. (fixes #127)Highlighting of recently fetched hashtagged posts.ChangedImproved presentation of audio and video media.Refactored theming/styling implementation.The next release will focus on smaller features and bug fixes.Enjoy!#ktistec #crystallang #activitypub #fediverse
  • 0 Votes
    1 Posts
    4 Views
    I've proposed two possible outlines for a document about #SolidProject #Activitypub integration https://github.com/solid-contrib/activitypub-interop/issues/2#issuecomment-3590595603The first is more note/tutorial/primer like, because a large part of the content is just redescribing ActivityPub for a Solid audience.The second assumes prior knowledge of ActivityPub and primarily describes what is needed to integrate ActivityPub with Solid, based on three architectures:- Server support- External processing- External endpoints
  • 0 Votes
    1 Posts
    6 Views
    This week I added the ActiviyPub plugin to our college's WordPress blog server. It's a MultiUser server, so each group has their own independent blog hosted by the same WordPress install.People here don't post a whole lot however the student newspaper does post their articles there weekly.Just trying to do my part to increase the human generated content shared here in the Fediverse.Oh, and of course the server is dual stacked and available over #ipv6 #ActivityPub #WordPress