Matomo WordPress/Akeeba Backup/resources problem?


I’m using Matomo for the first time, and have installed it in a WordPress site on a project development server, set up so that it tracks me and the site owner – the two people who are working on this website. This is so that I can get a feel for how it works and the reports it generates.

All worked well for a week or two, until I noticed it had stopped showing data, both in the WP summary area and in the more detailed reports.

There, it said:

"Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again. If this error occurs repeatedly please contact your Matomo administrator for assistance."

I went through the steps on the troubleshooting page: and noticed that the cron job had stopped working a few days previously, on the same day that the Akeeba Backup plugin wasn’t able to complete a site backup.

Working through that troubleshooting page, I wasn’t able to activate manual archiving. Standard WP debugging didn’t give me any clues either, but I found this page: about browser archiving.

I enabled this, and Matomo > Summary showed me the following error:

"Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 262144 bytes) in on line 135.

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0"

Lines 133–135 of that Akeeba file say:

public function debug($message, array $content = [])
$this->debug($message, $context);

I disabled Akeeba Backup, and Matomo started working again. It was tracking visits, running the cron and showing reports.

When I reenabled/reinstalled it, Matomo stopped working again. And Akeeba also wasn’t able to make a backup. According to the progress report, it stopped when it got to the Matomo directory.

I then excluded the Matomo directory from the backups, and they now complete OK, although Matomo doesn’t work. It’s also not ideal that the Matomo info isn’t included in the backups.

At some point during all this a fatal WordPress error occurred. From the email it triggered:

"An error of type E_ERROR was caused in line 135 of the file XXX"

(the same line in the same Akeeba Backup file mentioned above.)

My guess is that there isn’t an incompatibility between Matomo and Akeeba Backup, but rather a lack of server resources that is impacting both of these plugins and/or how they interact with each other.

Somewhere along the line I also increased the PHP memory limit to 512MB.

What seems to be the actual problem here? Lack of disc space? Lack of database capacity? Lack of server memory?

Would installing the on-premises version of Matomo instead of the WP version make a difference? Or do I need to address disc space/database capacity/server memory first?

I’d really appreciate some expert input, as I’d love to get this working and ideally use Matomo on other projects. And sorry for the long post. I thought I’d better explain things as well as possible.

Thanks, Paul

Hi @Inselaeffchen thanks for this detailed report and all the effort you put into the investigation so far.

Would installing the on-premises version of Matomo instead of the WP version make a difference? Or do I need to address disc space/database capacity/server memory first?

It would definitely make a difference but then you would need to set up some backups for Matomo On-Premise etc as well which might cause some extra work.

From reading your message I would assume that memory is the problem and increasing it to 512 MB should have fixed it. I’m not sure if it did @Inselaeffchen ?

You might also want to go to the Matomo Analytics -> Diagnostics -> Troubleshooting page and click on Archive reports button. Does the archiving work then? If an error happens then it should print an error message afterwards. You could also check if for example the Matomo Analytics -> Summary page shows report data afterwards.

Hi @thomas_matomo, thanks for your reply. No, increasing the memory didn’t work, and neither does clicking the Archive reports button. I’ve just double-checked that now, but it’s the same as before: it just shows a grey screen.

Matomo only runs the cron jobs, tracks visits and shows visits in the summary and reporting area if Akeeba Backup is disabled. And Akeeba only makes backups if I exclude the Matomo directory from them.

Obviously I’ve googled to see if there any known problems between Matomo and Akeeba, but I seem to be the only person using this combination on WordPress :grinning:

I’ve got another project on the go, so maybe next week I could install Matomo there too, to see how it works with Akeeba there (on a better, faster host).

Any additional tips greatly appreciated. That’s a good point re needing extra backups if I install the standalone Matomo.

Thanks a lot, Paul

Thanks for the reply @Inselaeffchen

Do you mind sharing your system report see ? It should be anonymised automatically. I would then try to reproduce this here with a similar setup.

Thanks @thomas_matomo for taking the time and trouble to look into this. The system report is below. Hope this helps. Thanks and all the best, Paul

				  # Matomo

* Matomo Plugin Version: 4.2.0
* Config exists and is writable.: Yes ("$ABSPATH/wp-content/uploads/matomo/config/config.ini.php" )
* JS Tracker exists and is writable.: Yes ("$ABSPATH/wp-content/uploads/matomo/matomo.js" )
* Plugin directories: Yes ([{"pluginsPathAbsolute":"$ABSPATH\/wp-content\/plugins\/matomo\/plugins","webrootDirRelativeToMatomo":"..\/"}])
* Tmp directory writable: Yes ($ABSPATH/wp-content/cache/matomo)
* Matomo Version: 4.2.1
* Matomo Blog idSite: 1
* Matomo Install Version: 4.1.3 (Install date: 2021-02-25 09:11:20)
* Upgrades outstanding: No
* Upgrade in progress: No

## Endpoints

* Matomo JavaScript Tracker URL:  ($site_url/wp-content/uploads/matomo/matomo.js)
* Matomo JavaScript Tracker - WP Rest API:  ($site_url/wp-json/matomo/v1/hit/)
* Matomo HTTP Tracking API:  ($site_url/wp-content/plugins/matomo/app/matomo.php)
* Matomo HTTP Tracking API - WP Rest API:  ($site_url/wp-json/matomo/v1/hit/)

## Crons

* Server time: 2021-03-18 08:06:47
* Blog time: 2021-03-18 08:06:47 (Below dates are shown in blog timezone)
* Sync users & sites: Next run: 2021-03-18 09:11:19 (1 hours 4 min) ( Last started: 2021-03-17 10:40:29 (-21 hours 26 min). Last ended: 2021-03-17 10:40:29 (-21 hours 26 min). Interval: daily)
* Archive: Next run: 2021-03-18 08:11:19 (4 min 32s) ( Last started: 2021-03-18 08:05:40 (-1 min 7s). Last ended: 2021-03-16 19:11:25 (-1 days 12 hours). Interval: hourly)
* Update GeoIP DB: Next run: 2021-03-27 09:11:19 (9 days 1 hours) ( Last started: 2021-02-25 09:12:29 (-20 days 22 hours). Last ended: 2021-02-25 09:12:43 (-20 days 22 hours). Interval: matomo_monthly)

## Mandatory checks

* PHP version >= : ok 
* PDO extension: ok 
* PDO\MYSQL extension: ok 
* MYSQLI extension: ok 
* Other required extensions: ok 
* Required functions: ok 
* Required PHP configuration (php.ini): ok 
* Directories with write access: ok 
* Directories with write access for Tag Manager: ok 

## Optional checks

* Tracker status: ok 
* Memory limit: ok 
* Time zone: ok 
* Open URL: ok 
* PageSpeed disabled: ok 
* GD > 2.x + Freetype (graphics): ok 
* Other extensions: ok 
* Other functions: ok 
* Filesystem: ok 
* Warning Last Successful Archiving Completion: warning  (Archiving last ran successfully on Tuesday, March 16, 2021 19:11:25 which is 1 days 12:55:22 ago )
* Database abilities: ok 
* Max Packet Size: ok 
* Geolocation: ok 
* Update over HTTPS: ok 
* Writable JavaScript Tracker ("/matomo.js"): ok 
* Supports Async Archiving: No
* Location provider ID: geoip2php
* Location provider available: Yes
* Location provider working: Yes
* Had visit in last 5 days: Yes

## Matomo Settings

* Track mode: default
* Track codeposition: footer
* Track api endpoint: default
* Track js endpoint: default
* Version history: 4.2.0, 4.1.3
* Core version: 4.2.1
* Last tracking settings update: 1614268276
* Last settings update: 1614268276
* Track ecommerce: No
* Track search: Yes
* Track 404: Yes
* Disable cookies: Yes

## Logs

* None: 

# WordPress

* Home URL: $site_url
* Site URL: $site_url
* WordPress Version: 5.7
* Number of blogs: 1
* Multisite Enabled: No
* Network Enabled: No
* Permalink Structure: /%postname%/
* Possibly uses symlink: No
* Compatible content directory: Yes

# WordPress Plugins

* Akeeba Backup for WordPress: (Network enabled)
* Antispam Bee: 2.9.4
* Async JavaScript:
* Autoptimize: 2.8.1
* Complianz | GDPR/CCPA Cookie Consent: 4.9.10
* Conditional Widgets: 3
* Disable/Remove Google Fonts: 1.3.0
* Email Address Encoder: 1.0.22
* Lightbox for Gallery & Image Block: 1.6.0
* Limit Login Attempts Reloaded: 2.20.3
* LuckyWP Table of Contents: 2.1.4
* Matomo Analytics - Ethical Stats. Powerful Insights.: 4.2.0
* Max Mega Menu: 2.9.3
* Max Mega Menu - Pro Addon: 2.2.1
* Post Types Unlimited: 1.0.5
* Post Type Switcher: 3.2.0
* Real Media Library (Free): 4.13.2
* ReOrder Posts within Categories: 2.9.2
* Say What?: 1.9.7
* Shariff Wrapper: 4.6.5
* Slider Revolution: 6.3.4
* Statify: 1.8.2
* Statify – Extended Evaluation: 2.6.1
* Templatera: 2.0.4
* ThirstyAffiliates: 3.10.2
* Total Theme Core: 1.2.7
* User Profile Picture: 2.5.0
* WordPress Importer: 0.7
* WordPress Popular Posts: 5.2.4
* WPBakery Page Builder: 6.5.0
* WPForms Lite: 1.6.5
* WP Maintenance Mode: 2.3.0
* WPS Hide Login: 1.8.5
* WP Super Cache: 1.7.1
* Yoast Duplicate Post: 4.1.1
* Yoast SEO: 15.9.2
* Active Plugins: 35 (akeebabackupwp antispam-bee autoptimize conditional-widgets disable-remove-google-fonts duplicate-post email-address-encoder gallery-block-lightbox js_composer limit-login-attempts-reloaded luckywp-table-of-contents matomo megamenu-pro megamenu metronet-profile-picture post-type-switcher post-types-unlimited real-media-library-lite reorder-post-within-categories revslider say-what shariff templatera thirstyaffiliates total-theme-core total-theme-core total-theme-core total-theme-core wordpress-importer wordpress-popular-posts wordpress-seo wp-maintenance-mode wp-super-cache wpforms-lite wps-hide-login)
* Theme: Total (total-child-theme-211020)

# Server

* Server Info: Apache
* PHP OS: Linux
* PHP Version: 7.4.12
* PHP SAPI: cgi-fcgi
* PHP Binary Name: php-cgi
* PHP Error Reporting: 0 After bootstrap: 0
* PHP Found Binary: php -q
* Timezone: UTC
* WP timezone: Europe/London
* Locale: en_GB
* User Locale: en_GB
* Memory Limit: 512M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
* WP Memory Limit: 512M
* WP Max Memory Limit: 512M
* Timezone version: 2020.2
* Time: 1616054808
* Max Execution Time: 30
* Max Post Size: 128M
* Max Upload Size: 134217728
* Max Input Vars: 1000
* Disabled PHP functions: No
* zlib.output_compression is off: Yes
* Curl Version: 7.71.0, OpenSSL/1.1.1d
* Suhosin installed: No

# Database

* MySQL Version: 10.1.48
* Mysqli Connect: Yes
* Force MySQL over Mysqli: No
* DB Prefix: mx_
* DB CHARSET: utf8mb4
* Uses Socket: No
* Uses IPv6: No
* Matomo tables found: 62
* Matomo users found: 2
* Matomo sites found: 1
* Required permissions: OK

# Browser

* Browser:  (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15)
* Language: de-de


Thanks @Inselaeffchen

I was able to reproduce this and have prepared a fix in . In case you are familiar with PHP or patching files you could apply this patch to wp-content/plugins/matomo/plugins/WordPress/Logger.php .

Basically, there was an incompatibility with their plugin where they were using some similar naming but had a different implementation causing things to execute in a never ending loop. The patch should fix this and it should be included in our next release.

Thanks for reporting this!

Hi @thomas_matomo, that’s great, thanks a lot. I’ve patched the file, and Matomo is now working properly.

Thanks for your help, I really appreciate it. And I look forward to having Matomo working on the live site, and using it on some other projects. I’ll also leave you a review in the WordPress plugins directory :slight_smile:

Cheers, Paul

Thanks for this Paul and glad it’s working now :slight_smile: