-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Returning relative paths for validation.xml files #14411
Returning relative paths for validation.xml files #14411
Conversation
…g originally mistakenly changed method
In our multi node setup the same error occurred and for example prevented a successful checkout and customer registration. As the method /**
* Init cached list of validation files
*/
protected function _initializeConfigList()
{
if (!$this->_configFiles) {
$this->_configFiles = $this->moduleReader->getConfigurationFiles('validation.xml');
}
} @DanCarlyon what do you think? |
@david-fuehr Not sure if it's wise to bypass the caching 🤔 It's there for a reason. The patch in this PR works (Our production site has had it live now since March and no longer has the problem) I just need to sort the unit tests out. |
I think both versions do the job - but allow me some thoughts on this fix: I looked through your changes and think that the solution works good when the file names are stored in cache. It should save some execution time assembling the absolute path rather than searching the files in the module directories. Also, in each case - cached or not, the file contents are read and merged in every request (see method |
Hi @DanCarlyon Thank you |
Description
There is a bug in the
Magento\Framework\Validator
package which means that certain actions, for example saving a customer, will intermittently fail on multi-web server Magento environments which use different web roots per-web server but a single, shared cache instance. The bug is caused by Magento saving absolute paths to certain configuration files in the cache, as absolute paths will not be consistent between servers which have different web rootsWith this change we now save the relative paths to Validation.xml configuration files. We recently faced an issue on a multi server setup where the paths to Magento were different.
/var/www/vhosts/server1/httpdocs/
/var/www/vhosts/server2/httpdocs/
/var/www/vhosts/server3/httpdocs/
By saving the paths relative to the Magento root in the cache we can prepend the Magento root path to the url to return the absolute urls without changing any functionality, the only thing we are changing is what is saved in the cache.
Fixed Issues (if relevant)
N/A
Manual testing scenarios
Multi-server required with different web roots with a shared cache instance.
Contribution checklist