Upgrade... broke backend

I managed to break the backend of my site. The front looks great, and works great after the upgrade. I jumped from 1.6.31 to 1.7.7. I used
bin/gpm self-upgrade
The front end works, and no errors are logged! When I run bin/grav logviewer Only errors from before the upgrade show. I then ran a few other commands, cleared the cache etc. Now when I run: bin/gpm index I get nothing. When I visit my webpage/admin also, I get an error:

Server Error

Sorry, something went terribly wrong!

0 - RecursiveDirectoryIterator::__construct(): Argument #1 ($directory) cannot be empty

I do manage to get that error in the log too

2021-03-15 02:26:33 [CRITICAL] RecursiveDirectoryIterator::__construct(): Argument #1 ($directory) cannot be empty

Any help is greatly appreciated. Many of my gpm commands do nothing.

Yes, I did this on a live site. I can restore a back if needed.

What I would try, is download everything and run it locally and see if same error occurs. If it does (most likely it will), then get currently latest Admin and replace you got on local. If that won’t help, then download currently latest Grav and replace everything except /user folder.

Or try to debug and find the core issue :slight_smile:

1 Like

Thanks! My webserver is running php8, my local machine is not. When I downloaded the upgraded version, it ran fine on my local machine. So I downgraded the php on my server, and now all is good. Thanks for the help! Also, bin/gpm index is working.

Hmm… I think v1.7 should be compatible with PHP8 and run without issue :thinking:
Requirements page says:

PHP 7.3.6 or higher

Maybe some PHP setting is messing up things and this should to be fixed in Grav :confused:

Any chance you could compare php.ini files and enabled extensions maybe?

1 Like

Grav is compatible with v8, but that error can emanate from anywhere - not related to versions or configuration. Do you still have the full error stack?

If you can tell me where to find it, I probably can pull it up. I would be willing to pass it along.

PS - I bumped it back up to PHP8, and now everything seems to be running fine. I think when I upgraded Grav, the plugins didn’t upgrade. After dropping back down to PHP 7.4, I upgraded the plugins with the Admin GUI. I then switched PHP back to 8, and all is working like a charm now. So I think some of the errors were plugin related, not Grav 1.7.

1 Like

They might well have been. PHP errors would usually be in /logs/grav.log.

Here is the first log entry:
[2021-03-15 14:22:48] grav.CRITICAL: RecursiveDirectoryIterator::__construct(): Argument #1 ($directory) cannot be empty - Trace: #0 /home/username/webdirectory/user/plugins/presentation/classes/Utilities.php(65): RecursiveDirectoryIterator->__construct(’’, 4096) #1 /home/username/webdirectory/user/plugins/presentation/presentation.php(482): Grav\Plugin\PresentationPlugin\Utilities::filesFinder(’’, Array) #2 /home/username/webdirectory/system/src/Grav/Common/Data/Blueprint.php(445): Grav\Plugin\PresentationPlugin::getRevealThemes() #3 /home/username/webdirectory/system/src/Grav/Common/Data/Blueprint.php(178): Grav\Common\Data\Blueprint->dynamicData(Array, ‘options’, Array) #4 /home/username/webdirectory/system/src/Grav/Common/Data/Blueprints.php(111): Grav\Common\Data\Blueprint->init() #5 /home/username/webdirectory/system/src/Grav/Common/Data/Blueprints.php(50): Grav\Common\Data\Blueprints->loadFile(‘presentation/bl…’) #6 /home/username/webdirectory/system/src/Grav/Common/Plugins.php(244): Grav\Common\Data\Blueprints->get(‘presentation/bl…’) #7 /home/username/webdirectory/system/src/Grav/Common/Plugins.php(215): Grav\Common\Plugins::get(‘presentation’) #8 /home/username/webdirectory/system/src/Grav/Common/GPM/Local/Plugins.php(31): Grav\Common\Plugins::all() #9 /home/username/webdirectory/system/src/Grav/Common/GPM/Local/Packages.php(23): Grav\Common\GPM\Local\Plugins->__construct() #10 /home/username/webdirectory/system/src/Grav/Common/GPM/GPM.php(59): Grav\Common\GPM\Local\Packages->__construct() #11 /home/username/webdirectory/user/plugins/admin/classes/admin.php(893): Grav\Common\GPM\GPM->__construct() #12 /home/username/webdirectory/user/plugins/admin/classes/admin.php(921): Grav\Plugin\Admin\Admin->gpm() #13 /home/username/webdirectory/vendor/twig/twig/src/Template.php(700): Grav\Plugin\Admin\Admin->plugins() #14 /home/username/webdirectory/cache/twig/ab/abf1940d6c772ebfd23e1418ed6646eddd7f914928bff1b6ce6ef75125d51f3a.php(210): Twig\Template->getAttribute(Object(Grav\Plugin\Admin\Admin), ‘plugins’, Array) #15 /home/username/webdirectory/vendor/twig/twig/src/Template.php(453): __TwigTemplate_910dc5c5389734a39c71e9edf0ac0a67bc620136b757ae2cba4d7a7d092679de->doDisplay(Array, Array) #16 /home/username/webdirectory/vendor/twig/twig/src/Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array) #17 /home/username/webdirectory/cache/twig/dc/dc60a6063530a69fc064211d2eb92bbc55cc6e5b0c3cb3e9b67703532331208a.php(283): Twig\Template->display(Array) #18 /home/username/webdirectory/vendor/twig/twig/src/Template.php(214): __TwigTemplate_062b5d6189bcd6d88f5a6a15d08c326bab9e2897d07dcbcc6799e07989d04ae9->block_navigation(Array, Array) #19 /home/username/webdirectory/cache/twig/dc/dc60a6063530a69fc064211d2eb92bbc55cc6e5b0c3cb3e9b67703532331208a.php(247): Twig\Template->displayBlock(‘navigation’, Array, Array) #20 /home/username/webdirectory/vendor/twig/twig/src/Template.php(214): __TwigTemplate_062b5d6189bcd6d88f5a6a15d08c326bab9e2897d07dcbcc6799e07989d04ae9->block_page(Array, Array) #21 /home/username/webdirectory/cache/twig/dc/dc60a6063530a69fc064211d2eb92bbc55cc6e5b0c3cb3e9b67703532331208a.php(214): Twig\Template->displayBlock(‘page’, Array, Array) #22 /home/username/webdirectory/vendor/twig/twig/src/Template.php(214): __TwigTemplate_062b5d6189bcd6d88f5a6a15d08c326bab9e2897d07dcbcc6799e07989d04ae9->block_body(Array, Array) #23 /home/username/webdirectory/cache/twig/dc/dc60a6063530a69fc064211d2eb92bbc55cc6e5b0c3cb3e9b67703532331208a.php(67): Twig\Template->displayBlock(‘body’, Array, Array) #24 /home/username/webdirectory/vendor/twig/twig/src/Template.php(453): __TwigTemplate_062b5d6189bcd6d88f5a6a15d08c326bab9e2897d07dcbcc6799e07989d04ae9->doDisplay(Array, Array) #25 /home/username/webdirectory/vendor/twig/twig/src/Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array) #26 /home/username/webdirectory/cache/twig/7f/7f8a451a82835938b9f9e56338a43b1e50f0ef494c90958b044de55cc196b341.php(34): Twig\Template->display(Array, Array) #27 /home/username/webdirectory/vendor/twig/twig/src/Template.php(453): __TwigTemplate_b94d994b9cadc56716f79051f9ff230e210eff9244b1eaece2f93d42075210b4->doDisplay(Array, Array) #28 /home/username/webdirectory/vendor/twig/twig/src/Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array) #29 /home/username/webdirectory/cache/twig/a8/a8ad135125337528f4d479b9cb538b598075eb54575e6a8fdc15911744cc073d.php(43): Twig\Template->display(Array, Array) #30 /home/username/webdirectory/vendor/twig/twig/src/Template.php(453): __TwigTemplate_ed4894a83746fde98adbb6e72f6e8046d13831f278900ec9c7cbda30cb43e18e->doDisplay(Array, Array) #31 /home/username/webdirectory/vendor/twig/twig/src/Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array) #32 /home/username/webdirectory/vendor/twig/twig/src/Template.php(432): Twig\Template->display(Array) #33 /home/username/webdirectory/vendor/twig/twig/src/TemplateWrapper.php(47): Twig\Template->render(Array, Array) #34 /home/username/webdirectory/vendor/twig/twig/src/Environment.php(384): Twig\TemplateWrapper->render(Array) #35 /home/username/webdirectory/system/src/Grav/Common/Twig/Twig.php(403): Twig\Environment->render(‘dashboard.html…’, Array) #36 /home/username/webdirectory/system/src/Grav/Common/Service/OutputServiceProvider.php(36): Grav\Common\Twig\Twig->processSite(‘html’) #37 /home/username/webdirectory/vendor/pimple/pimple/src/Pimple/Container.php(118): Grav\Common\Service\OutputServiceProvider->Grav\Common\Service{closure}(Object(Grav\Common\Grav)) #38 /home/username/webdirectory/system/src/Grav/Common/Processors/RenderProcessor.php(39): Pimple\Container->offsetGet(‘output’) #39 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\RenderProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #40 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #41 /home/username/webdirectory/system/src/Grav/Common/Processors/DebuggerAssetsProcessor.php(38): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #42 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\DebuggerAssetsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #43 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #44 /home/username/webdirectory/system/src/Grav/Common/Processors/PagesProcessor.php(81): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #45 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\PagesProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #46 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #47 /home/username/webdirectory/system/src/Grav/Common/Processors/TwigProcessor.php(38): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #48 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\TwigProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #49 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #50 /home/username/webdirectory/system/src/Grav/Common/Processors/AssetsProcessor.php(39): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #51 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\AssetsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #52 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #53 /home/username/webdirectory/system/src/Grav/Common/Processors/SchedulerProcessor.php(40): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #54 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\SchedulerProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #55 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #56 /home/username/webdirectory/system/src/Grav/Common/Processors/BackupsProcessor.php(39): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #57 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\BackupsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #58 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #59 /home/username/webdirectory/system/src/Grav/Common/Processors/TasksProcessor.php(69): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #60 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\TasksProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #61 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #62 /home/username/webdirectory/user/plugins/admin/classes/Router.php(25): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #63 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Plugin\Admin\Router->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #64 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #65 /home/username/webdirectory/system/src/Grav/Common/Processors/RequestProcessor.php(63): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #66 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\RequestProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #67 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #68 /home/username/webdirectory/system/src/Grav/Common/Processors/ThemesProcessor.php(38): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #69 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\ThemesProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #70 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #71 /home/username/webdirectory/system/src/Grav/Common/Processors/PluginsProcessor.php(39): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #72 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\PluginsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #73 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #74 /home/username/webdirectory/system/src/Grav/Common/Processors/InitializeProcessor.php(129): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #75 /home/username/webdirectory/system/src/Grav/Common/Debugger.php(546): Grav\Common\Processors\InitializeProcessor::Grav\Common\Processors{closure}() #76 /home/username/webdirectory/system/src/Grav/Common/Processors/InitializeProcessor.php(130): Grav\Common\Debugger->profile(Object(Closure)) #77 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(50): Grav\Common\Processors\InitializeProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #78 /home/username/webdirectory/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #79 /home/username/webdirectory/system/src/Grav/Common/Grav.php(295): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #80 /home/username/webdirectory/index.php(58): Grav\Common\Grav->process() #81 {main} [] []

Whoo, it’s my fault! This comes from a method in the Presentation-plugin that loads up the available themes for Reveal.js. I’ll make a note to test it with the latest 1.7-version of Grav Core, and update as necessary. Thanks for the full error-stack, it makes it much easier to trace the source of the problem.

I’m not a dev, so glad I can at least help by posting errors! :slight_smile: Every little bit helps.