• Resolved mike.s

    (@mikes-1)


    Hi

    I have matomo installed on hundreds of sites, and all of a sudden they have all stoopped showing any statistics

    on the diagnostics page there shows an error

    Last Successful Archiving Completion error Archiving has not yet run successfully

    you can see a screenshot here: https://www.screencast.com/t/uf0jeDdXoi

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter mike.s

    (@mikes-1)

    i see from a couple of other previous posts that this is likely due to a conflict to wp-rocket…

    • This reply was modified 2 years, 6 months ago by mike.s.

    Hello @mikes-1

    Do you use WP-rocket?
    If yes, the problem is reported here:
    https://github.com/matomo-org/matomo-for-wordpress/issues/642
    This is a big problem which requires a lot of work to be solved. We expect to fix it in the next major release of Matomo.

    Until it fixes, you can downgrade your WP-rocket version by following this tutorial:
    https://github.com/matomo-org/matomo-for-wordpress/wiki/Downgrade-wp-rocket-to-a-version-compatible-with-the-Matomo-plugin

    Kind regards

    Mat

    • This reply was modified 2 years, 6 months ago by mattmary.

    I’m having also this issue when using WP CLI for cron jobs. Here is the output:

    Fatal error: Uncaught Exception: 32 total errors during this script execution, please investigate and try and fix these errors. in /wp-content/plugins/matomo/app/core/CronArchive.php:625
    
    Seguimiento de la pila
    1.	
    Piwik\CronArchive->logFatalError()
    /wp-content/plugins/matomo/app/core/CronArchive.php:618
    2.	
    Piwik\CronArchive->end()
    /wp-content/plugins/matomo/app/core/CronArchive.php:280
    3.	
    Piwik\CronArchive->Piwik\{closure}()
    /wp-content/plugins/matomo/app/core/Access.php:670
    4.	
    Piwik\Access::doAsSuperUser()
    /wp-content/plugins/matomo/app/core/CronArchive.php:284
    5.	
    Piwik\CronArchive->main()
    /wp-content/plugins/matomo/classes/WpMatomo/ScheduledTasks.php:332
    6.	
    WpMatomo\ScheduledTasks->archive()
    /wp-includes/class-wp-hook.php:305
    7.	
    WP_Hook->apply_filters()
    /wp-includes/class-wp-hook.php:331
    8.	
    WP_Hook->do_action()
    /wp-includes/plugin.php:524
    9.	
    do_action_ref_array()
    phar:///usr/local/bin/wp/vendor/wp-cli/cron-command/src/Cron_Event_Command.php:343
    10.	
    Cron_Event_Command::run_event()
    phar:///usr/local/bin/wp/vendor/wp-cli/cron-command/src/Cron_Event_Command.php:265
    11.	
    Cron_Event_Command->run()
    [internal function]:0
    12.	
    call_user_func()
    phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:100
    13.	
    WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}()
    [internal function]:0
    14.	
    call_user_func()
    phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:491
    15.	
    WP_CLI\Dispatcher\Subcommand->invoke()
    phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:417
    16.	
    WP_CLI\Runner->run_command()
    phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:440
    17.	
    WP_CLI\Runner->run_command_and_exit()
    phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1237
    18.	
    WP_CLI\Runner->start()
    phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:28
    19.	
    WP_CLI\Bootstrap\LaunchRunner->process()
    phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php:78
    20.	
    WP_CLI\bootstrap()
    phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php:27
    21.	
    include('...')
    phar:///usr/local/bin/wp/php/boot-phar.php:11
    22.	
    include('...')
    /usr/local/bin/wp:4
    23.	
    {main}
    thrown in /wp-content/plugins/matomo/app/core/CronArchive.php on line 625

    and also messages like this one:

    Fatal error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record) must be compatible with Monolog\Handler\AbstractProcessingHandler::handle(array $record): bool in /wp-content/plugins/matomo/app/vendor/symfony/monolog-bridge/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php on line 88

    When will the Matomo team solve this problem? For me, downgrading WP Rocket is not an option. And it seems that this happened also in the past with WP Optimize plugin. There is any workaround to solve this problem? May be that there is any way to disable WP Rocket while Matomo is executing the archive operations.

    Hi @fidoboy

    Sorry this is a huge refactoring and it should be solved in the next major release which should be published in the upcoming months.
    Until then, we do not have other option that suggest you to downgrade your wp-rocket version.
    https://github.com/matomo-org/matomo-for-wordpress/wiki/Downgrade-wp-rocket-to-a-version-compatible-with-the-Matomo-plugin
    Kind regards

    Mat

    Hi @mattmary

    For me, downgrading WP Rocket is not an option as I’ve said. I’ve noticed that in my case the errors only comes when executing the archive operation (I’m using PHP 8.0) during cron. I’m also using cron with WP CLI, not with the regular wget calls to the wp-cron.php and it seems that it’s when the errors comes into place.

    However, manually executing the archive through the troubleshooting section into the diagnostics Matomo’s dashboard page works fine, no errors at all. So there must be a way to solve it without the need of upgrade the monolog library on Matomo or without downgrade it on WP Rocket, because the manual call to execute the archive works without problems.

    I understand that upgrade the monolog library being used by Matomo is a big issue, because newer version doesn’t work with old PHP versions, but I’m sure that there are workarounds, may be using namespaces to avoid conflicts with other plugins. I don’t believe that the only solution could be to wait until Matomo upgrades to monolog 2.0, that’s not the way to go now. The solution is to make only minor changes into Matomo plugin using a namespace to avoid conflicting with other plugins that also are using monolog.

    Plugin Author Thomas

    (@tsteur)

    > may be using namespaces to avoid conflicts with other plugins

    Hi @fidoboy thanks for the comment and ideas. We’re currently exploring exactly this in https://github.com/matomo-org/matomo/pull/19712. There’s lots of work happening around this right now. It’s unclear though if we can actually make this work reliably without creating bigger issues.

    If this didn’t work, then we could try and upgrade the version of Monolog but this may cause incompatibilities with other plugins. We’re working on the namespace fix though and trying to solve this issue. We hope this will work but we cannot guarantee it right now.

    In my particular setup (PHP 8.0), the only problem comes from the Matomo archiving operation being executed via cron. I can skip the Matomo plugin when executing cron through WP CLI avoiding the errors, but that way the archiving is not being executed. So I’m wondering if there is any way to execute the archive operation in Matomo from command line. That way I could provisionally schedule a cron for Matomo archive avoiding the WP cron. It could be a solution for me, while the problem is being solved with an update, because the button to force the archive operation at the troubleshooting section works fine without throwing errors.

    So my question is: How can I execute the archive operation from command line? There is any WP CLI command to control Matomo? Can any PHP be called directly from command line to launch the archive operation?

    Hi @fidoboy

    We don’t have WP CLI commands for archiving the data, but we have a console binary in the app folder which can run archiving from the command line:

    ./console core:archive

    Unfortunately, with the latest version of WP-Rocket the result remains in an error.

    You could try to add in your wp-config.php file the following content:

    
    if (!defined('MATOMO_SUPPORT_ASYNC_ARCHIVING')) {
        define('MATOMO_SUPPORT_ASYNC_ARCHIVING', false);
    }
    

    It will disable the cron archiving process: your data will be archived on the fly when requested in the Matomo page (Your pages will be longer to load).
    We do not recommend this approach if you have large traffic in your website.

    Kind regards

    Mat

    @mattmary thanks a lot for the tip. It could be useful. I’ll see if I can use it while a better solution arrives.

    regards,

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Archiving has not yet run successfully’ is closed to new replies.