Automattic / wordpress-activitypub

ActivityPub for WordPress
https://wordpress.org/plugins/activitypub/
MIT License
482 stars 73 forks source link

Stuck in "Follow Requested" state #523

Closed pfefferle closed 9 months ago

pfefferle commented 11 months ago

Quick summary

We experienced issues with some Mastodon instances, where the Follow request will not be properly accepted by WordPress. This is no general issue, but seems to be depending on a special kind of setup/setting/hosting. We found out, that it is an issue with quite a lot of instances hosted on Masto.host.

Steps to reproduce

  1. Go to Mastodon.art
  2. Follow your blog
  3. Stuck in pending state

What you expected to happen

Follow should be auto-accepted

What actually happened

Stuck in pending state

Impact

Some (< 50%)

Available workarounds?

No but the platform is still usable

Logs or notes

We assume that this is a race condition, where the Accept of a Follow request will be sent too early.

pfefferle commented 11 months ago

If you experience similar issues, please add the Mastodon Instance in the comments.

pfefferle commented 11 months ago

Some more details: After a first follow request, Mastodon seem to be stuck and does not send any more requests (Undo, Follow, ...). That means that Unfollow and Re-Follow will not work here. I experienced, that when I send an @-reply to one of the stuck followers and then re-try the Follow request, it will work!

This makes no sense!

pfefferle commented 11 months ago

After sending a manually Accept it seem to also work, what hardens the assumption that it is a race condition. I will add a cron to back the Accept response and I also think a CLI extension and an Action at the Followers-Table to re-send the Accept would be also nice and helps with debugging.

GoneCaving commented 11 months ago

Seeing similar issues trying to follow my own blog from mastodon.ie

pfefferle commented 11 months ago

OK, I tried mastodon.ie and it is even worse, it seems to be no race condition, there is no initial Follow request to the inbox at all!

I will file an issue on the Mastodon repo!

pfefferle commented 11 months ago

Also https://mastodon.social/@pfefferle/111255975069274376

pfefferle commented 11 months ago

I will prepare an issue for that https://oisaur.com/@renchap/111256041489198252

uk3 commented 11 months ago

@pfefferle A note: the symptoms of https://github.com/Automattic/wordpress-activitypub/issues/514 were the same. Mastodon shows the request stuck in 'Follow requested'

518 fixed that for me.

Timothyjchambers commented 11 months ago

Experiencing this from Indieweb.social that is hosted on Mastohost.

supernovia commented 11 months ago

We seem to have another case here with mstdn.io : https://wordpress.com/forums/topic/fediverse-followers-not-auto-approved-how-to-approve/

ssawczyn commented 11 months ago

I'm having a similar problem when trying to follow from mspsocial.net . I'm also hearing that there are problems when folks try to follow my blog from mastodon.social. In my case and at least one other that I know of, the follow request seems stuck in some sort of pending state.

This may not matter at all, but do the other WordPress settings governing commenting come into play at all here? For example, my blog requires comments to be approved which of course wouldn't happen if someone randomly comments on a post via Mastodon. If other WordPress commenting settings do matter, I'd be glad to consider changing mine, I just didn't find any documentation one way or the other.

timnolte commented 11 months ago

@ssawczyn you might also have a server side security configuration that is blocking the requests. Who is your hosting provider, and do you know what webserver (Apache/Nginx/LiteSpeed) is being used to serve up your site. Many webservers use ModSecurity for protecting sites and there is some known configuration items that can cause this.

Personally, I also use the same commenting setup as you on my site and it doesn't cause this issue. However, it was the ModSecurity configuration that 2as causing my problem.

ssawczyn commented 11 months ago

Hi @timnolte, thanks for the quick reply. Unfortunately in this case, I'm hosting with Wordpress.com and so I have no knowledge or control over the hosting environment. I'm glad to know though that we have commenting configured similarly as everything is working the way I want, except for the Fediverse integration.

timnolte commented 11 months ago

@ssawczyn interesting, given that the ActivityPub plugin is now available for all WordPress.com accounts I'm a bit surprised things aren't "just working" out of the box.

ssawczyn commented 11 months ago

@Timnolte I'm surprised by that too. And yet I'm not seeing a bunch of people in the Wordpress.com specific forums discussing this. Maybe the lack of control Wordpress.com users have over their hosting instances and server configurations will help to eliminate some of the variables. Of course not all accounts are having issues, so who knows what that may or may not mean.

ShadowJonathan commented 11 months ago

It seems that mastodon wishes to send follows via an public-api.wordpress.com inbox, which then (at least in our case) returns 401 HTTP errors back, which results in mastodon accumulating errors over days, which then reaches a threshold, after which mastodon will no longer attempt deliveries.

This was after manually clearing the "unavailable domain" error from our instance (see https://github.com/mastodon/mastodon/issues/27458#issuecomment-1776683194 for more details), but it seems that there's something wrong with the wordpress public relay, like this.

Why can't activitypub inboxes be on the domain itself? Why does it need to make a detour? This confuses the federation tab for mastodon immensely, as then the "unavailable domain" is actually another domain than the domain the "user" is on, which prevents mastodon admins from clicking "clear delivery errors" when something like this is going on.

pfefferle commented 11 months ago

This is not a general WordPress issue, it is special for WordPress.com and I can't change that for ActivityPub. This is also frustrating for us, because Mastodon seems to not support this case properly.

I have no idea how to quickly solve this to be honest.

ShadowJonathan commented 11 months ago

Ah right, i've figured it out; public-api.wordpress.com is for wordpress.com's hosting, while (after digging around) individual wordpress sites have the inbox listed on their own domain.

I'll make or search for an issue talking about this.

pfefferle commented 11 months ago

No, it is totally fine to discuss this here, we are also responsible for the WordPress.com version 🫣

pfefferle commented 11 months ago

@ShadowJonathan do you know what activities reset the "unavailable" status? I try to build a workaround!

ShadowJonathan commented 11 months ago

None do, its wholly about underlaying transport delivery, and in https://github.com/mastodon/mastodon/issues/27525 im talking about adding such a bypass to mastodon, since none exists right now.

The way that mastodon resets delivery is by receiving an from that actor, and since the remote wordpress server doesn't know anything about where the user would want to follow, it would fail.

One thing I can recommend, as a hack, is to present to the user a dialog of "enter the instance that you want to follow from", and when the user submits, submit that data to the backend, where then a background process kicks off to send an Update for the domain's profile to that server's inbox.

This way, that server receives an update from the wordpress server, it will reset the delivery tracker ("unavailable" to "available"), and process the profile Update accordingly, basically pre-refreshing the wordpress blog actor profile before the user gets a chance to follow or the likes.

This will solve any issue with any domain, but requires a specific flow.


The alternative is that I'll work on https://github.com/mastodon/mastodon/issues/27525, and make sure that on mastodon's side, servers stay able to be followed, but this will only fix the issue for mastodon.

pfefferle commented 11 months ago

@ShadowJonathan no, I mean the other way around. I experienced that an @-reply from an "unavailable" blog to a mastodon account does reset the state. Are you aware of other Activities?

ShadowJonathan commented 11 months ago

Oh, any activity will do that, as long as it comes from the actor with the unavailable inbox URL.

That's why I chose the account/profile Update activity as a "noop" reset-availability activity, since it really does almost nothing, and yet resets availability.

ShadowJonathan commented 11 months ago

For issue tracking purposes, we determined here that this is an auth-fetch issue on wordpress' side.

This was interacting with another bug that stopped federation from sending Follow activities that has been fixed on mastodon's side by this PR.

ShadowJonathan commented 11 months ago

Since the mastodon bug still exists in all latest versions, to quickly unwedge federation for a local instance (for debugging), you can run bundle exec rails console in your ~/live directory, and then run DeliveryFailureTracker.reset!('public-api.wordpress.com')


@pfefferle has the auth-fetch issue been fixed at any point by any PR, or is that still ongoing?

KeithDevereux commented 10 months ago

Greetings. I'm still eager to integrate my Wordpress.com blog into my Mastodon feed but am still having difficulties with this. I also discovered that the other blog I tried to follow are also saying 'Follow Requested' (I followed from my .art account, of course) and I can't see their feed. Reading around the GitHub threads it looks like this has been resolved and I'm wondering if there is anything I need to do. I have been using Mastodon from my phone so should I be setting something up in the desktop? Your help is appreciated. Thank you. Keith.

ShadowJonathan commented 10 months ago

This'll take until the fix that was merged in https://github.com/mastodon/mastodon/pull/27586 is available in a mastodon release, currently it is still on the main branch, and not in any release.

After a release, and after your server has updated to that release, you'll have to cancel and re-submit your follow request, or else it'll not go through.

Follow requests made with old versions have died in limbo, and with the new version, they'll finally pierce through.

KeithDevereux commented 10 months ago

Thank you for the update. It is appreciated. Regards, Keith

jerrysarcastic commented 10 months ago

Also reported in https://wordpress.com/forums/topic/fediverse-followers-not-auto-approved-how-to-approve/?view=all#post-4001671

jjschwarz commented 10 months ago

I am not sure if I am having the same issue here...but from mastodon.lothlorien.net I can follow 3 of my WordPress blogs fine with the ActivityPub plugin, but two others (one is on the same server as a working version) I am experiencing this issue. I can not seem to follow n4jjs.com or schwarzspanish.com . I will say that those were two that I tried the plugin on last year (early in its life) and later deleted it from. Could this be the same issue, or maybe something residual from the install/uninstall?

pfefferle commented 9 months ago

I think we fixed the initial WordPress.com issue, so I will close it for now.

@jjschwarz can you maybe create a different issue for your problem?