ualibraries / Guide-on-the-Side

The University of Arizona Libraries will no longer provide support for Guide on the Side. The code will remain openly available; however, UAL can no longer provide code fixes or upgrades.
https://ualibraries.github.io/Guide-on-the-Side/about.html
Other
66 stars 48 forks source link

Issue with CakePHP cache during upgrade to 1.0beta4 #157

Closed clintbellanger closed 7 years ago

clintbellanger commented 7 years ago

I'm following the UPGRADE.md steps to take our install from 1.0beta3 to 4.

I completed step 14 (Test to make sure everything still works in the new version) by loading the new install in a web browser. At this point the new install is in a folder called gots_beta4. Everything looks working at a glance.

I'm ready to do step 15 (Archive the old version and move the new version to take its place.) and I plan to do this by renaming folders:

gots/ becomes gots_beta3/ gots_beta4/ becomes gots/

Now I test the new install at its final location (gots/), and there is a 500 server error. Live in production(!!)

I revert the names, and the new install is working again at gots_beta4/

The PHP logs showed that PHP pages from gots/ were trying to include PHP files located at gots_beta4/. Sample:

Jan 10 14:53:27 apache2: PHP Warning:  include(/var/www/gots_beta4/lib/Cake/Error/ErrorHandler.php): failed to open stream: No such file or directory in /var/www/gots/lib/Cake/Core/App.php on line 547
Jan 10 14:53:27 apache2: PHP Fatal error:  Class 'ErrorHandler' not found in /var/www/gots/lib/Cake/Core/App.php on line 918

This appears to have been a caching issue, as that old folder name was all over the file app/tmp/cache/persistent/myapp_cake_core_file_map. This cache created by testing in step 14 caused an invisible failure in step 15?

I cleared the cache manually by emptying the contents of the models, persistent, and views folders.

Then, without triggering another pageload/cache, I renamed the folders. The new install now works.

Could the UPGRADE.md steps use some kind of clear cache step/warning? Thanks!

simpsonw commented 7 years ago

That's a good point, @clintbellanger! CakePHP caching can be very stubborn and I think it would definitely make sense to add a warning (or possibly an optional step in the upgrade process) advising users about this. I just want to clarify something so I can make sure I understand which steps you took:

  1. You moved the beta4 release to the production directory, gots/
  2. You got a 500 error, so you moved the beta4 release back to its original location.
  3. You deleted the cache folders
  4. You moved the beta4 release back to the production directory, gots/
  5. You reloaded the application in your browser and it worked.

Is that correct?

clintbellanger commented 7 years ago

@simpsonw Yes, those steps are correct. Thanks for looking at this!