matomo-org / matomo-for-wordpress

Get a fully functioning Matomo Analytics for your WordPress. Star us on Github? +1. Matomo is the leading open alternative to Google Analytics that gives you full control over your data. Privacy is built-in. 100% data ownership, no one else can see your data. We love Pull Requests!
https://matomo.org
GNU General Public License v3.0
120 stars 25 forks source link

archiving issue with Matomo on raidboxes #808

Closed sbstn-nrdwnd closed 9 months ago

sbstn-nrdwnd commented 1 year ago

Hello,

I got an archiving issue on one of our Wordpress sites hosted by raidboxes. Already read through the troubleshoot site but still can not find any solution.

From the sys report following functions are marked as warning: shell_exec set_time_limit mail parse_ini_file glob gzopen md5_file

Manuell archiving is also not working. But Matomo is tracking at least something. I can see that in the debug.log:

[19-Jun-2023 22:04:24 UTC] Matomo: Add tracking code. Blog ID: 1
[19-Jun-2023 22:04:54 UTC] Matomo: Add tracking code. Blog ID: 1
[19-Jun-2023 22:19:25 UTC] Matomo: Add tracking code. Blog ID: 1
[19-Jun-2023 22:20:41 UTC] Matomo: Add tracking code. Blog ID: 1

here are some other lines from the log:

Stack trace:
#0 /home/wp/disk/wordpress/wp-content/plugins/matomo/app/core/CronArchive/SharedSiteIds.php(155): Piwik\CliMulti\Process->startProcess()
#1 /home/wp/disk/wordpress/wp-content/plugins/matomo/app/core/CronArchive/SharedSiteIds.php(60): Piwik\CronArchive\SharedSiteIds->runExclusive()
#2 /home/wp/disk/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php(1458): Piwik\CronArchive\SharedSiteIds->__construct()
#3 /home/wp/disk/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php(318): Piwik\CronArchive->makeWebsiteIdArchiveList()
#4 /home/wp/disk/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php(275): Piwik\CronArchive->init()
#5 /home/wp/disk/wordpress/wp-content/plugins/matomo/app/core/Access.php(670): Piwik\CronArchive->Piwik\{closure}()
#6 /home/wp/disk/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php(282): Piwik\Access::doAsSuperUser()
#7 /home/wp/disk/wordpress/wp-content/plugins/matomo/classes/WpMatomo/ScheduledTasks.php(332): Piwik\CronArchive->main()
#8 /home/wp/disk/wordpress/wp-includes/class-wp-hook.php(306): WpMatomo\ScheduledTasks->archive()
#9 /home/wp/disk/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#10 /home/wp/disk/wordpress/wp-includes/plugin.php(565): WP_Hook->do_action()
#11 /home/wp/disk/wordpress/wp-cron.php(188): do_action_ref_array()
#12 {main}
mattmary commented 1 year ago

Hello @sbstn-nrdwnd

Sorry to read that you encounter some issues with our plugin. Would you mind copying and pasting your system report available from the menu "Matomo Analytics > Diagnostics" ? Kind regards

Mat

sbstn-nrdwnd commented 1 year ago

Hey Mat

thanks for helping me. Here is the report:

# Matomo
* Matomo-Plugin-Version: 4.14.2
* Config existiert und ist schreibbar.: Ja ("$abs_path/wp-content/uploads/matomo/config/config.ini.php" )
* JS Tracker existiert und ist schreibbar.: Ja ("$abs_path/wp-content/uploads/matomo/matomo.js" )
* Plugin-Verzeichnisse: Yes ([{"pluginsPathAbsolute":"$abs_path\/wp-content\/plugins\/matomo\/plugins","webrootDirRelativeToMatomo":"..\/"}])
* Tmp-Verzeichnis schreibbar: Yes ($abs_path/wp-content/cache/matomo)
* Matomo-Version: 4.14.2
* Matomo Blog idSite: 1
* Installierte Matomo-Version: 4.14.2 (Install date: 2023-06-14 13:55:07)
* 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-Zeit: 2023-06-21 06:11:25
* Blog-Zeit: 2023-06-21 08:11:25 (Die nachfolgenden Daten werden in der Blog-Zeitzone angezeigt)
* Sync users & sites: Next run: 2023-06-21 13:57:02 (5 hours 45 min) ( Last started: 2023-06-20 14:05:02 (-18 hours 6 min). Last ended: 2023-06-20 14:05:02 (-18 hours 6 min). Interval: daily)
* Archive: Next run: 2023-06-21 08:55:25 (44 min 0s) ( Last started: 2023-06-21 08:00:01 (-11 min 24s). Last ended: Unbekannt. Interval: hourly)
* Update GeoIP DB: Next run: 2023-07-14 13:57:02 (23 days 5 hours) ( Last started: 2023-06-14 13:57:03 (-6 days 18 hours). Last ended: 2023-06-14 13:57:06 (-6 days 18 hours). Interval: matomo_monthly)

## Vorgeschriebene Prüfungen

* PHP version >= 7.2.5: 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 

## Optionale Prüfungen

* 64-bit PHP Binary: ok 
* Tracker status: ok 
* Memory limit: ok 
* Time zone: ok 
* Open URL: ok 
* GD > 2.x + FreeType (graphics): ok 
* Other extensions: ok 
* Warning Other functions: warning  (shell_exec It is recommended to turn on this PHP built-in function. <a href='https://matomo.org/faq/troubleshooting/how-to-make-the-diagnostic-managing-processes-via-cli-to-display-ok/' rel='noopener' target='_blank'>Read this to learn more.</a> set_time_limit mail parse_ini_file glob gzopen md5_file )
* Filesystem: ok 
* Database abilities: ok 
* Max Packet Size: ok 
* Geolocation: ok 
* Update over HTTPS: 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 URL: Yes ($site_url/wp-content/plugins/matomo/app/)

## Matomo Settings

* Track mode: default
* Track codeposition: footer
* Track api endpoint: default
* Track js endpoint: default
* Version history: 4.14.2
* Core version: 4.14.2
* Last tracking settings update: 1686743821
* Last settings update: 1686743821

## Logs

* Keine: 

# WordPress

* Home URL: $site_url
* Site URL: $site_url
* WordPress Version: 6.2.2
* Number of blogs: 1
* Multisite Enabled: No
* Network Enabled: No
* WP_DEBUG: No
* WP_DEBUG_DISPLAY: No
* WP_DEBUG_LOG: Yes
* DISABLE_WP_CRON: No
* FORCE_SSL_ADMIN: Yes
* WP_CACHE: Yes
* CONCATENATE_SCRIPTS: -
* COMPRESS_SCRIPTS: -
* COMPRESS_CSS: -
* ENFORCE_GZIP: -
* WP_LOCAL_DEV: -
* WP_CONTENT_URL: $site_url/wp-content
* WP_CONTENT_DIR: $abs_path/wp-content
* UPLOADS: -
* BLOGUPLOADDIR: -
* DIEONDBERROR: -
* WPLANG: -
* ALTERNATE_WP_CRON: -
* WP_CRON_LOCK_TIMEOUT: 60
* WP_DISABLE_FATAL_ERROR_HANDLER: -
* MATOMO_SUPPORT_ASYNC_ARCHIVING: -
* MATOMO_TRIGGER_BROWSER_ARCHIVING: Yes
* MATOMO_ENABLE_TAG_MANAGER: -
* MATOMO_SUPPRESS_DB_ERRORS: -
* MATOMO_ENABLE_AUTO_UPGRADE: -
* MATOMO_DEBUG: -
* MATOMO_SAFE_MODE: -
* MATOMO_GLOBAL_UPLOAD_DIR: -
* MATOMO_LOGIN_REDIRECT: -
* Permalink Structure: /%postname%
* Possibly uses symlink: No
* Upload base url: $site_url/wp-content/uploads
* Upload base dir: $abs_path/wp-content/uploads
* Upload url: $site_url/wp-content/uploads/2023/06
* Custom upload_path: wp-content/uploads
* Custom upload_url_path: 
* Compatible content directory: Yes

# WordPress Plugins

## MU Plugins

* 1&1 Product Subdomain: 1.1.0
* ManageWP - Worker Loader: 1.0.0

## Plugins

* Borlabs Cookie - Cookie Opt-in: 2.2.64
* Elementor: 3.14.0
* Elementor Pro: 3.14.0
* GTranslate: 3.0.3
* Imagify: 2.1.1
* ManageWP - Worker: 4.9.17 (Network enabled)
* Matomo Analytics - Ethical Stats. Powerful Insights.: 4.14.2
* SVG Support: 2.5.5
* WP Rocket: 3.13.3
* Yoast SEO: 20.9
* Active Plugins: 9 (worker borlabs-cookie elementor-pro elementor gtranslate imagify matomo svg-support $DB_NAME-seo)
* Theme: Divi (Divi)

# Server

* Server Info: nginx/1.24.0
* PHP OS: Linux
* PHP Version: 8.1.20
* PHP SAPI: fpm-fcgi
* PHP Binary Name: /usr/sbin/php-fpm8.1
* PHP Maxmind DB extension: Not loaded
* PHP Error Reporting:  After bootstrap: 4437
* Timezone: UTC
* WP timezone: Europe/Berlin
* Locale: de_DE
* User Locale: en_US
* 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: 0.system
* Time: 1687327885
* Max Execution Time: 300
* Max Post Size: 2000M
* Max Upload Size: 2097152000
* Max Input Vars: 10000
* Disabled PHP functions: Yes (pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,getmyuid,getmypid,passthru,leak,listen,diskfreespace,link,ignore_user_abord,shell_exec,dl,exec,system,highlight_file,source,show_source,fpaththru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,popen)
* zlib.output_compression is off: Yes
* Curl Version: 7.81.0, OpenSSL/3.0.2
* Suhosin installed: No

# Database

* MySQL Version: 10.11.4
* Mysqli Connect: Yes
* Force MySQL over Mysqli: No
* DB Prefix: wp_wjjelwmlxm_
* DB CHARSET: utf8
* DB COLLATE: 
* SHOW ERRORS: No
* SUPPRESS ERRORS: No
* Uses Socket: No
* Uses IPv6: No
* Matomo tables found: 48
* DB tables exist: Yes
* Matomo users found: 8
* Matomo sites found: 1
* Erforderliche Berechtigungen: OK

# Browser

* Browser:  (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.2 Safari/605.1.15)
* Language: de-de,de
mattmary commented 1 year ago

Hello @sbstn-nrdwnd

I can see that you have an installed imcompatible version of the wp-rocket plugin. https://matomo.org/faq/how-to-fix-the-wp-rocket-incompatible-plugin-warning/. Can you just confirm this plugin is really not activated?

Do you have any errors displayed while running the archive reports process from the Matomo Analytics > Diagnostics > Troubleshooting page? You may have to add

if (!defined('WP_DEBUG')) {
  define('WP_DEBUG', true);
}

In your wp-config.php file. Then, to ensure there will be something to archive in your reports, please:

If you have error displayed, please let me know.

Alternatively, you can also try to completely disable the async archiving process by adding in your wp-config.php the following content:

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

Does it allow you to get generated reports?

Kind regards

Mat

sbstn-nrdwnd commented 1 year ago

Hey Mat,

sorry for the late reply, before I came to answer this. Can you tell me if we would run Matomo on separate server could this help us preventing such errors and also is it possible then to use WPRocket?

sbstn-nrdwnd commented 1 year ago

Hey Mat,

I got following lines in debug mode when manuell achieving

[31-Jul-2023 10:52:01 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array\|string is deprecated in /home/wp/disk/wordpress/wp-includes/functions.php on line 2165
--
[31-Jul-2023 10:52:01 UTC] PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/wp/disk/wordpress/wp-includes/functions.php on line 7053
[31-Jul-2023 10:51:56 UTC] Matomo: Scheduled tasks archive data
[31-Jul-2023 10:51:53 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array\|string is deprecated in /home/wp/disk/wordpress/wp-includes/functions.php on line 2165
[31-Jul-2023 10:51:53 UTC] PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/wp/disk/wordpress/wp-includes/functions.php on line 7053

WPRocket ist fully deleted.

After adding your recommended code I got following lines:

[31-Jul-2023 10:56:01 UTC] PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/wp/disk/wordpress/wp-includes/formatting.php on line 4415
--
[31-Jul-2023 10:56:01 UTC] PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/wp/disk/wordpress/wp-includes/formatting.php on line 4415
[31-Jul-2023 10:56:01 UTC] PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/wp/disk/wordpress/wp-includes/formatting.php on line 4415
[31-Jul-2023 10:55:57 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array\|string is deprecated in /home/wp/disk/wordpress/wp-includes/functions.php on line 2165
[31-Jul-2023 10:55:57 UTC] PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/wp/disk/wordpress/wp-includes/functions.php on line 7053
[31-Jul-2023 10:55:44 UTC] Matomo: Scheduled tasks archive data
diosmosis commented 9 months ago

Hi @sbstn-nrdwnd, Matomo for WordPress 5 has increased plugin compatibility and can be run with WPRocket.

Since this is an old issue, I'm going to close it for now, but if are still experiencing issues (the same ones or new ones), feel free to comment and I'll re-open it.