Automattic / wordpress-activitypub

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

Post not showing up at Mastodon #873

Open jeckman opened 2 months ago

jeckman commented 2 months ago

Quick summary

I run ActivityPub on WordPress here: @john@goatless.org

To test it, I followed myself from mastodon.social: https://mastodon.social/@john@goatless.org

I don't see any posts since Sept 2023, but I post regularly.

I tried unfollowing and refollowing - but I'm stuck on even how to troubleshoot what's going on here not knowing where the problem might be

Steps to reproduce

Visit https://mastodon.social/@john@goatless.org or find the user @john@goatless.org on any ActivityPub site

What you expected to happen

Posts should appear, including those written this week

What actually happened

I see nothing newer than Sept 28, 2023

Impact

One

Available workarounds?

No and the platform is unusable

Logs or notes

No response

pfefferle commented 2 months ago

Can you install a cron plugin to check if there are some blocking wp_crons?

pfefferle commented 2 months ago

Or have you disabled or maybe misconfigured your WP_Cron setup?

jeckman commented 2 months ago

Nothing blocking WP_Cron, and the posts do show up on another WordPress instance running Friends plugin - so at least WP to WP it is working.

solarbirdy commented 2 months ago

I'm also seeing this on one of my sites - @status@status.murkworks.net - it was working fine and then it just stopped. I've been meaning to come report it. WP site is at https://status.murkworks.net and here's a view of the profile from my Mastodon instance https://mastodon.murkworks.net/@status@status.murkworks.net so.

I'm able to refresh the profile fine so it is talking to the world. I'm getting 200 OK in response to hits on wp-cron.php and I'm having that run every five minutes at the system level, but it doesn't help.

jeckman commented 2 months ago

Solarbirdy - since you're also running a mastodon instance, is there anything logged on that side? I'm not running one and therefore stuck on how to debug

pfefferle commented 2 months ago

Does Mastodon index your posts if you put the permalink of a new post into the search field?

I am currently at vacation, will run some tests when I am back!

solarbirdy commented 2 months ago

@jeckman - As in, apache logs or something? Not that I've found.

@pfefferle - That's interesting. YES. And the post once searched for appears, but only on the individual author profile (as viewed from Mastodon), and not on the blog profile (also as viewed from mastodon).

I searched for the most recent post, now it appears in the @solarbird@status.murkworks.net profile as it should:

image

But it still does not appear in the @status@status.murkworks.net profile:

image

And none of the posts between that and the older ones have federated.

Also - relax and enjoy your vacation, this is not any kind of Sev1 crisis for us, the important back-end notifications hang off the RSS feed directly. The Federation feed is an additional courtesy for the Mastodon users we host, so not critical - but I do want to get it working again, obviously. ^_^

