BobRay / UpgradeMODX

A dashboard widget that detects upgrades and (optionally) installs them from within the MODX Manager
https://bobsguides.com/upgrade-modx-package.html
22 stars 14 forks source link

Downloads error if the /core/cache/logs/error.log file is not found #59

Closed Ruslan-Aleev closed 5 years ago

Ruslan-Aleev commented 5 years ago

If the /core/cache/logs/error.log file is not found, a download error occurs - "[Download Files Processor] Error: Could not open .../core/cache/logs/error.log".

Often, developers from forums recommend clearing or deleting the /cache/ folder completely (when transferring a site to another hosting, for example), i.e. an error may occur again.

BobRay commented 5 years ago

I'm confused by this error. UGM does not write directly to the MODX error log. It calls $modx-log(), which does. AFAIK, MODX creates the error log (or opens it for appending) if it doesn't exist.

Also, the downloadFiles processor does not call $modx->log(). It only writes to the UGM log (which it opens for appending).

Are you sure this is the exact error you got, and where did you see it?

Can you give me the exact steps necessary to reproduce it?

Ruslan-Aleev commented 5 years ago

Preface :) I had a MODX 2.6.5. with modified folders (/manager/, /connectors/ and /core/). And the cache folder was completely empty.

Exact steps for error: 1) Install the UpgradeMODX 2.1.0 package, everything is installed 2) Removed the resource that creates UpgradeMODX in the tree. By the way, can you create a pre-installation setting so that you can choose to create a resource for updating or not? 3) In the widget, clicked the "Begin Upgrade" button and the download started, after a couple of seconds, this error occurred at the download animation place - "[Download Files Processor] Error: Could not open ... /core/cache/logs/error.log" 4) I reset the cache everywhere, and in MODX and in the browser, I pressed the button again - the error appeared again. I did this several times - there was no result. 5) I created an empty error.log file in /core/cache/logs/ and again clicked "Begin Upgrade" - now everything went without errors, and MODX updated.

BobRay commented 5 years ago

Thanks, that's really helpful. One question: Did you delete the cache directory itself, or just the files in it?

Ruslan-Aleev commented 5 years ago

I am glad to help. Only files.

BobRay commented 5 years ago

Thanks, I could not duplicate this issue, but I added code to the new version that makes sure the error log file exists.

Ruslan-Aleev commented 5 years ago

Thank, I'll test it sometime and let you know.