Help debugging why mastodon isn't finding an actor

Hi!

I’m very new to this so I may be missing something obvious, or a place to go find that obvious something.

I’ve searched through some old tickets and did find some helpful things, but nothing that gives me insight into what might be wrong.

Here’s what our webfinger looks like: WebFinger

And this seems to indicate that things are fine except that we don’t accept POST requests at the moment https://verify.funfedi.dev/?actor_uri=https%3A%2F%2Fmirlo.space%2Fv1%2Fartists%2Fteam

The main thing I suspect might be causing an issue is that I’m not using @ before my user name, but I also understand that’s not required. Right now my webfinger can receive both and returns the id without it.

Also we’re currently running our API off of both the root domain mirlo.space and the api api.mirlo.space, and I’m wondering if that’s causing some issues? That’s just us being mid-transition here though.

Tbh, I’m not even sure how to check for the account on mastodon. I’ve just been going to this:

https://musician.social/@team@mirlo.space

NodeBB doesn’t seem to work either:

https://community.nodebb.org/user/team@mirlo.space

The server doesn’t return actor document when required Accept header is set:

curl -H 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"' https://mirlo.space/v1/artists/team

Have you tried searching for webfinger address or actor ID (via search box)?

Thanks for the fast response!!

I was under the impression it could be either Accept: application/activity+json or that ld+json json one? Eg, the mastodon webfinger doc says:

Thus, we cannot guess the actor id given only the username and domain. However, if social.example supports WebFinger, then we can get this id by requesting https://social.example/.well-known/webfinger?resource=acct:username@social.exampleand parsing the response for a link with the application/ld+json; profile="https://www.w3.org/ns/activitystreams" or application/activity+json type. This link should also have the link relation rel="self".

However! Adding the other one isn’t an issue. I just did so it looks like that’s now returning the Actor as we define it.

And that does look like it now makes it appear on NodeBB (exciting!). However, it’s still not working on Mastodon.

Have you tried searching for webfinger address or actor ID (via search box)?

I’m not sure what this means :sweat_smile: If I plug the URL for the webfinger (https://mirlo.space/.well-known/webfinger?resource=acct:team@mirlo.space) into the search box in Mastodon, I get this:

If I plug the id https://mirlo.space/v1/artists/team into that same search box I also get a not found page.

I’m wondering if there’s some form of caching happening?

Yes, Accept can be one of those, but server should return actor document in both cases.

Another potential issue:

Server’s response has Content-Type: application/json, but it should be application/ld+json; profile="https://www.w3.org/ns/activitystreams" (or application/activity+json).

Yes, Mastodon might cache responses. I am not very familiar with it

Mastodon definitely caches data like that. If you control the instance and if it makes sense for the mirlo.space domain, you can use the Mastodon CLI tootctl domain purge mirlo.space command to remove all accounts and posts for the domain. This will also clear the caches and allow the actor to be re-searched.

Might also be that Mastodon requires the inbox to exist:

Note that you will need to implement the inbox endpoint to allow users to follow you, and to be able to notify them of new posts (since you’ll need to know who to send notifications for new posts to). This is probably what’s stopping your profile from showing up at all—Mastodon requires the inbox endpoint to exist so that it’s possible to interact with the user (follow them, like their posts, reply to their posts, etc)

Though if this is it it might require more than just implementing the POST endpoint. That doesn’t seem to be enough.

1 Like

Using the fedify CLI, which has a nice actor lookup and node querying feature:

$ fedify lookup team@mirlo.space
✔ Fetched object: team@mirlo.space.
Object {}
✔ Successfully fetched the object.

On the other hand, output from Wordpress:

lookup
$ fedify lookup andypiper@andypiper.co.uk
✔ Fetched object: andypiper@andypiper.co.uk.
Person {
  id: URL "https://andypiper.co.uk/author/andypiper/",
  attachments: [
    PropertyValue {
      name: "Blog",
      value: '<p><a rel="me noopener" title="https://andypiper.co.uk/" target="_blank" href="https://andypiper.co.uk/">andypiper.co.uk</a></p>'
    },
    Link {
      href: URL "https://andypiper.co.uk/",
      rels: [ "me", "noopener" ],
      name: "Blog"
    },
    PropertyValue {
      name: "Profile",
      value: '<p><a rel="me noopener" title="https://andypiper.co.uk/author/andypiper/" target="_blank" href="https://andypiper.co.uk/author/andypiper/">andypiper.co.uk</a></p>'
    },
    Link {
      href: URL "https://andypiper.co.uk/author/andypiper/",
      rels: [ "me", "noopener" ],
      name: "Profile"
    },
    PropertyValue {
      name: "Homepage",
      value: '<p><a rel="me noopener" title="https://andypiper.omg.lol" target="_blank" href="https://andypiper.omg.lol">andypiper.omg.lol</a></p>'
    },
    Link {
      href: URL "https://andypiper.omg.lol/",
      rels: [ "me", "noopener" ],
      name: "Homepage"
    }
  ],
  name: "Andy Piper",
  icon: Image {
    url: URL "https://secure.gravatar.com/avatar/d33e6fe38426aba6431cd4e9c3609a0c6ba480813a7e2d5987170bf015d5b8c7?s=120&#038;d=identicon&#038;r=g"
  },
  published: 2006-03-25T15:27:57Z,
  summary: "<p>Fediverse, Open Source, Pen Plotters, Community</p>\n",
  url: URL "https://andypiper.co.uk/author/andypiper/",
  mediaType: "text/html",
  preferredUsername: "andypiper",
  publicKey: CryptographicKey {
    id: URL "https://andypiper.co.uk/author/andypiper/#main-key",
    owner: URL "https://andypiper.co.uk/author/andypiper/",
    publicKey: CryptoKey {
      type: "public",
      extractable: true,
      algorithm: {
        name: "RSASSA-PKCS1-v1_5",
        modulusLength: 2048,
        publicExponent: Uint8Array(3) [ 1, 0, 1 ],
        hash: { name: "SHA-256" }
      },
      usages: [ "verify" ]
    }
  },
  manuallyApprovesFollowers: false,
  inbox: URL "https://andypiper.co.uk/wp-json/activitypub/1.0/actors/165913/inbox",
  outbox: URL "https://andypiper.co.uk/wp-json/activitypub/1.0/actors/165913/outbox",
  following: URL "https://andypiper.co.uk/wp-json/activitypub/1.0/actors/165913/following",
  followers: URL "https://andypiper.co.uk/wp-json/activitypub/1.0/actors/165913/followers",
  featured: URL "https://andypiper.co.uk/wp-json/activitypub/1.0/actors/165913/collections/featured",
  discoverable: true,
  indexable: true
}
✔ Successfully fetched the object.

… and Mastodon:

lookup
$ fedify lookup andypiper@me.dm
✔ Fetched object: andypiper@me.dm.
Person {
  id: URL "https://me.dm/users/andypiper",
  attachments: [
    PropertyValue {
      name: "Medium",
      value: '<a href="https://medium.com/@andypiper" target="_blank" rel="nofollow noopener noreferrer me" translate="no"><span class="invisible">https://</span><span class="">medium.com/@andypiper</span><span class="invisible"></span></a>'
    }
  ],
  name: "Andy Piper",
  icon: Image {
    url: URL "https://media.me.dm/accounts/avatars/109/978/687/461/515/565/original/af4afdd0454e190b.jpeg",
    mediaType: "image/jpeg"
  },
  published: 2023-03-06T00:00:00Z,
  summary: "<p>Tinkerer and Dreamer. Interests: Open Source | Fediverse | Community | LEGO</p>",
  url: URL "https://me.dm/@andypiper",
  preferredUsername: "andypiper",
  publicKey: CryptographicKey {
    id: URL "https://me.dm/users/andypiper#main-key",
    owner: URL "https://me.dm/users/andypiper",
    publicKey: CryptoKey {
      type: "public",
      extractable: true,
      algorithm: {
        name: "RSASSA-PKCS1-v1_5",
        modulusLength: 2048,
        publicExponent: Uint8Array(3) [ 1, 0, 1 ],
        hash: { name: "SHA-256" }
      },
      usages: [ "verify" ]
    }
  },
  manuallyApprovesFollowers: false,
  inbox: URL "https://me.dm/users/andypiper/inbox",
  outbox: URL "https://me.dm/users/andypiper/outbox",
  following: URL "https://me.dm/users/andypiper/following",
  followers: URL "https://me.dm/users/andypiper/followers",
  featured: URL "https://me.dm/users/andypiper/collections/featured",
  featuredTags: URL "https://me.dm/users/andypiper/collections/tags",
  endpoints: Endpoints { sharedInbox: URL "https://me.dm/inbox" },
  discoverable: false,
  memorial: false,
  indexable: false
}
✔ Successfully fetched the object.

… and Lemmy:

lookup
$ fedify lookup andypiper@lemmy.world
✔ Fetched object: andypiper@lemmy.world.
Person {
  id: URL "https://lemmy.world/u/andypiper",
  name: "andypiper",
  icon: Image {
    url: URL "https://lemmy.world/pictrs/image/4f9dfd02-6b16-41aa-a688-f0855279a9bd.jpeg"
  },
  image: Image {
    url: URL "https://lemmy.world/pictrs/image/f05c13eb-eddf-4184-86a2-38ab1eb744a9.jpeg"
  },
  published: 2023-06-09T11:01:21.388753Z,
  summary: '<p>Mostly <a href="https://macaw.social/@andypiper">@andypiper@macaw.social</a> on the #fediverse - more links <a href="https://andypiper.me">here</a>.</p>\n',
  source: Source {
    content: "Mostly [@andypiper@macaw.social](https://macaw.social/@andypiper) on the #fediverse - more links [here](https://andypiper.me).",
    mediaType: "text/markdown"
  },
  preferredUsername: "andypiper",
  publicKey: CryptographicKey {
    id: URL "https://lemmy.world/u/andypiper#main-key",
    owner: URL "https://lemmy.world/u/andypiper",
    publicKey: CryptoKey {
      type: "public",
      extractable: true,
      algorithm: {
        name: "RSASSA-PKCS1-v1_5",
        modulusLength: 2048,
        publicExponent: Uint8Array(3) [ 1, 0, 1 ],
        hash: { name: "SHA-256" }
      },
      usages: [ "verify" ]
    }
  },
  inbox: URL "https://lemmy.world/u/andypiper/inbox",
  outbox: URL "https://lemmy.world/u/andypiper/outbox",
  endpoints: Endpoints { sharedInbox: URL "https://lemmy.world/inbox" }
}
✔ Successfully fetched the object.

To me, it looks like the result of fetching https://mirlo.space/v1/artists/team (which is what the webfinger result points to) is not just a Person object, but something very verbose?

1 Like

I’m looking at the profile from Mastodon now and it seems to resolve properly (by putting the full Actor ID into the “Open URL with Mastodon” search box):

Seems like this might be a bug in the Fedify tool, since it seems fine for me with curl:

It definitely shouldn’t be returning a “Successful” result for an empty object, like the log seems to indicate?

1 Like

Thanks for the tip on fedify!

When I added the --debug flag it showed me that it wasn’t a straight Accept: application/activity+json that was coming through but actually both the activity+json and ld+json as one string, which my server wasn’t expecting. Once I fixed my search, it started coming through.

cc @nightpool (I think you caught me fixing the problem fedify showed me before I was able to post with the update!)

Now onto figuring out the inbox and such!

Ah, yes, that’s a good beginner tip:

Please, please, please do not hand roll your own Accept header parsing. It’s a very complicated header field with many nuances. Use a library. There are many libraries out there to handle parsing this header.

1 Like

Just followed @team@mirlo.space from my account on Mastodon (I’ll try some other platforms too), so that looks like solid progress! Glad to see things moving along, I know the indie music community are pretty excited to see Mirlo joining the Fediverse :slight_smile:

2 Likes

I can load the actor document, but Follow doesn’t work for me. The server responds with 400 {"error":"Only accepts ActivityPub headers"}
The Content-Type header value is the one required by ActivityPub specification.

@andypiper I took a little step back from this because I had to focus on some other things, so I would be very very surprised if that follow did anything on our end :grimacing: (confirmed you haven’t been stored in our db).

We do have this account though from which we do regularly post!

1 Like