(It's weird that it's this one. This is the simplest, most basic wordpress setup we have, and it's the one not Federating.)

jeckman commented 2 months ago

Mine do show up in mastodon if I search for them by permalink, and then after that they show up in the profile

pfefferle commented 2 months ago

Ok, then it does not seem to be a caching issue, but a distribution thing! @solarbirdy can you check if your blogs domain is on a block list of your instance?

harcesz commented 2 months ago

Thought I had the same problem, but either random tinkering or just waiting "solved" it. Test posts federated successfully.

hardillb commented 1 month ago

I believe I'm seeing this as well. Specifically I have 2 mastodon users. The first follows both the overall blog profile and the author profile. The second is only following the blog profile.

The user following the author sees the posts but not the boost by the blog profile, and the user only following the blog profile is not seeing the posts getting boosted by the blog profile.

Looking at the blog profile via my mastodon instance I do see one boosted post from the 13th Sept, but not the newer post

blog profile: @blog.hardill.me.uk@blog.hardill.me.uk author profile @hardillb@blog.hardill.me.uk

pfefferle commented 1 month ago

Hey @hardillb 👋

Have checked if you have some blocking WP_Crons in your queue?

hardillb commented 1 month ago

I don't think so, the health check page shows all is good.

wcli cron test reports Success: WP-Cron spawning is working as expected.

wcli cron event list shows

+------------------------------------+---------------------+-----------------------+------------+
| hook                               | next_run_gmt        | next_run_relative     | recurrence |
+------------------------------------+---------------------+-----------------------+------------+
| wp_update_user_counts              | 2024-09-27 07:27:43 | 23 seconds            | 12 hours   |
| action_scheduler_run_queue         | 2024-09-27 07:27:53 | 33 seconds            | 1 minute   |
| jetpack_sync_full_cron             | 2024-09-27 07:28:03 | 43 seconds            | 5 minutes  |
| jetpack_sync_cron                  | 2024-09-27 07:30:34 | 3 minutes 14 seconds  | 5 minutes  |
| jetpack_clean_nonces               | 2024-09-27 07:34:38 | 7 minutes 18 seconds  | 1 hour     |
| wp_privacy_delete_old_export_files | 2024-09-27 07:43:57 | 16 minutes 37 seconds | 1 hour     |
| w3_objectcache_cleanup             | 2024-09-27 07:52:34 | 25 minutes 14 seconds | 1 hour     |
| activitypub_update_followers       | 2024-09-27 07:56:11 | 28 minutes 51 seconds | 1 hour     |
| wp_version_check                   | 2024-09-27 08:04:17 | 36 minutes 57 seconds | 12 hours   |
| wp_update_themes                   | 2024-09-27 08:04:22 | 37 minutes 2 seconds  | 12 hours   |
| wp_update_plugins                  | 2024-09-27 08:06:30 | 39 minutes 10 seconds | 12 hours   |
| w3_pgcache_cleanup                 | 2024-09-27 08:20:21 | 53 minutes 1 second   | 1 hour     |
| wp_scheduled_auto_draft_delete     | 2024-09-27 08:23:36 | 56 minutes 16 seconds | 1 day      |
| jp_purge_transients_cron           | 2024-09-27 09:53:09 | 2 hours 25 minutes    | 1 day      |
| activitypub_cleanup_followers      | 2024-09-27 10:56:11 | 3 hours 28 minutes    | 1 day      |
| jetpack_v2_heartbeat               | 2024-09-27 16:27:26 | 9 hours               | 1 day      |
| jp_sitemap_cron_hook               | 2024-09-27 17:28:57 | 10 hours 1 minute     | 12 hours   |
| wp_scheduled_delete                | 2024-09-27 17:49:47 | 10 hours 22 minutes   | 1 day      |
| recovery_mode_clean_expired_keys   | 2024-09-27 19:26:52 | 11 hours 59 minutes   | 1 day      |
| delete_expired_transients          | 2024-09-27 20:04:53 | 12 hours 37 minutes   | 1 day      |
| akismet_scheduled_delete           | 2024-09-28 01:12:47 | 17 hours 45 minutes   | 1 day      |
| wp_site_health_scheduled_check     | 2024-09-28 08:11:42 | 1 day                 | 1 week     |
| wp_delete_temp_updater_backups     | 2024-10-01 23:08:38 | 4 days 15 hours       | 1 week     |
+------------------------------------+---------------------+-----------------------+------------+

Let me know if there is another way to test/check

pfefferle commented 1 month ago

Could there be a race condition? Was there someone following that account when you published the post?

hardillb commented 1 month ago

No, the accounts have been following for over a week and the last publish was yesterday. The blog profile has only boosted one post back on the 13th and none since.

pfefferle commented 1 month ago

and you have enabled "Blog-Profile" and "Author-Profiles" in the settings?

hardillb commented 1 month ago

Yep, running the defaults

image

pfefferle commented 1 month ago

Do you use caching plugins?

hardillb commented 1 month ago

Yes, I have W3 Total Cache installed with these 3 drop-ins enabled

image

pfefferle commented 1 month ago

Maybe this is the problem. W3 Total Cache has some issues with content negotiation: https://github.com/Automattic/wordpress-activitypub/wiki/Caching

hardillb commented 1 month ago

OK, I'll have a look at the caching settings/plugin, but out of curiosity why would this only block the blog profile and not the author profiles?

pfefferle commented 1 month ago

Only an assumption! It seems like a random thing (it worked one time) and that's why I assume the caching. When a caching plugin does not support content negotiation, it depends on the file in the cache. If it is the JSON it might work, otherwise it might break.

hardillb commented 1 month ago

Yep, if I turn off the object caching things look to be working (well I get JSON back if I pass a Accept: application/activity+json header when testing with curl.

I'll raise an issue with W3 Total Cache

pfefferle commented 1 month ago

And as I said, we also try to work against that issue: https://github.com/Automattic/wordpress-activitypub/pull/894

hardillb commented 1 month ago

Just to come back to this, It turns out it's not the Object Cache, but the Page Cache that is the problem. Also using Redis rather than Disk: Enhanced appears to work correctly on a test setup

pfefferle commented 1 month ago

Oh yes, it's always the page cache, because it could cache the wrong representation, if it does not use different buckets based on the accept header. Sorry if I was not clear about that!

harcesz commented 1 month ago

I'll do a deeper dive later, but seems I'm also still having this/similar issue; post show up on mastodon a day later, with the correct posting hour, and so would be missed by most. Less then ideal. But I'm not sure if it's somehow not a mastodon issue, as some online debug tool fetches correct and up to date data... No catching on the website.

pfefferle commented 1 month ago

@harcesz the plugin sends the post asynchronously through wp-cron. Maybe you can check how often this will be triggered!?!

wadaki commented 1 month ago

I have exactly the same issue. I don't know if the plugin need the Wordpress cron, I didn't setup yet. But anyway, I think it's not related, because I can see the numbers of postings. There is only no content in Mastodon visible. https://social.tchncs.de/deck/@SatoLab@satolab.ignorelist.com https://satolab.ignorelist.com/?author=1Mein

Looks like permission issue...

pfefferle commented 1 month ago

The number you see on mastodon has not much to do with the actual posts that show up there! Mastodon can get the number of post from an API.

One thing: Mastodon does not import old posts, only new ones that are created after someone is following the blog!

Can you provide us an example post URL so that we can have a look?

wadaki commented 1 month ago

Thank you for explanation. Yesterday I created a new blog entry here: https://satolab.ignorelist.com/

When I search in Mastodon my accounting "@SatoLab@satolab.ignorelist.com", I can find the account, but no blog item is visible.

Please feel free to contact me if you need more information.

pfefferle commented 1 month ago

I can see a post:

Image

wadaki commented 1 month ago

This is only, because I shared by my self manual. Now I created a new "Test for Mastodon", it will not show up.

wadaki commented 1 month ago

Maybe you are right, the cron job is important. I don't know why, but the cron job via Wordpress does not work. So I created a cron job for "www-data" user server side. As soon as it was done, the last entries were published in Mastodon. I will check in the next days. Maybe it's a subdomain problem?

swduncan commented 1 month ago

I have a very similar issue - blog is at swduncan.com, I recently moved from Wordpress.com where it worked fine under their business plan using the ActivityPub plugin, to self-hosting on Amazon Lightsail. The change was made a few days ago.

I can see the profile in Mastodon as it was before the switch, but no followers and no new posts. When I try to follow the existing profile, it looks like it's taking on the Mastodon.social web interface, but on the app it says it's pending.

Site health shows no problems. wp-cron is set up and running - under the www-data user Webfinger doesn't show any issues with my profile page.

What else is there to check to debug this?

pfefferle commented 1 month ago

@swduncan It seems that you found every possible forum to ask the question ☺️

I will answer on WordPress.org https://wordpress.org/support/topic/posts-not-posting-follows-pending-post-to-wp-json-is-404/

jjschwarz commented 1 month ago

I appear to be suffering the same thing on multiple hosts. Right now I am fighting with @lemonade@bellcowservices.com and the blog wide @bellcowservices.com@bellcowservices.com accounts. They haven't shown any posts since 28 June, but nothing has really changed on the server since that time other than routine plugin updates. The cron jobs seem to be firing off fine from the system cron via the wp-cron.php URL. Any suggestions on next place to look?

jjschwarz commented 1 month ago

Something similar happening at @n4jjs.com. I seems to randomly show posts, I received some but not others.