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
Handle misconfigured config directory and file permissions #1415
Comments
Sorry, what problem is this a solution for? The exception is used to launch the installer. (See core/FrontController.php) |
the is_readable() is made after the attempt to read the config file. ... the file is read before knowing if you can read it. In my case, you couldn't (file doesn't exist), so an uncatched exception was thrown. |
Can you post a stacktrace for this code path? Normally, this is caught by core/FrontController, which then launches the installer. |
No, I cannot really do it, as I've fixed the code on my installation & I'm configured & I've desactivated XDebug as the site is now in production. But just try to remove your config file, you should reproduce the bug. And even without reproducing, just look at the "logic" behind the code: |
I see. The patch is wrong, but I'm testing a fix now. Thanks. |
(In [2290]) fixes #1415 - prettier error messages for misconfigurations tested all possible combinations:
|
Hi,
this time I have a solution. So, in the Piwik_Config::init() method, the is_readable($this->pathIniFileUserConfig) is made after the attempt to read the config file. I think the code should be swapped to look like this:
Also note that I've placed a die instead of throwing an exception. The exception was silent, and no error where displayed about the config not found.
And then, many critical error were occuring because the config was missing. So a die() statement looked like useful at this place as we don't want the excecution to continue.
The text was updated successfully, but these errors were encountered: