Closed travisbotello closed 5 years ago
Sorry, I can't duplicate that problem.
I think I've found the problem: Advanced installation with custom config key
When using advanced installation the cache/logs
folder is not generated by MODx. Therefore the upgrademodx.log
can't be generated in there using fopen
. Instead the logs folder is generated like this when using advanced installation with custom config key:
core/cache/<custom_config_key>/logs
Good catch. 👍
I can't imagine what the point of that is, since if someone has access to your core directory, making it a tiny bit harder to find your logs isn't going to help much. ;)
I could check for that directory with MODX_CONFIG_KEY, but I'm inclined to just create a new /logs directory in the traditional location with this code at line 57 of the core/components/upgrademodx/processors/ugmprocessor.class.php file:
$logDir = $this->modxCorePath . 'cache/logs/';
$this->mmkDir($logDir);
$this->logFilePath = $logDir . 'upgrademodx.log';
That way everyone's UGM log will be in the same place. Could you try that code for me?
Great! Your fix is working for me!
I can't imagine what the point of that is, since if someone has access to your core directory, making it a tiny bit harder to find your logs isn't going to help much. ;)
I think this was introduced to run multiple MODx sites with one core. In that case it is very important to distinguish these different installations by using the unique config_key
in the cache path. Since I am not doing this I can't help to debug this scenario when using just one single UGM log...
Thanks. That makes sense. In fact my fix might cause confusion for people with multiple sites like that. I've been trying to find the code that writes the error log file for guidance, but still haven't located it.
Found it! Could you delete that bogus logs directory, then try replacing the code above with this:
$cm = $this->modx->getCacheManager();
$cachePath = $cm->getCachePath();
$logDir = $cachePath . 'logs/';
$this->mmkDir($logDir);
$this->logFilePath = $logDir . 'upgrademodx.log';
Perfect! It is working as expected and the log file is created in the correct directory.
Thanks for letting me know. 👍
When trying to upgrade I am receiving the following error:
When I create the logs folder manually it is working. I am not having any permission or owner issues on my Linode.
Running MODx 2.6.5 with ugm 2.1.0