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

When running a console command, display PHP error messages on screen (even when display_errors=off) #14166

Closed
mattab opened this issue Mar 6, 2019 · 4 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@mattab
Copy link
Member

mattab commented Mar 6, 2019

In some cases, commands can take a long time to run (for example searchengines:import command).
By default in many PHP setups, PHP is configured with display_errors=off

Steps to reproduce

  • set PHP max execution time to eg. 2 seconds
  • Execute a long running console command.
  • Current behavior: the command may fail after X seconds (or if PHP CLI memory limit is exhausted), and user does not see any error or message on screen. The console just exits and it could easily look like the command worked.
  • Expected behavior: the console would display the PHP error message and be clear that console failed.

(Maybe it's possible to do this by overwriting the display_errors ini setting in all console commands?)

@mattab mattab added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Mar 6, 2019
@mattab mattab added this to the 3.11.0 milestone Mar 6, 2019
@mattab mattab added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Mar 6, 2019
@tsteur
Copy link
Member

tsteur commented Mar 6, 2019

This should not be done in all commands as sometimes we may parse the response of a console output and this would break things. It should only be possible to be enabled when a specific option is passed to it. eg like -vvv.

If it was a fatal error, then it could be potentially printed but we may or may not do this already.

Also maybe we can put this into the backlog?

@mattab
Copy link
Member Author

mattab commented Mar 20, 2019

This should not be done in all commands as sometimes we may parse the response of a console output and this would break things.

when there is a PHP fatal error, things are already broken (silently), so it wouldn't make it worse?

Also maybe we can put this into the backlog?

this change would be quite valuable in helping us support users/customers as sometimes things fail silently. It's not a big use case though so removing from milestone for now.

@mattab mattab removed this from the 3.12.0 milestone Mar 20, 2019
@simivar
Copy link
Contributor

simivar commented Mar 29, 2019

I feel like Verbosity Levels of Symfony/Console component should be followed. Meaning that by default you get verbosity set to NORMAL and outputting every useful message - success AND error. Then you can quiet those with -q, --quiet options or get more with -v, -vv, -vvv.

@mattab
Copy link
Member Author

mattab commented Dec 11, 2023

As it has been a few months since the last activity and we believe this is likely not an issue anymore, we will now close this. If that's not the case, please do feel free to either reopen this issue or open a new one. We will gladly take a look again!

@mattab mattab closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

4 participants