matomo-org / plugin-Migration

Migrate a Matomo Measurable (website, app, roll-up, ...) from one Matomo instance to another Matomo
5 stars 11 forks source link

Fatal Error Fatal error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record) must be compatible with Monolog #42

Closed sebastienserre closed 2 years ago

sebastienserre commented 2 years ago

Hello, I'm trying to export measurable from WordPress plugin to on-premise but have this Fatale error:

[26-Sep-2022 13:57:08 UTC] PHP Fatal error:  Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record) must be compatible with Monolog\Handler\AbstractProcessingHandler::handle(array $record): bool in /XXXX/wp-content/plugins/matomo/app/vendor/symfony/monolog-bridge/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php on line 88
`
### wp-core ###

version: 6.0.2
site_language: fr_FR
user_language: en_US
timezone: Europe/Paris
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: closed
environment_type: production
user_count: 6
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /home/fpfm2068/ndbm
wordpress_size: loading...
uploads_path: /home/fpfm2068/ndbm/wp-content/uploads
uploads_size: loading...
themes_path: /home/fpfm2068/ndbm/wp-content/themes
themes_size: loading...
plugins_path: /home/fpfm2068/ndbm/wp-content/plugins
plugins_size: loading...
database_size: loading...
total_size: loading...

### wp-dropins (2) ###

advanced-cache.php: true
object-cache.php: true

### wp-active-theme ###

name: ND Blancs Manteaux (nd-blancs-manteaux)
version: 1.0.0
author: Sébastien SERRE
author_website: http://thivinfo.com/
parent_theme: Accelerate (accelerate)
theme_features: core-block-patterns, widgets-block-editor, wp-block-styles, align-wide, custom-line-height, editor-style, responsive-embeds, custom-spacing, automatic-feed-links, post-thumbnails, title-tag, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, menus, custom-background, post-formats, html5, custom-logo, customize-selective-refresh-widgets, custom-header, widgets
theme_path: /home/fpfm2068/ndbm/wp-content/themes/nd-blancs-manteaux
auto_update: Disabled

### wp-parent-theme ###

name: Accelerate (accelerate)
version: 1.5.0
author: ThemeGrill
author_website: https://themegrill.com
theme_path: /home/fpfm2068/ndbm/wp-content/themes/accelerate
auto_update: Disabled

### wp-mu-plugins (3) ###

MU Plugins Loader: version: 1.0.0, author: Sébastien SERRE
WP Umbrella: version: 1.0.0, author: WP Umbrella
_WPHealthHandlerMU.php: author: (undefined), version: (undefined)

### wp-plugins-active (27) ###

Advanced Editor Tools (previously TinyMCE Advanced): version: 5.6.0, author: Automattic, Auto-updates enabled
Complianz | GDPR/CCPA Cookie Consent: version: 6.3.3, author: Really Simple Plugins, Auto-updates enabled
Contact Form 7: version: 5.6.3, author: Takayuki Miyoshi, Auto-updates enabled
Date Time Picker for Contact Form 7: version: 1.1.0, author: Ruhul Amin, Auto-updates disabled
Easy WP SMTP: version: 1.4.7, author: wpecommerce, alexanderfoxc, Auto-updates disabled
Email Address Encoder: version: 1.0.22, author: Till Krüss, Auto-updates enabled
Events Manager: version: 6.1.2.1, author: Marcus Sykes, Auto-updates enabled
Flamingo: version: 2.3, author: Takayuki Miyoshi, Auto-updates enabled
hCaptcha for Forms and More: version: 1.19.0, author: hCaptcha, Auto-updates enabled
Honeypot for Contact Form 7: version: 2.1.1, author: Nocean, Auto-updates enabled
iThemes Security: version: 8.1.2, author: iThemes, Auto-updates enabled
Matomo Analytics - Ethical Stats. Powerful Insights.: version: 4.11.0, author: Matomo, Auto-updates enabled
Migration (Matomo Plugin): version: 4.0.2, author: Matomo, Auto-updates disabled
Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue: version: 3.1.50, author: Sendinblue, Auto-updates enabled
o2switch - WpTiger: author: (undefined), version: 28-02-22, Auto-updates disabled
OSM: version: 6.0, author: MiKa, Auto-updates enabled
Photo Gallery: version: 1.7.4, author: Photo Gallery Team, Auto-updates enabled
Really Simple CAPTCHA: version: 2.1, author: Takayuki Miyoshi, Auto-updates enabled
Redirection: version: 5.3.4, author: John Godley, Auto-updates enabled
Redis Object Cache: version: 2.2.0, author: Till Krüss, Auto-updates disabled
Regenerate Thumbnails: version: 3.1.5, author: Alex Mills (Viper007Bond), Auto-updates enabled
Responsive Lightbox & Gallery: version: 2.4.1, author: dFactory, Auto-updates enabled
SEOPress: version: 5.9.0.4, author: The SEO Guys at SEOPress, Auto-updates enabled
SEOPress PRO: version: 5.9.0.1, author: The SEO Guys at SEOPress, Auto-updates enabled
WP Crontrol: version: 1.14.0, author: John Blackbourn & crontributors, Auto-updates disabled
WP Rocket: version: 3.12.1, author: WP Media, Auto-updates disabled
WP Umbrella: version: 2.3.0, author: WP Umbrella - Backup & Manage WordPress, Auto-updates disabled

### wp-plugins-inactive (1) ###

Post SMTP: version: 2.1.9, author: Post SMTP, Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_GD
imagick_module_version: Not available
imagemagick_version: Not available
imagick_version: Not available
file_uploads: File uploads is turned off
post_max_size: 8M
upload_max_filesize: 2M
max_effective_size: 2 MB
max_file_uploads: 20
gd_version: 2.2.5
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.25

### wp-server ###

server_architecture: Linux 4.18.0-348.7.1.lve.el7h.x86_64 x86_64
httpd_software: Apache
php_version: 8.0.23 64bit
php_sapi: litespeed
max_input_variables: 1000
time_limit: 30
memory_limit: 2048M
max_input_time: 60
upload_max_filesize: 2M
php_post_max_size: 8M
curl_version: 7.71.0 OpenSSL/1.1.1p
suhosin: false
imagick_availability: false
pretty_permalinks: true
htaccess_extra_rules: true

### wp-database ###

extension: mysqli
server_version: 10.5.17-MariaDB
client_version: mysqlnd 8.0.23
max_allowed_packet: 268435456
max_connections: 500

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/fpfm2068/ndbm/wp-content
WP_PLUGIN_DIR: /home/fpfm2068/ndbm/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 2048M
WP_DEBUG: true
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: true
SCRIPT_DEBUG: false
WP_CACHE: true
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
DB_CHARSET: utf8
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable
snake14 commented 2 years ago

Hi @sebastienserre . Thank you for taking the time to create this issue. Have any of the Composer libraries been upgraded on your server? Matomo's composer.json file specifies "monolog/monolog": "~1.11" and "symfony/monolog-bridge": "~2.6.0" for the two libraries mentioned in your error message. It appears that monolog/monolog added the bool return type to the AbstractProcessingHandler::handle function in version 2.0.0 and symfony/monolog-bridge didn't add support for Monolog 2 until version 5.0.0. You can try upgrading symfony/monolog-bridge to at least version 5.0.0, but I wouldn't recommend that as Matomo only supports up to version 2.6.13 at the moment. It would probably be easiest to downgrade monolog/monolog to version 1.27.1.

As this is a library conflict and not a Matomo code problem, I'm going to close this issue, but please feel free to reach out if you feel this issue needs to be reopened.

sebastienserre commented 2 years ago

Hi @snake14,

I'm using the WordPress plugin, I've never used Symfony, If Matomo Plugin needs it then it has to work... without any further action ... or describe what I need to do. (I'm on a shared hosting)

Regards

snake14 commented 2 years ago

@sebastienserre I apologise for the inconvenience. I'm not familiar with the WordPress plugin. @mattmary Do you know what might be causing the library mismatch with WordPress or how it might be addressed?

mattmary commented 2 years ago

Hello @sebastienserre

It looks like you have a conflict between the Monolog version embed in Matomo and the one embed in one of your others plugins. We already have identified some of them. Do you use one of them? https://matomo.org/faq/wordpress/which-plugins-is-matomo-for-wordpress-known-to-be-not-compatible-with/

If not, would you mind try to disable one by one our plugins and check when this issue disappears?

Unfortunately, we don't have a lot of solution so far with Matomo 4: either disable this plugin, or, if it is required, we would ask you to switch to Matomo on premise. This problem should be fixed in the next major Matomo release, which should be released soon. We are working on it!

Kind regards

Mat

sebastienserre commented 2 years ago

Hello @mattmary

Do you know which version /release number will upgrade Monolog version in Matomo WordPress plugin ?

Thank you

mattmary commented 2 years ago

Hello @sebastienserre

We do not plan to upgrade the Monolog version to embed with Matomo for the reason that it could also create problems with plugins which embed the Monolog version 1. We are looking for a solution which will allow having a dedicated version of Monolog not in conflict with the others installed versions. This is scheduled in the Matomo 5.0 release. The issue is here https://github.com/matomo-org/matomo/issues/16905

We'll release the 4.12.0 version probably next week. Then, the following release will be the 5.0 version.

Kind regards

Mat