ActivityPub fails with ROLE_MISSING on custom domain (works on default subdomain)

I’m running Ghost 6.23.0 on PikaPods. The ActivityPub/Fediverse feature works correctly on the default pikapod.net subdomain, but fails after configuring a custom domain.

On every boot I get:

ERROR Could not get webhook secret for ActivityPub
FetchError: invalid json response body at https://lokz.net/.ghost/activitypub/v1/site
reason: Unexpected token 'g', "ghost_uuid"... is not valid JSON
ERROR No webhook secret found - cannot initialise

When I manually request https://lokz.net/.ghost/activitypub/v1/site I get:

{"error":"Forbidden","code":"ROLE_MISSING"}

The response headers confirm the request is reaching ap.ghost.org:

server: Google Frontend
via: 2.0 Caddy, 1.1 google

I’ve ruled out DNS and proxy issues — the domain resolves correctly to PikaPods’ IP via a clean Porkbun ALIAS record with no Cloudflare proxy involved. PikaPods confirmed their reverse proxy configuration is identical for both the default subdomain and custom domain, and directed me here since ap.ghost.org is Ghost-managed infrastructure.

My understanding is that the AP sidecar at ap.ghost.org has the site registered under the pikapod.net subdomain identity but not under the custom domain. When Ghost tries to initialize AP webhooks using the custom domain hostname, the sidecar returns ROLE_MISSING.

Pod hostname: lilac-buffalo.pikapod.net
Custom domain: lokz.net
Site UUID: aa7d1a2a-3df4-4a9f-8153-084583ec2e50
Ghost version: 6.23.0

Is there a way to register the custom domain with the AP sidecar, or is this a known issue with custom domains on self-hosted instances?

@m3nu can you please look at this.
I haven’t heard back from anyone

Hello @Cyberia,

Apologies for the delay getting back to you — I somehow missed this thread.

There was indeed an existing entry for lilac-buffalo.pikapod.net in ap.ghost.org instead of your custom domain, lokz.net. I’ve now cleared that entry, so your custom domain should be able to register correctly on the next Ghost restart.

Would you mind restarting your Ghost site and then letting me know if you’re still running into any issues?

Sag
Product Engineer @ Ghost

Thank you so much, glad it works now.

I ended up making sure it shows up and federates and wrote a tiny thank you blog post

And We’re Live

Can’t say thanks to the email support guy as well but if he reads this, thanks Bob as well

Sorry that I couldn’t help sooner! Appreciate the thank you note, I will let Bob know too :slight_smile:

I’m not sure if I need to create a separate thread (if that’s the case, just LMK and I’ll do so), but I believe I’m running into a similar issue.

I’m getting this error message:

{“error”:“Forbidden”,“code”:“SITE_MISSING”}

When running this command to check:

curl -i “https://garden.n0madz.xyz/.well-known/webfinger?resource=acct:index@garden.n0madz.xyz”

If I run the same command for my default domain, it works, and I get this message:

{“subject":"acct:index@strange-scorpion.pikapod.net”,“aliases”:[“https://strange-scorpion.pikapod.net/.ghost/activitypub/users/index"],“links”:[{“rel”:“self”,“href”:“https://strange-scorpion.pikapod.net/.ghost/activitypub/users/index”,“type”:“application/activity+json”},{“rel”:“http://webfinger.net/rel/profile-page”,“href”:"https://strange-scorpion.pikapod.net/”}]}%

Can you look into this for me when you get a chance? I don’t think there’s anything on my end to update and fix this ActivityPub integration.

Custom domain:

https://garden.n0madz.xyz

Default PikaPods domain:

https://strange-scorpion.pikapod.net

TLDR:

ActivityPub/WebFinger works for the default domain, but the custom domain returns:

{“error”:“Forbidden”,“code”:“SITE_MISSING”}

-n0madz

Hey @n0madz,

The issue was indeed similar (entry for the PikaPods domain instead of custom domain). I’ve now cleared that entry. Your custom domain should be able to register correctly on the next Ghost restart.

Sag
Product Engineer @ Ghost