My hypothesis on why Lemmy is rejecting valid activities
-
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:
- I make a valid ActivityPub request with the audience of a community (or cc a user).
- Lemmy makes an ActivityPub request back at me at
/. - My web site does not handle ActivityPub at
/, and responds with atext/plainerror message. This is default behavior in Drupal. - 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/plainand/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.frontand 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:
- I make a valid ActivityPub request with the audience of a community (or cc a user).
- Lemmy makes an ActivityPub request back at me at
/. - My web site does not handle ActivityPub at
/, and responds with atext/plainerror message. This is default behavior in Drupal. - 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/plainand/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.frontand 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.>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? -
>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?>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 thetypebeingUpdate.A reply to a post, or to another comment as
Create/Notethat 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:
- I make a valid ActivityPub request with the audience of a community (or cc a user).
- Lemmy makes an ActivityPub request back at me at
/. - My web site does not handle ActivityPub at
/, and responds with atext/plainerror message. This is default behavior in Drupal. - 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/plainand/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.frontand 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.
- Create my post as normal, but don’t address it to the community initially.
- 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.
- Create my post as normal, but don’t address it to the community initially.
- 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
toorcc, and probablyas:Publicsomewhere 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.
- Create my post as normal, but don’t address it to the community initially.
- 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.
>Is that necessary? I could not find that in the Federation documentation.
The error message says that server expects an
Announceactivity. But yes, group's inbox should also accept replies wrapped inCreate, as well asLikes.