Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to follow on n4jjs.com or schwarzspanish.com from WordPress #591

Closed
jjschwarz opened this issue Dec 6, 2023 · 39 comments
Closed
Labels
Needs triage [Type] Bug Something isn't working

Comments

@jjschwarz
Copy link
Contributor

Quick summary

I opened this original in case 523 (#523):

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?

Steps to reproduce

Attempt to follow any user (such as @n4jjs.com@n4jjs.com or @schwarzspanish.com@schwarzspanish.com)

What you expected to happen

Expect the follow to function and the followers to update

What actually happened

Follow gets stuck in a pending state

Impact

Some (< 50%)

Available workarounds?

No and the platform is unusable

Logs or notes

No response

@jjschwarz jjschwarz added [Type] Bug Something isn't working Needs triage labels Dec 6, 2023
@jjschwarz
Copy link
Contributor Author

I have retested this with v2.0 of the plugin and the issue is still present on the two affected servers. I am trying to isolate which end of the connection (Mastodon or WordPress) is the cause still.

@jjschwarz
Copy link
Contributor Author

OK, I was finally able to get a debug that might give a clue from the mastodon side:

Jan 10 12:52:19 mastodon.lothlorien.net bundle[851]: 2024-01-10T17:52:19.218Z pid=851 tid=5tmp3z WARN: {"context":"Job raised exception","job":{"retry":16,"queue":"push","dead":false,"args":["{"@context":"https://www.w3.org/ns/activitystreams","id":"https://mastodon.lothlorien.net/2c850a2d-0e9b-4a36-a9c8-c62e5b30741e","type":"Follow","actor":"https://mastodon.lothlorien.net/users/jason","object":"https://n4jjs.com/@n4jjs.com"}",109307799703588249,"https:/n4jjs.com/index.php/wp-json/activitypub/1.0/users/0/inbox",{"bypass_availability":true}],"class":"ActivityPub::DeliveryWorker","jid":"81b86fd39c215155dae09c9d","created_at":1704909139.1165545,"enqueued_at":1704909139.1166928}}

Jan 10 12:52:19 mastodon.lothlorien.net bundle[851]: 2024-01-10T17:52:19.218Z pid=851 tid=5tmp3z WARN: Mastodon::UnexpectedResponseError: https://n4jjs.com/index.php/wp-json/activitypub/1.0/users/0/inbox returned code 401

Should the inbox be returning a 401?

@jjschwarz
Copy link
Contributor Author

Update on this is that users from other instances thought they were able to follow, but after refreshing they were also stuck with the following in a pending state. That seems to point to the plugin as the issue because it is impacting several Mastodon instances. The odd part is that other blogs on the same host with the same setup are working (different domain names). Is there any way to debug the 401 error on the inbox?

@jjschwarz
Copy link
Contributor Author

Retested with Mastodon v4.2.4 from two instances and still the same issue. Any thoughts on why I might get a 401 error on the follow post to the inbox?

@jjschwarz
Copy link
Contributor Author

@pfefferle Any thoughts on a way to debug why some of my sites give a 401 error when attempting to follow them and the others work fine? I have tried to uninstall, clean up and reinstall the plugin with no luck (but I could have missed something). Definitely appears to be the plugin because it is happening from multiple Mastodon instances.

@jjschwarz
Copy link
Contributor Author

Also had a few users on other instances test and for the two problem blogs (n4jjs.com and schwarzspanish.com) they are seeing the same thing. I am able to follow janetgschwarz.com for example which is on the same server as schwarzspanish.com. I will say I tried a very early copy of the plugin on the two sites that are having the issue...and when I had issues uninstalled it. Could something be left behind in WordPress that I am missing during an uninstall?

@jjschwarz
Copy link
Contributor Author

Retested with the latest update and still having the same issue on both broken sites. Any suggestion on how to completely purge the data for the plugin and reinstall it? I still think something from an early version is the cause.

@jjschwarz
Copy link
Contributor Author

Retested with v2.3.0 of the plugin and the issue still is continuing. Any suggestions?

@pfefferle
Copy link
Member

It seems that your server does not accept the follow request. Do you use WordPress multi-site?

@pfefferle
Copy link
Member

Do you have plugins that might strip request headers or add any security related features?

@jjschwarz
Copy link
Contributor Author

I have other sites running WordPress on the same httpd service (same server) that work fine. The only thing the sites failing have in common is I used an early version of the plugin on them that wasn't working for me and I uninstalled it. The issue is the follow request on the affected sites seems to give back a 401, but on the other sites on the same server it is fine.

@jjschwarz
Copy link
Contributor Author

Nothing should be stripping headers or altering the request. Given the other sites on the same host are configured the same and working I do not believe that is an issue.

@jjschwarz
Copy link
Contributor Author

Each site is a separate WordPress install in a unique directory on a common database server. I am not using the multi-site functionality because we had some requirements that prevented it.

@pfefferle
Copy link
Member

Do you use the same PHP config for every site? any specialties in the htaccess files of the working installations?

@jjschwarz
Copy link
Contributor Author

The php configurations are all the same. Nothing different in the .htaccess files between the sites.

@jjschwarz
Copy link
Contributor Author

Are there any logs I can pull to show what is happening during the follow request.

@alebaffa
Copy link

I installed the plugin today on Wordpress hosted on Dreamhost (url: https://www.airj.info) - also installed the Webfinger plugin - but i have the same issue. Following the user @info@airj.info gets stuck on pending and, on Mastodon side, the admins say the user is not reachable.
The webfinger is fine.

Any idea how i can fix it?
Thank you.

@pfefferle
Copy link
Member

@alebaffa The endpoint returns a 404 instead of the user informations: https://www.airj.info/.well-known/webfinger?resource=acct%3Ainfo%40airj.info

@pfefferle
Copy link
Member

OK, you seem to have added the wrong WebFinger ID to your comment, https://webfinger.net/lookup/?resource=airj%40airj.info seems to work.

@pfefferle
Copy link
Member

Maybe you find some help here: https://wordpress.org/search/Dreamhost+intext%3A%22Plugin%3A+ActivityPub%22/ ???

@pfefferle
Copy link
Member

And your profile URL seems to be not accessible:

curl "https://www.airj.info/@airj" \
     -H 'Accept: application/activity+json'

@alebaffa
Copy link

Ok, so basically the only way is to use DNS redirect (like the guy who did it with Cloudflare).
I don't want to do this. I give up.

Thanks for your help.

@jjschwarz
Copy link
Contributor Author

OK, but the issue alebaffa is having isn't the same as the issue on n4jjs.com or schwarzspanish.com as far as I can tell.

@jjschwarz
Copy link
Contributor Author

I did check my profile for @jason@n4jjs.com and it seems to work:
curl "https://n4jjs.com/@jason" -H 'Accept: application/activity+json'

@jjschwarz
Copy link
Contributor Author

I also double checked webfinger and it seems fine:
https://webfinger.net/lookup/?resource=jason%40n4jjs.com

@jjschwarz
Copy link
Contributor Author

Retested on v2.5.0 and still having the same problem. I seem to be getting no response on this thread at all.

@pfefferle
Copy link
Member

@jjschwarz the problem is, that it can't be fixed on the plugin level. your server seem to have issues replying to the Follow request properly. And I can't debug that because I have no access to your server.

@pfefferle
Copy link
Member

or it might be an issue, because of the index.php in the URL...

@jjschwarz
Copy link
Contributor Author

jjschwarz commented Jul 1, 2024 via email

@jjschwarz
Copy link
Contributor Author

jjschwarz commented Jul 1, 2024 via email

@pfefferle
Copy link
Member

@jjschwarz after a short debugging I realized, that it is because of the index.php in the URL. This will not be parsed by the request and so the signature verification is without it and fails.

@pfefferle
Copy link
Member

Ok, how could I change that to test if it is the issue? I do not see any setting appending that to the URL.

I have no idea to be honest... I saw it only a few times so far and was curious that it even works.

Will see if there might be a solution to it in the code... There is at least one other report in the GitHub issues.

@jjschwarz
Copy link
Contributor Author

jjschwarz commented Jul 1, 2024 via email

@jjschwarz
Copy link
Contributor Author

jjschwarz commented Jul 1, 2024 via email

@jjschwarz
Copy link
Contributor Author

jjschwarz commented Jul 1, 2024 via email

@pfefferle
Copy link
Member

I found several complaints that this is the “out of box” behavior of permalinks in WordPress…which obviously wasn’t an issue until I tried this module.

This is definitely not the default (I have not even an option in my WordPress permalinks settings to add it), but your site is configured like that, so it does not help to discuss defaults :)

I will think about a fix tomorrow, it is late in germany!

@jjschwarz
Copy link
Contributor Author

jjschwarz commented Jul 1, 2024 via email

@jjschwarz
Copy link
Contributor Author

jjschwarz commented Jul 2, 2024 via email

@jjschwarz
Copy link
Contributor Author

OK, I skipped an important step. I had to "Stop Delivery" and then "Purge" the sites in the federation area on Mastodon because it had the old URL with index.php cached. Now I can follow both blogs. I am going to close out this case since I was able to resolve the issue, but it might be handy to add the information about index.php to the documentation for others that might encounter it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs triage [Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants