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

Twig Filesystem: Warning - realpath(): open_basedir restriction in effect #12280

Closed
mrmonday opened this issue Nov 16, 2017 · 4 comments · Fixed by #12614
Closed

Twig Filesystem: Warning - realpath(): open_basedir restriction in effect #12280

mrmonday opened this issue Nov 16, 2017 · 4 comments · Fixed by #12614
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mrmonday
Copy link

When viewing:

https://siteurl/index.php?module=CoreHome&action=index&idSite=23&period=range&date=previous7&updated=1#?idSite=23&period=range&date=previous7&category=Dashboard_Dashboard&subcategory=1

I get the warning message:

WARNING: /var/www/siteurl/vendor/twig/twig/lib/Twig/Loader/Filesystem.php(35): Warning - realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/siteurl) - Piwik 3.2.0

Looking at where Twig_Loader_Filesystem is used, the $rootPath parameter is not passed to the constructor, so it falls back to the current working directory (which happens to be outside of the basedir for the PHP installation).

PHP Version: 7.0.19-1
Piwik Version: 3.2.0

I can provide more information if needed.

@sgiehl
Copy link
Member

sgiehl commented Nov 17, 2017

could you check if this changes fixes your problem:
https://github.com/piwik/piwik/compare/twigroot

@mattab
Copy link
Member

mattab commented Dec 3, 2017

Hi @mrmonday have you had a chance to test the patch from https://github.com/piwik/piwik/compare/twigroot and does it help remove the warning?

@sgiehl sgiehl added the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Dec 5, 2017
@mrmonday
Copy link
Author

mrmonday commented Dec 6, 2017

Unfortunately this issue happens sporadically (it only happened for certain sites/date ranges), and I cannot currently reproduce it.

If it happens again, I will try the patch.

@mrmonday
Copy link
Author

mrmonday commented Jan 15, 2018

This issue repeated after upgrading to 3.3.0. Applying the patch appears to have resolved the issue.

@tsteur tsteur added this to the 3.4.0 milestone Jan 15, 2018
@sgiehl sgiehl removed the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Mar 11, 2018
@sgiehl sgiehl self-assigned this Mar 11, 2018
@mattab mattab modified the milestones: 3.4.0, 3.3.1 Mar 19, 2018
@mattab mattab changed the title Twig Filesystem Warning Twig Filesystem: Warning - realpath(): open_basedir restriction in effect Mar 27, 2018
@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 27, 2018
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

Successfully merging a pull request may close this issue.

4 participants