Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical error in Wordpress - only for Matomo plugin #618

Closed
hookedbythatbook opened this issue Jun 14, 2022 · 25 comments
Closed

Critical error in Wordpress - only for Matomo plugin #618

hookedbythatbook opened this issue Jun 14, 2022 · 25 comments
Labels
Bug Something isn't working duplicate This issue or pull request already exists

Comments

@hookedbythatbook
Copy link

Hi,

I'm on Wordpress 6.0 and have been using Matomo for a few months now. I've had no issues with it until this morning. Some plugins have updated in the last few days, but I haven't added any new ones. Today I received the following message when I tried to look at the summary report on Wordpress:

There has been a critical error on this website. Please check your site admin email inbox for instructions.

All other plugins work perfectly fine.

Here is a copy of the system report:

			  # Matomo
  • Matomo Plugin Version: 4.10.0
  • Config exists and is writable.: Yes ("$abs_path/wp-content/uploads/matomo/config/config.ini.php" )
  • JS Tracker exists and is writable.: Yes ("$abs_path/wp-content/uploads/matomo/matomo.js" )
  • Plugin directories: Yes ([{"pluginsPathAbsolute":"$abs_path/wp-content/plugins/matomo/plugins","webrootDirRelativeToMatomo":"../"}])
  • Tmp directory writable: Yes ($abs_path/wp-content/cache/matomo)
  • Matomo Blog idSite: 1
  • Matomo Install Version: 4.6.0 (Install date: 2022-02-20 10:36:56)

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: 2022-06-14 23:07:23
  • Blog time: 2022-06-14 17:07:23 (Below dates are shown in blog timezone)
  • Sync users & sites: Next run: 2022-06-15 11:37:46 ( Last started: 2022-06-14 11:45:18. Last ended: 2022-06-13 11:45:29. Interval: daily)
  • Archive: Next run: 2022-06-14 17:46:57 ( Last started: 2022-06-14 16:49:07. Last ended: 2022-06-14 09:04:26. Interval: hourly)
  • Update GeoIP DB: Next run: 2022-06-20 11:37:42 ( Last started: 2022-05-21 12:16:35. Last ended: 2022-05-21 12:16:38. Interval: matomo_monthly)

Matomo Settings

  • Track mode: default
  • Track codeposition: footer
  • Track api endpoint: default
  • Track js endpoint: default
  • Version history: 4.10.0, 4.6.0
  • Core version: 4.10.0
  • Last tracking settings update: 1645379104
  • Last settings update: 1645379618
  • Track ecommerce: No
  • Track search: Yes
  • Track feed addcampaign: Yes

Logs

  • None:

WordPress

  • Home URL: $site_url
  • Site URL: $site_url
  • WordPress Version: 6.0
  • Number of blogs: 1
  • Multisite Enabled: No
  • Network Enabled: No
  • WP_DEBUG: No
  • WP_DEBUG_DISPLAY: Yes
  • WP_DEBUG_LOG: No
  • DISABLE_WP_CRON: -
  • FORCE_SSL_ADMIN: Yes
  • WP_CACHE: No
  • 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: 120
  • WP_DISABLE_FATAL_ERROR_HANDLER: -
  • MATOMO_SUPPORT_ASYNC_ARCHIVING: -
  • MATOMO_TRIGGER_BROWSER_ARCHIVING: -
  • MATOMO_ENABLE_TAG_MANAGER: -
  • MATOMO_SUPPRESS_DB_ERRORS: -
  • MATOMO_ENABLE_AUTO_UPGRADE: -
  • MATOMO_DEBUG: -
  • MATOMO_SAFE_MODE: Yes
  • 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/2022/06
  • Custom upload_path:
  • Custom upload_url_path:
  • Compatible content directory: Yes

WordPress Plugins

MU Plugins

  • Endurance Browser Cache: 0.4
  • Endurance Page Cache: 2.2
  • SSO: 0.3

Plugins

  • Antispam Bee: 2.11.0
  • Bluehost: 2.10.1
  • Breadcrumb NavXT: 7.0.2
  • Click to top: 1.2.18
  • Featured Images in RSS for Mailchimp & More: 1.5.9
  • Ivory Search: 5.4.6
  • Matomo Analytics - Ethical Stats. Powerful Insights.: 4.10.0
  • MC4WP: Mailchimp for WordPress: 4.8.7
  • PHP Compatibility Checker: 1.5.2
  • Shortcodes Ultimate: 5.12.0
  • Superb Gutenberg Blocks: 2.0.2
  • Superb Helper: 1.0.4
  • UpdraftPlus - Backup/Restore: 1.22.12
  • Wonder Grid Gallery Pro: 17.4C
  • Wordfence Security: 7.5.11 (Network enabled)
  • wpDiscuz: 7.3.18
  • WPForms Lite: 1.7.4.2
  • WP ULike: 4.6.2
  • Xblog Toolkit: 1.0.1
  • Yoast SEO: 19.1
  • Active Plugins: 20 (add-search-to-menu antispam-bee bluehost-wordpress-plugin breadcrumb-navxt click-to-top featured-images-for-rss-feeds mailchimp-for-wp matomo php-compatibility-checker shortcodes-ultimate superb-blocks superb-helper updraftplus wonderplugin-gridgallery wordfence wordpress-seo wp-ulike wpdiscuz wpforms-lite xblog-toolkit)
  • Theme: xblog-pro (xblog-pro)

Server

  • Server Info: Apache
  • PHP OS: Linux
  • PHP Version: 7.4.28
  • PHP SAPI: litespeed
  • PHP Binary Name: lsphp
  • PHP Error Reporting: 0 After bootstrap: 0
  • Timezone: UTC
  • WP timezone: America/Edmonton
  • Locale: en_US
  • User Locale: en_US
  • Memory Limit: 512M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
  • WP Memory Limit: 40M
  • WP Max Memory Limit: 512M
  • Timezone version: 0.system
  • Time: 1655248043
  • Max Execution Time: 60
  • Max Post Size: 516M
  • Max Upload Size: 536870912
  • Max Input Vars: 1000
  • Disabled PHP functions: No
  • zlib.output_compression is off: Yes
  • Curl Version: 7.81.0, OpenSSL/1.1.1n
  • Suhosin installed: No

Database

  • MySQL Version: 5.6.41
  • Mysqli Connect: Yes
  • Force MySQL over Mysqli: No
  • DB Prefix: 8LX
  • DB CHARSET: utf8
  • DB COLLATE:
  • SHOW ERRORS: No
  • SUPPRESS ERRORS: No
  • Uses Socket: No
  • Uses IPv6: No
  • Matomo tables found: 105
  • DB tables exist: Yes
  • Matomo users found: 1
  • Matomo sites found: 1
  • Required permissions: OK

Browser

  • Browser: (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36)
@mattmary
Copy link
Contributor

mattmary commented Jun 15, 2022

Hi @hookedbythatbook

did you received an email which could give us more information regarding your issue?
Do you have any details in the wordpress or php log files?

Kind regards

Mat

@mattmary mattmary added the Bug Something isn't working label Jun 15, 2022
@hookedbythatbook
Copy link
Author

Hi, yes I did. I'll have to go look for the log files. But here is the email:

Howdy!

Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, Matomo Analytics - Ethical Stats. Powerful Insights..

