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

Fix PHP8.2 Deprecation on utf8_encode #20115

Closed
StrangeRanger opened this issue Dec 16, 2022 · 1 comment
Closed

Fix PHP8.2 Deprecation on utf8_encode #20115

StrangeRanger opened this issue Dec 16, 2022 · 1 comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@StrangeRanger
Copy link

I'm unsure if this problem is best described as a bug, but after recently updating to matomo 4.13.0 and updating system packages on my Ubuntu instance/server, I've been receiving emails about a PHP Deprecation for a certain file used by matomo. I'll provide the full email content below:

Subject:
Cron <www-data@home> /usr/bin/php /var/www/analytics.randomserver.xyz/console core:archive --url=http://analytics.randomserver.xyz > /var/www/analytics.randomserver.xyz/matomo-archive.log

Body: 
PHP Deprecated: Function utf8_encode() is deprecated in /var/www/[analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php](http://analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php) on line 48 
ERROR [[2022-12-16 17:05:04](canary:event?ts=692931909.00)] 835835 Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2022-12-16&format=json&trigger=archivephp: 'PHP Deprecated: Function utf8_encode() is deprecated in /var/www/[analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php](http://analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php) on line 48 {"idarchives":[3346],"nb_visits":4}' 
ERROR [[2022-12-16 17:05:04](canary:event?ts=692931909.00)] 835835 Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2022-12-15&format=json&trigger=archivephp: 'PHP Deprecated: Function utf8_encode() is deprecated in /var/www/[analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php](http://analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php) on line 48 {"idarchives":[3207],"nb_visits":8}' 
ERROR [[2022-12-16 17:05:08](canary:event?ts=692931913.00)] 835835 Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=week&date=2022-12-12&format=json&trigger=archivephp: 'PHP Deprecated: Function utf8_encode() is deprecated in /var/www/[analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php](http://analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php) on line 48 {"idarchives":[3351],"nb_visits":35}' 
ERROR [[2022-12-16 17:05:11](canary:event?ts=692931916.00)] 835835 Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=month&date=2022-12-01&format=json&trigger=archivephp: 'PHP Deprecated: Function utf8_encode() is deprecated in /var/www/[analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php](http://analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php) on line 48 {"idarchives":[3356],"nb_visits":53}' 
ERROR [[2022-12-16 17:05:16](canary:event?ts=692931921.00)] 835835 Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=year&date=2022-01-01&format=json&trigger=archivephp: 'PHP Deprecated: Function utf8_encode() is deprecated in /var/www/[analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php](http://analytics.randomserver.xyz/vendor/szymach/c-pchart/constants.php) on line 48 {"idarchives":[34093],"nb_visits":1658}' 
ERROR [[2022-12-16 17:05:16](canary:event?ts=692931921.00)] 835835 5 total errors during this script execution, please investigate and try and fix these errors. 
ERROR [[2022-12-16 17:05:16](canary:event?ts=692931921.00)] 835835 Uncaught exception: /var/www/[analytics.randomserver.xyz/core/CronArchive.php](http://analytics.randomserver.xyz/core/CronArchive.php)(625): 5 total errors during this script execution, please investigate and try and fix these errors. [Query: , CLI mode: 1] 



[Exception] 
5 total errors during this script execution, please investigate and try and fix these errors. 



core:archive [--url="..."] [--skip-idsites[="..."]] [--skip-all-segments] [--force-idsites[="..."]] [--skip-segments-today] [--force-periods[="..."]] [--force-date-last-n[="..."]] [--force-date-range[="..."]] [--force-idsegments="..."] [--concurrent-requests-per-website[="..."]] [--concurrent-archivers[="..."]] [--max-websites-to-process="..."] [--max-archives-to-process="..."] [--disable-scheduled-tasks] [--accept-invalid-ssl-certificate] [--php-cli-options[="..."]] [--force-all-websites] [--force-report[="..."]]

Context

The issue in of itself, doesn't seem to be causing me any trouble. But the way I have my server set up, I'm being sent these emails every hour, so I thought I'd go ahead and make an issue for this potential problem.

Your Environment

  • Matomo Version: 4.13.0
  • PHP Version: 8.1.13
  • Server Operating System: Ubuntu 22.04
  • Additionally installed plugins:

Screenshot 2022-12-16 at 9 37 47 AM

Screenshot 2022-12-16 at 9 38 09 AM

@StrangeRanger StrangeRanger added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Dec 16, 2022
@sgiehl
Copy link
Member

sgiehl commented Dec 19, 2022

Hi @StrangeRanger. Thanks for reporting this. This exact error occurs in one of our dependencies. It has been updated in #20114 and it should be fixed with our next release.

@sgiehl sgiehl closed this as completed Dec 19, 2022
@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Dec 19, 2022
@sgiehl sgiehl added this to the 4.13.1 milestone Dec 19, 2022
@justinvelluppillai justinvelluppillai changed the title PHP Deprecated: Function utf8_encode() is deprecated Fix PHP8.2 Deprecation on utf8_encode Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants