• Resolved solarian

    (@solarian)


    I’m getting the following when using WP-CLI:

    Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, array callback must have exactly two members in /var/www/html/wp-includes/rest-api/class-wp-rest-server.php:1631

    I eventually traced this to [...]/event-tickets/src/Tickets/Commerce/Order_Modifiers/API/Coupons.php, in which there are three occasions where WP’s register_rest_route() is called with invalid parameters, this being the offending parameter:

    'schema' => $this->get_schema()

    I’m not sure quite what is being intended there, but as you’ll see it gets past the _doing_it_wrong() checks in register_rest_route() and causes the fatal error. I’ve commented out those three lines in my local copy, but I’d appreciate it if you could look into this and fix it before the next version, since it does cause WP-CLI to fail — which could be important for some people!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Adding our case and output to this thread:

    Command: wp plugin list

    Output:

    Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, array must have exactly two members in <site dir>/wp-includes/rest-api/class-wp-rest-server.php:1631
    Stack trace:
    #0 <site dir>/wp-includes/rest-api/class-wp-rest-server.php(1572): WP_REST_Server->get_data_for_route('/tribe/tickets/...', Array, 'help')
    #1 <site dir>/wp-includes/rest-api/class-wp-rest-server.php(1379): WP_REST_Server->get_data_for_routes(Array, 'help')
    #2 <site dir>/wp-includes/rest-api/class-wp-rest-server.php(1292): WP_REST_Server->get_index(Object(WP_REST_Request))
    #3 <site dir>/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/', Array, NULL)
    #4 <site dir>/wp-content/plugins/woocommerce/includes/cli/class-wc-cli-runner.php(63): WP_REST_Server->dispatch(Object(WP_REST_Request))
    #5 phar:///usr/local/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/class-wp-cli.php(336): WC_CLI_Runner::after_wp_load()
    #6 phar:///usr/local/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1375): WP_CLI::do_hook('after_wp_load')
    #7 phar:///usr/local/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1267): WP_CLI\Runner->load_wordpress()
    #8 phar:///usr/local/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
    #9 phar:///usr/local/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
    #10 phar:///usr/local/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
    #11 phar:///usr/local/bin/wp-cli.phar/php/boot-phar.php(20): include('phar:///usr/loc...')
    #12 /usr/local/bin/wp-cli.phar(4): include('phar:///usr/loc...')
    #13 {main}
    thrown in <site dir>/wp-includes/rest-api/class-wp-rest-server.php on line 1631
    Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
    • This reply was modified 6 months, 4 weeks ago by h3mul.
    Plugin Support Darian

    (@d0153)

    Hi @solarian

    Thanks for reaching out—happy to help!

    Could you share the exact command you used when the error occurred? I’d like to take a closer look on my end. Also, if you haven’t done so yet, please make sure all our plugins are updated to their latest versions, as that might resolve the issue.

    @h3mul I tested this on a clean site using the latest versions of The Events Calendar and Event Tickets, and everything seems to be working as expected. Could you try the following steps:

    • Activate only our plugins
    • Switch to a basic theme (like Twenty Twenty-One)
    • See if the issue still occurs

    Lastly, if you don’t mind, could you open a separate support thread? That way, we can better track and assist you with your specific case.

    Let us know how it goes!

    Thanks for the prompt response!
    I don’t object to a new thread, but it does seem like this is an identical issue to @solarian

    Regarding your followup, we do use Twenty Twenty-One, and I discovered that the error above only occurs when BOTH Event Tickets Version 5.24.2 and WooCommerce Version 9.9.4 are active together; if either is deactivated the error does not occur and the wp command succeeds. (this is with other plugins enabled as well, not just these two)

    Will continue testing to uncover any further conflicts

    • This reply was modified 6 months, 3 weeks ago by h3mul.
    • This reply was modified 6 months, 3 weeks ago by h3mul.
    Thread Starter solarian

    (@solarian)

    Oh ffs, look at your shitty code.

    Plugin Support tristan083

    (@tristan083)

    Hi @h3mul ,

    Thank you for your message and the information.

    We have an internal ticket (TECTRIA-988) to address this issue and I’ve included your specific use case in it to communicate it to our team.

    We prioritize bugs by taking into consideration the number of users impacted as well as how the bug impacts one’s ability to run an event/sell tickets. I don’t have a specific timeline as to when this issue will be resolved, but trust that our team is aware. Our team communicates updates and bug fixes in our newsletter and via our changelog.

    Thanks again for reporting this issue and for using Event Tickets! Have a great day.

    Internal Bug Ticket Reference: TECTRIA-988

    Plugin Support Darian

    (@d0153)

    Hi @solarian

    I understand your frustration, and I’m here to help. To track down what’s causing the issue, I’ll need a bit more detail—specifically, where and how the problem is showing up.

    In many cases, issues like this are caused by a conflict with a plugin or theme rather than the core code itself. If you could share the steps to reproduce the issue, along with any error messages or logs, I’d be happy to investigate further and help identify the root cause.

    Are you experiencing the issue with only Event Tickets active, or is it similar to what @h3mul reported—where the issue occurs only when WooCommerce is also active?

    Plugin Support Darian

    (@d0153)

    Hi there,

    It looks like we haven’t heard back from you in a while, so I’ll go ahead and close this thread for now. If you need further assistance, feel free to reopen it or start a new thread.

    Hi I just found this thread on Google because I’m dealing with a similar issue. Glad I found it – I deactivated Event Tickets and my WP CLI commands work again. Looks like the OP said, that there is something invalid in the rest route definitions in the plugin.

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

The topic ‘WP-CLI fatal error’ is closed to new replies.