First, visit your website (https://hookedbythatbook.com/) and check for any visible issues. Next, visit the page where the error was caught (https://hookedbythatbook.com/wp-admin/admin.php?page=matomo-summary) and check for any visible issues.

Please contact your host for assistance with investigating this issue further.

If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.

To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.0
Active theme: X Blog Pro (version 1.2.9) Current plugin: Matomo Analytics - Ethical Stats. Powerful Insights. (version 4.10.0) PHP version 7.4.28

Error Details

An error of type E_COMPILE_ERROR was caused in line 210 of the file /home1/hookedb6/public_html/wp-content/plugins/matomo/app/vendor/php-di/php-di/src/Container.php. Error message: Declaration of DI\Container::has($name) must be compatible with Psr\Container\ContainerInterface::has(string $id): bool

@hookedbythatbook
Copy link
Author

Where do I find the wordpress or php log files?

@hookedbythatbook
Copy link
Author

I found this in an error log:

[14-Jun-2022 15:16:43 UTC] PHP Fatal error: Declaration of DI\Container::has($name) must be compatible with Psr\Container\ContainerInterface::has(string $id): bool in /home1/hookedb6/public_html/wp-content/plugins/matomo/app/vendor/php-di/php-di/src/Container.php on line 210

It was repeated several times. Well, I guess this is the same error that was mentioned in the email that I posted earlier.

@mattmary
Copy link
Contributor

Hi,

Thanks.
I'm not able to reproduce the problem but I'm not able to install all your plugins has you may have custom and paid plugins.
Which action leads to this error?
Kind regards

Mat

@hookedbythatbook
Copy link
Author

Only when I'm in the admin side of my wordpress page and I go down to the Matomo Analysis menu. If I click on Settings, for example, I see that error. And on most of the other options as well.

The rest of the site works fine with no issues.

@mattmary
Copy link
Contributor

duplicate of #596

@mattmary mattmary added the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Jun 15, 2022
@mattmary mattmary added this to the Current sprint milestone Jun 15, 2022
@hookedbythatbook
Copy link
Author

Hi, I looked at the other post with the same issue, and I don't have any of those plugins installed. Also, the Matomo plugin worked just fine with everything I have and I didn't add any new ones.

Is it possible for me, with this error, to save my Matomo data somehow and then try to reinstall the plugin? I would prefer not to lose anything already collected.

@mattmary
Copy link
Contributor

Hi,
You won't loose your data if your uninstall and reinstall the plugin. Just make sure you uncheck the checkbox "Delete all data on uninstall" in the Matomo Analytics > Settings > Advanced tab.
I thought initially it was related to a plugin conflict but my first tests let me think it's more a conflict in the matomo package management. I'm not able to reproduce it so far so I'm not quite sure why you get this error.
The issue has been added to the current milestone. So it will be fixed in the next release. I'll do my best to fix it asap.

@hookedbythatbook
Copy link
Author

Thanks so much! I can't access the Advanced Tab - I get the same critical error on that page. I can wait a bit.

@mattmary
Copy link
Contributor

Hi @hookedbythatbook

Would you mind execute this shell command on your server and copy paste the result?
find wp-content/plugins/ -type d -name php-di

Thanks in advance

Mat

@hookedbythatbook
Copy link
Author

Hi, I need some help executing that. I'm on a WordPress site hosted on Bluehost. Where do I go to run the command?

Thanks

@mattmary
Copy link
Contributor

mattmary commented Jun 16, 2022

Hi

do you have ssh access to your webserver?
If yes, run the following commands:
ssh %mywebsitehost%
cd %mywordpresspath%
find wp-content/plugins -type d -name php-di

if you don't have a ssh access, just run a search in your plugins directory for the name php-di.

I just want to know if you have more than one php-di folders in your plugin directory.

Kind regards

Mat

@hookedbythatbook
Copy link
Author

Hi, the search found two files:

/public_html/wp-content/plugins/matomo/app/vendor/php-di

/public_html/wp-content/plugins/matomo/app/vendor/php-di/php-di

@mattmary
Copy link
Contributor

Thank you

@mattmary
Copy link
Contributor

Hi @hookedbythatbook

Can you do the same thing for a different file?
find wp-content -type f -name ContainerInterface.php

Kind regards

Mat

@hookedbythatbook
Copy link
Author

Hi,

It found the following:

/public_html/wp-content/plugins/updraftplus/vendor/aws/aws-sdk-php/src/ResponseContainerInterface.php

/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/psr/container/src/ContainerInterface.php

/public_html/wp-content/plugins/wordpress-seo/vendor_prefixed/symfony/dependency-injection/ContainerInterface.php

/public_html/wp-content/plugins/wordpress-seo/vendor_prefixed/symfony/dependency-injection/ResettableContainerInterface.php

/public_html/wp-content/plugins/wordpress-seo/vendor_prefixed/psr/container/src/ContainerInterface.php

/public_html/wp-content/plugins/matomo/app/vendor/psr/container/src/ContainerInterface.php

Thank you so much!

@mattmary
Copy link
Contributor

Hi @hookedbythatbook

Thank you.
Would you mind post the content of this file
/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/psr/container/src/ContainerInterface.php please?
Kind regards

Mat

@hookedbythatbook
Copy link
Author

hookedbythatbook commented Jun 27, 2022

Hi, this is it:

" <?php

" namespace Psr\Container;

" use Throwable;

" /**
" * Base interface representing a generic exception in a container.
" */
" interface ContainerExceptionInterface extends Throwable
"{
"}

Thank you so much for all your effort and time. I truly appreciate it.

(I added a " at the start of each line, otherwise the code doesn't show in the message box.

@mattmary
Copy link
Contributor

Hi @hookedbythatbook

Thanks.
Are you sure this is the right content you pasted? I expect an interface called ContainerInterface, not ContainerExceptionInterface.

Kind regards

Mat

@hookedbythatbook
Copy link
Author

Oh, sorry, don't know what happened. Here it is:

' <?php

declare(strict_types=1);

namespace Psr\Container;

/**
' * Describes the interface of a container that exposes methods to read its entries.
/
interface ContainerInterface
{
/
*
* Finds an entry of the container by its identifier and returns it.
*
* @param string $id Identifier of the entry to look for.
*
* @throws NotFoundExceptionInterface No entry was found for this identifier.
* @throws ContainerExceptionInterface Error while retrieving the entry.
*
* @return mixed Entry.
*/
' public function get(string $id);

/**
 * Returns true if the container can return an entry for the given identifier.
 * Returns false otherwise.
 *
 * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
 * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
 *
 * @param string $id Identifier of the entry to look for.
 *
 * @return bool
 */
public function has(string $id): bool;

}

Thanks.

@mattmary
Copy link
Contributor

mattmary commented Jul 10, 2022

Hi @hookedbythatbook

Unfortunately we can't do anything for this issue: your have two two different versions of the ContainerInterface.php file (one comiing from your bluehost plugin, one in the matomo) which are incompatible in your version of PHP.
Your bluehost plugin is loaded before the matomo one, and so this is the bluehost version which is loaded.
We have an open issue to fix this problem, #233 but it's a huge refactoring of the plugin which is not schedule for now.
Until then, If you have the opportunity to remove this bluehost plugin it would solve this issue. Maybe downgrade your php version should solve your issue too.
Kind regards

Mat

@mattmary mattmary added the duplicate This issue or pull request already exists label Jul 10, 2022
@mattmary
Copy link
Contributor

duplicate of #233

@mattmary mattmary removed the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Jul 10, 2022
@hookedbythatbook
Copy link
Author

Hi, thank you so much. I'll see what I can do and let you know if anything changes.

@hookedbythatbook
Copy link
Author

Just thought I'd let you know that I ended up removing the Bluehost plugin and everything is working perfectly fine now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
3 participants