8000 Issues following BookWyrm users results in critical error -> Uncaught TypeError: Friends\Feed_Parser_ActivityPub ($item) must be of type Friends\Feed_Item · Issue #499 · akirk/friends · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Issues following BookWyrm users results in critical error -> Uncaught TypeError: Friends\Feed_Parser_ActivityPub ($item) must be of type Friends\Feed_Item #499

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

Open
mcortez opened this issue Mar 24, 2025 · 1 comment

Comments

@mcortez
Copy link
mcortez commented Mar 24, 2025

When attempting to add a feed from bookwyrm.social get an uncaught exception.

Feed URL: https://bookwyrm.social/user/Michael_Cortez
Parser: ActivityPub

When I click Preview I get:

Items in the Feed
There has been a critical error on this website. Please check your site admin email inbox for instructions. If you continue to have problems, please try the support forums.

WordPress is generating this:

WordPress version 6.7.2
Active theme: Twenty Sixteen (version 3.4)
Current plugin: Friends (version 3.4.4)
PHP version 8.2.26



Error Details
=============
An error of type E_ERROR was caused in line 1973 of the file /home/dh_f9i9ph/[michaelcortez.com/wp-content/plugins/friends/feed-parsers/class-feed-parser-activitypub.php](http://michaelcortez.com/wp-content/plugins/friends/feed-parsers/class-feed-parser-activitypub.php). Error message: Uncaught TypeError: Friends\Feed_Parser_ActivityPub::modify_incoming_item(): Argument #1 ($item) must be of type Friends\Feed_Item, null given, called in /home/dh_f9i9ph/[michaelcortez.com/wp-includes/class-wp-hook.php](http://michaelcortez.com/wp-includes/class-wp-hook.php) on line 326 and defined in /home/dh_f9i9ph/[michaelcortez.com/wp-content/plugins/friends/feed-parsers/class-feed-parser-activitypub.php:1973](http://michaelcortez.com/wp-content/plugins/friends/feed-parsers/class-feed-parser-activitypub.php:1973)
Stack trace:
#0 /home/dh_f9i9ph/[michaelcortez.com/wp-includes/class-wp-hook.php(326)](http://michaelcortez.com/wp-includes/class-wp-hook.php(326)): Friends\Feed_Parser_ActivityPub->modify_incoming_item(NULL, Object(Friends\User_Feed), Object(Friends\Subscription))
#1 /home/dh_f9i9ph/[michaelcortez.com/wp-includes/plugin.php(205)](http://michaelcortez.com/wp-includes/plugin.php(205)): WP_Hook->apply_filters(NULL, Array)
#2 /home/dh_f9i9ph/[michaelcortez.com/wp-content/plugins/friends/includes/class-feed.php(193)](http://michaelcortez.com/wp-content/plugins/friends/includes/class-feed.php(193)): apply_filters('friends_modify_...', NULL, Object(Friends\User_Feed), Object(Friends\Subscription), NULL)
#3 /home/dh_f9i9ph/[michaelcortez.com/wp-content/plugins/friends/includes/class-admin.php(2142)](http://michaelcortez.com/wp-content/plugins/friends/includes/class-admin.php(2142)): Friends\Feed->preview(Object(Friends\Feed_Parser_ActivityPub), 'https://bookwyr./..', 51)
#4 /home/dh_f9i9ph/[michaelcortez.com/wp-includes/class-wp-hook.php(324)](http://michaelcortez.com/wp-includes/class-wp-hook.php(324)): Friends\Admin->render_admin_add_friend('')
#5 /home/dh_f9i9ph/[michaelcortez.com/wp-includes/class-wp-hook.php(348)](http://michaelcortez.com/wp-includes/class-wp-hook.php(348)): WP_Hook->apply_filters('', Array)
#6 /home/dh_f9i9ph/[michaelcortez.com/wp-includes/plugin.php(517)](http://michaelcortez.com/wp-includes/plugin.php(517)): WP_Hook->do_action(Array)
#7 /home/dh_f9i9ph/[michaelcortez.com/wp-admin/admin.php(259)](http://michaelcortez.com/wp-admin/admin.php(259)): do_action('friends_page_ad...')
#8 {main}
  thrown

When examining the Outbox of the feed using activitypub.academy, I get the following for the first post -- all other posts are similiar

{
  "id": "https://bookwyrm.social/user/Michael_Cortez/comment/7014906",
  "type": "Note",
  "published": "2025-03-24T16:05:14.975618+00:00",
  "attributedTo": "https://bookwyrm.social/user/Michael_Cortez",
  "content": "<p>Michael started reading This Inevitable Ruin</p><p>(comment on <a href=\"https://bookwyrm.social/book/1769329\"><i>This Inevitable Ruin</i></a>)</p>",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "cc": [
    "https://bookwyrm.social/user/Michael_Cortez/followers"
  ],
  "replies": {
    "id": "https://bookwyrm.social/user/Michael_Cortez/comment/7014906/replies",
    "type": "OrderedCollection",
    "totalItems": 0,
    "first": "https://bookwyrm.social/user/Michael_Cortez/comment/7014906/replies?page=1",
    "last": "https://bookwyrm.social/user/Michael_Cortez/comment/7014906/replies?page=1",
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      {
        "Hashtag": "as:Hashtag"
      }
    ]
  },
  "tag": [],
  "attachment": [
    {
      "type": "Document",
      "url": "https://bookwyrm-social.sfo3.digitaloceanspaces.com/images/previews/covers/1769329-6c93a1b5-6623-45b2-ac78-26d08aa1f07d.jpg",
      "name": "Matt Dinniman: This Inevitable Ruin (2024, Independently published)",
      "@context": [
        "https://www.w3.org/ns/activitystreams",
        {
          "Hashtag": "as:Hashtag"
        }
      ]
    }
  ],
  "sensitive": false,
  "inReplyToBook": "https://bookwyrm.social/book/1769329",
  "readingStatus": "reading",
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag"
    }
  ]
}
@mcortez
Copy link
Author
mcortez commented Mar 24, 2025

Looking at class-feed-parser-activitypub.php -- process_incoming_activity( $type, $activity, $user_id, $user_feed )

I suspect maybe it's because the posts are of type "Note" and the activitypub parser is expecting types of Create, Update, Delete, Announce, Unannounce, Like, Unlike, and Move ???

This is my first time digging into this code-base, and first time troubleshooting ActivityPub stuff -- so I could be completely off. I might be looking in the completely wrong place by looking at the Outbox on the Bookwyrm side of things.

Bookwyrm documenation includes the following info: https://docs.joinbookwyrm.com/activitypub.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0