• Resolved Blamedutchie

    (@blamedutchie)


    Hi,

    New to connecting WordPress to the Fediverse, and I have installed the plugin only today, so maybe I am misinterpreting some of the documentation regarding author profile pages. Since I’m the only author on the site, I’m not using those. In the ActivityPub plugin’s settings I’ve only set blog profile. So, if that is the reason for the following error, please clarify.

    Fatal error: Uncaught Error: Call to undefined method WP_Error::get_id() in /home/u711327747/domains/blamedutchie.photography/public_html/wp-content/plugins/activitypub/includes/class-dispatcher.php:69

    Line 69 being: $activity->set_actor( Actors::get_by_id( $outbox_item->post_author )->get_id() );

    Stack trace:
    0 /../../../../wp-includes/class-wp-hook.php(324): Activitypub\Dispatcher::process_outbox()
    1 /../../../../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    2 /../../../../wp-includes/plugin.php(565): WP_Hook->do_action()
    3 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(361): do_action_ref_array()
    4 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(284):Cron_Event_Command::run_event()
    5 [internal function]: Cron_Event_Command->run()
    6 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
    7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}()
    8 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(497): call_user_func()
    9 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(441): WP_CLI\Dispatcher\Subcommand->invoke()
    10 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(464): WP_CLI\Runner->run_command()
    11 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1295): WP_CLI\Runner->run_command_and_exit()
    12 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
    13 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process()
    14 phar://../../../wp-cli-2.10.0.phar/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
    15 phar://../../../wp-cli-2.10.0.phar/php/boot-phar.php(20): include('phar:///usr/loc…')
    16 /../../../wp-cli-2.10.0.phar(4): include('phar:///usr/loc…')
    17 {main}


    The cronjob is:
    cron event run –due-now > /dev/null 2>&1

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Konstantin Obenland

    (@obenland)

    Thanks for the report @blamedutchie, we’re looking into it

    Plugin Author Konstantin Obenland

    (@obenland)

    Could you tell us a bit more about what happened right before?
    Is it possible the actor mode was updated right after a post/comment/profile was created/updated?

    Thread Starter Blamedutchie

    (@blamedutchie)

    Well,
    Trying to recall…

    After installing/configuring the plugin, I realized that a few posts were assigned to my backup administrative account, so assigned all posts to the author account that I intend to use throughout the Fediverse.

    Meanwhile, on Mastodon/Gram, the `wrong´ author got propagated.

    So, I updated the plugin’s settings to reflect the changes made to the assigned post_author.
    On Mastodon I could already find the correct author profile to follow, on Gram.social not yet, but I guess that’s a matter of time.

    So, outbound things seem to work.

    Oh, and directly after the changes I ran the cron job again, to see if the error still pops up and it does.

    Plugin Author Konstantin Obenland

    (@obenland)

    Yes, it sounds like there’s a mismatch between the author of the Outbox item and the setting for the actor type, at least that’s my suspicion.

    There are a few ways to solve it:

    • You could set the actor type to “Both author and blog profiles” and then run the cron again. That should let it go through.
    • If you have WP CLI access
      • you could update the author of the Outbox post to the correct author and process followers:
        • wp post list --post_type=ap_outbox --post_status=pending to get the post_id of the pending Outbox item.
        • wp post update <id> --post_author=0
        • Then run the cron again.
      • you could publish the post and skip processing followers for it:
        • wp post list --post_type=ap_outbox --post_status=pending to get the post_id of the pending Outbox item.
        • wp post update <id> --post_status=publish

    In the meantime I put together a proposal to account for this in the future.

    Thread Starter Blamedutchie

    (@blamedutchie)

    Alright,

    When back at the box, I’ll check out your suggestions.
    To see if I understand this part of the workflow correctly:

    The wp post list --post_type=ap_outbox --post_status=pending refers to any post that is supposed to be shared throughout the Fediverse, right? Considering the plugin does not look at existing posts, it only works on new posts, created or set to publish after installation of the plugin.

    So, if no new posts available, the plugin does nothing, otherwise performs its magic, am I right?

    Where you write ... --post_author=0, you meant that zero as an example or is the zero to clear the existing value?

    Plugin Author Konstantin Obenland

    (@obenland)

    That is correct. The cli command gets all Activities that have not been shared yet, like updated posts.

    The 0 represents the Blog user for the purpose of federating Activities. With your site being set to Blog-only, setting it to 0 should make the internal check pass that’s currently causing the error.

    My assumption is that the author of the Outbox item is currently set to a User ID, and the mismatch of the User ID and the Blog-only mode causes the error.

    Thread Starter Blamedutchie

    (@blamedutchie)

    OK, thanks!
    I’ll check if your assumption is correct.

    And then the plot starts to thicken as does the mist in my head…
    Output of wp post list --post_type=ap_outbox --post_status=pending:

    ID | post_title | post_name | post_date | post_status
    | 11167 | https://blamedutchie.photography/?author=1 | | 2025-02-05 23:33:58 | pending |
    | 11166 | https://blamedutchie.photography/?author=1 | | 2025-02-05 23:33:58 | pending |
    | 11165 | https://blamedutchie.photography/?author=1 | | 2025-02-05 23:32:31 | pending |
    | 11164 | https://blamedutchie.photography/?author=1 | | 2025-02-05 23:32:31 | pending |
    | 11162 | https://blamedutchie.photography/?author=1 | | 2025-02-05 23:30:48 | pending |
    | 11161 | https://blamedutchie.photography/?author=1 | | 2025-02-05 23:30:47 | pending |
    | 11160 | https://blamedutchie.photography/?author=1 | | 2025-02-05 23:30:12 | pending |
    | 11159 | https://blamedutchie.photography/?author=1 | | 2025-02-05 23:30:11 | pending

    So, assuming I run wp post update <id> --post_author=0 on these ID’s and then the cron job, this could solve the issue?

    • This reply was modified 1 year ago by Blamedutchie. Reason: xtra info
    • This reply was modified 1 year ago by Blamedutchie. Reason: removed line
    Plugin Author Konstantin Obenland

    (@obenland)

    That’s right! Fingers crossed! 🙂

    Thread Starter Blamedutchie

    (@blamedutchie)

    Those ID’s are strange by the way, because they don’t exist when I do wp post list

    Plugin Author Konstantin Obenland

    (@obenland)

    Yes, it’s a non-public post type, I assume list checks for that

    Thread Starter Blamedutchie

    (@blamedutchie)

    Alright…
    I’ve updated those posts, ran the cron job (which gave no errors, nice), repeated wp post list --post_type=ap_outbox --post_status=pending, which gave zero hits.

    Thank you for your really rapid response and help with this, Konstantin! I wish all plugin authors were this quick 😉

    Cheers!

    Plugin Author Konstantin Obenland

    (@obenland)

    Any time! Thanks for the report and giving us a chance to fix it!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Fatal error: Uncaught error’ is closed to new replies.