owncast: Federation: Pleroma receives "Unhandled Activity" error when going live

(I’m also going to open an issue with Pleroma, I’m unsure if the error is in Owncast or Pleroma)

I noticed that when Owncast goes live and sends out the ActivityPub message to Pleroma instances, Pleroma responds “OK” to the update - but the update never shows in the user’s timeline.

With debug logging enabled, Pleroma reports “Unhandled Activity”.

What’s interesting is, if I modify owncast to not include the Preview image - the activity is published correctly to users. So, I think this has something to do with the image attachment.

I tried modifying the code to do things like:

  • Use the Document type instead of Image type (seems to be what mastodon does)
  • add a mediaType attribute
  • add width and height attributes

None of these seem to work. The only other thing that’s striking to me is - I noticed most implementations seem to send the attachment property as an array, but it looks like the go-fed package serializes that to an object when there’s only a single instance. From reading the activitypub specs, I’m 99% sure that’s legal - which is why I’m going to also open a Pleroma bug and make sure it isn’t a problem there.

So to recap, sending an ActivityPub JSON like this works with Pleroma (and Mastodon):

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "http://joinmastodon.org/ns"
  ],
  "actor": "https://owncast.localhost.localdomain/federation/user/streamer",
  "audience": "https://www.w3.org/ns/activitystreams#Public",
  "id": "https://owncast.localhost.localdomain/federation/h7S-lqU7gz",
  "object": {
    "attributedTo": "https://owncast.localhost.localdomain/federation/user/streamer",
    "audience": "https://www.w3.org/ns/activitystreams#Public",
    "content": "<p>I've gone live!</p><p></p><p><a class=\"hashtag\" href=\"https://directory.owncast.online/tags/owncast\">#owncast</a> <a class=\"hashtag\" href=\"https://directory.owncast.online/tags/streaming\">#streaming</a></p><a href=\"https://owncast.localhost.localdomain\">https://owncast.localhost.localdomain</a>",
    "id": "https://owncast.localhost.localdomain/federation/2nI-lqUnR",
    "published": "2022-04-17T15:30:21Z",
    "tag": [
      {
        "href": "https://directory.owncast.online/tags/owncast",
        "name": "#owncast",
        "type": "Hashtag"
      },
      {
        "href": "https://directory.owncast.online/tags/streaming",
        "name": "#streaming",
        "type": "Hashtag"
      },
      {
        "href": "https://directory.owncast.online/tags/owncast",
        "name": "#owncast",
        "type": "Hashtag"
      }
    ],
    "to": "https://www.w3.org/ns/activitystreams#Public",
    "type": "Note"
  },
  "to": "https://www.w3.org/ns/activitystreams#Public",
  "type": "Create"
}

However, sending one like this (with an image) does not work with Pleroma, but does work with Mastodon:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "http://joinmastodon.org/ns"
  ],
  "actor": "https://owncast.localhost.localdomain/federation/user/streamer",
  "audience": "https://www.w3.org/ns/activitystreams#Public",
  "id": "https://owncast.localhost.localdomain/federation/KCfHuqU7Rz",
  "object": {
    "attachment": {
      "content": "Live stream preview",
      "type": "Image",
      "url": "https://owncast.localhost.localdomain/preview.gif?us=KjfNX387gm"
    },
    "attributedTo": "https://owncast.localhost.localdomain/federation/user/streamer",
    "audience": "https://www.w3.org/ns/activitystreams#Public",
    "content": "<p>I've gone live!</p><p></p><p><a class=\"hashtag\" href=\"https://directory.owncast.online/tags/owncast\">#owncast</a> <a class=\"hashtag\" href=\"https://directory.owncast.online/tags/streaming\">#streaming</a></p><a href=\"https://owncast.localhost.localdomain\">https://owncast.localhost.localdomain</a>",
    "id": "https://owncast.localhost.localdomain/federation/KjBNuq8ng",
    "published": "2022-04-17T15:42:03Z",
    "tag": [
      {
        "href": "https://directory.owncast.online/tags/owncast",
        "name": "#owncast",
        "type": "Hashtag"
      },
      {
        "href": "https://directory.owncast.online/tags/streaming",
        "name": "#streaming",
        "type": "Hashtag"
      },
      {
        "href": "https://directory.owncast.online/tags/owncast",
        "name": "#owncast",
        "type": "Hashtag"
      }
    ],
    "to": "https://www.w3.org/ns/activitystreams#Public",
    "type": "Note"
  },
  "to": "https://www.w3.org/ns/activitystreams#Public",
  "type": "Create"
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Did some back and forth troubleshooting with Shadowfacts and it works after he tweaked the Pleroma attachment code to accept single objects, per the spec. He commented on the Pleroma issue with the fix.

image