getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.46k stars 1.4k forks source link

Server 500 error after upgrading from 0.9.2 to 0.9.3 #69

Closed gosdenj closed 9 years ago

gosdenj commented 9 years ago

What's the best way to upgrade from 0.9.2 to 0.9.3?

I originally tried to just copy / replace 0.9.3 over 0.9.2 and now my "working" 0.9.2 install no longer works (server 500 error).

Help?

gosdenj commented 9 years ago

I copied a back up of my site.yaml and system.yaml into /usr/config and now I get the following error:

Recoverable Error

Argument 1 passed to Grav\Plugin\ArchivesPlugin::onPageProcessed() must be an instance of Grav\Component\EventDispatcher\Event, instance of RocketTheme\Toolbox\Event\Event given

rhukster commented 9 years ago

I think you just need to upgrade your plugins. You can now use GPM:

bin/gpm update

You can read more about it here:

http://learn.getgrav.org/advanced/grav-gpm

rhukster commented 9 years ago

And regarding the best way to upgrade, you should upgrade with the 'upgrade' package that is linked in the downloads page:

https://github.com/getgrav/grav/releases/download/0.9.3/grav-update-v0.9.3.zip

This contains only the core of Grav whereas the regular package has a sample /user/ folder that would replace your content if you copied it over the top.

The good news is that from 0.9.3 onwards, you can upgrade with Grav's new package manager (GPM). Would be:

bin/gpm selfupgrade
gosdenj commented 9 years ago

Brilliant! thanks.

rhukster commented 9 years ago

Did this work out for you? Can we close this issue?

gosdenj commented 9 years ago

I've perform the update from 0.9.2 to 0.9.3 as per your advice and provided link for "grav-update-v0.9.3.zip" and proceeded to upgrade the plugins using the "gpm":

Here's the output:

$ bin/gpm index

Plugins [ 16 ]

  1. Archives [ archives ] v1.0.0 ➜ v1.0.2
  2. Assets [ assets ] [v1.0.2](not installed)
  3. Breadcrumbs [ breadcrumbs ] v1.0.0 ➜ v1.1.1
  4. Error [ error ] v1.0.0 ➜ v1.1.1
  5. Feed [ feed ] [v1.1.1](not installed)
  6. Highlight [ highlight ] [v1.0.2](not installed)
  7. Pagination [ pagination ] v1.1.1 ➜ v1.1.2
  8. Random [ random ] [v1.1.1](not installed)
  9. Sitemap [ sitemap ] v1.0.0 ➜ v1.1.1
  10. SimpleSearch [ simplesearch ] [v1.1.1](not installed)
  11. Taxonomy List [ taxonomylist ] v1.0.0 ➜ v1.1.1
  12. GitHub [ github ] [v1.0.2](not installed)
  13. Twig Cache [ twigcache ] [v1.0.2](not installed)
  14. Snipcart [ snipcart ] [v1.1.2](not installed)
  15. LightSlider [ lightslider ] v1.1.1 ➜ v1.1.2
  16. Problems [ problems ] v1.0.0 ➜ v1.1.2

Themes [ 3 ]

  1. Afterburner2 [ afterburner2 ] [v1.1.2](not installed)
  2. Antimatter [ antimatter ] v1.1.3 ➜ v1.1.4
  3. Bootstrap [ bootstrap ] [v1.1.2](not installed)

You can either get more informations about a package by typing: bin/gpm info

Or you can install a package by typing: bin/gpm install

$ bin/gpm update Found 10 extensions installed of which 9 need updating

  1. Archives [v1.0.0 ➜ v1.0.2]
  2. Breadcrumbs [v1.0.0 ➜ v1.1.1]
  3. Error [v1.0.0 ➜ v1.1.1]
  4. LightSlider [v1.1.1 ➜ v1.1.2]
  5. Pagination [v1.1.1 ➜ v1.1.2]
  6. Problems [v1.0.0 ➜ v1.1.2]
  7. Sitemap [v1.0.0 ➜ v1.1.1]
  8. Taxonomy List [v1.0.0 ➜ v1.1.1]
  9. Antimatter [v1.1.3 ➜ v1.1.4]

Continue with the update process? [Y|n] y

Preparing to install Archives [v1.0.0] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

Preparing to install Breadcrumbs [v1.0.0] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

Preparing to install Error [v1.0.0] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

Preparing to install LightSlider [v1.1.1] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

Preparing to install Pagination [v1.1.1] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

Preparing to install Problems [v1.0.0] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

Preparing to install Sitemap [v1.0.0] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

Preparing to install Taxonomy List [v1.0.0] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

Preparing to install Antimatter [v1.1.3] |- Downloading package... 100% |- Checking destination... ok |- Installing package... ok
'- Success!

All looked good, until I fired up the browser and found all images were returning 404 errors, not found. So I cleared the cache using:

bin/grav clear-cache

With the following output:

Clearing cache

Cleared: cache/compiled/ Cleared: cache/validated- Cleared: images/ Cleared: assets/

Touched: /user/config/system.yaml

And now the site doesn't load at all, reporting server error 500!

Not sure what to do now ....

gosdenj commented 9 years ago

OK, update.

I checked the /cache folder and it wasn't empty. So I cleared the folder using "rm -r ./cache/*" which seems to have done the job as the site now loads up OK including images.

So it appears bin/grav clear-cache didn't clear the cache folder correctly??

gosdenj commented 9 years ago

Looks like the /cache folder structure for to 0.9.3 is now completely different to 0.9.2, which may suggest why the "bin/grav clear-cache" command failed after the upgrade (the clue was in the output!!).

contents of /cache folder for 0.9.2:

drwxr-xr-x 3 4096 Sep 17 10:42 04 drwxr-xr-x 3 4096 Sep 17 10:35 20 drwxr-xr-x 3 4096 Sep 16 16:58 24 drwxr-xr-x 3 4096 Sep 16 16:07 30 drwxr-xr-x 3 4096 Sep 16 09:52 46 drwxr-xr-x 3 4096 Sep 16 09:52 48 drwxr-xr-x 3 4096 Sep 16 14:13 6a drwxr-xr-x 3 4096 Sep 16 14:13 71 drwxr-xr-x 3 4096 Sep 16 22:30 9e drwxr-xr-x 3 4096 Sep 16 09:52 a8 -rw-r--r-- 1 6915 Sep 24 14:01 config.php drwxr-xr-x 3 4096 Sep 16 11:16 e5 drwxr-xr-x 3 4096 Sep 16 14:13 ee -rw-r--r-- 1 0 Sep 24 14:01 validated-29800ebb

contents of /cache folder for 0.9.3:

drwxr-xr-x 5 4096 Oct 12 11:51 compiled -rw-r--r-- 1 0 Oct 12 11:51 validated-597a299f

Maybe worth adding this into the update / upgrade notes to clear the cache folder after upgrading from 0.9.2 to 0.9.3.

rhukster commented 9 years ago

Thanks for all the progress updates Jeff. Some insight into what you were seeing:

1) Yes we did restructure the cache a little bit, but the newer folder structure within the cache should be created on-the-fly if it doesn't exist. Strange that it was not for you. Something for us to double check.

2) the bin/grav clear-cache command deletes files in those new cache folders however there is a flag: bin/grav clear-cache --all that will delete all the folders too (we don't do this by default because we don't really want to clear the cached GPM data every cache clear)

3) Really glad that GPM seems to have worked fine and upgraded all your packages :)

4) We will definitely put the clear-cache step in the upgrade documentation, but I think we can also add it to the bin/gpm selfupgrade process so that it's automatically done after a Grav update via GPM (which should become the default going forward).

Thanks gain for the detailed steps you have gone through, this really helps us improve things in future releases.

rhukster commented 9 years ago

FYI, I have updated the update docs to be clearer and reflect new GPM update capabilities.