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 error in php8.1 running console config:get command #19225

Closed
chriscroome opened this issue May 16, 2022 · 1 comment · Fixed by #19143
Closed

Fix error in php8.1 running console config:get command #19225

chriscroome opened this issue May 16, 2022 · 1 comment · Fixed by #19143
Assignees
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@chriscroome
Copy link

When running Matomo with PHP 7.4 this command runs without an error:

php console --no-ansi -n config:get --section=General --key=force_ssl --format=text
General.force_ssl = 1

echo $?
0

With PHP 8.1 it returns the result, but it also returns errors messages and has a non-zero exit code:

php console --no-ansi -n config:get --section=General --key=force_ssl --format=text
WARNING [2022-05-16 12:37:20] 153951  /var/www/matomo/plugins/CoreAdminHome/Commands/ConfigGet.php(92): Deprecated - trim(): Passing null to parameter #1 ($string) of type string is deprecated - Matomo 4.10.0 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
General.force_ssl = 1
Error: error or warning logs detected, exit 1

echo $?
1

This breaks some Ansible code I have for managing Matomo sites, if the error messages went to standard error and only the result went to standard out that would make it easier to cope with.

@chriscroome chriscroome added the Potential Bug Something that might be a bug, but can't be reproduced (yet). label May 16, 2022
@justinvelluppillai
Copy link
Contributor

Thanks for the bug report. I can reproduce the error with your description.

@justinvelluppillai justinvelluppillai added Regression Indicates a feature used to work in a certain way but it no longer does even though it should. and removed Potential Bug Something that might be a bug, but can't be reproduced (yet). labels May 16, 2022
@justinvelluppillai justinvelluppillai added this to the 4.11.0 milestone May 16, 2022
@sgiehl sgiehl self-assigned this May 17, 2022
@sgiehl sgiehl linked a pull request May 17, 2022 that will close this issue
11 tasks
@sgiehl sgiehl closed this as completed May 17, 2022
@justinvelluppillai justinvelluppillai changed the title php console config:get generates an error with PHP 8.1 Fix error in php8.1 running console config:get command Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
3 participants