"Undefined index: error" when attempting to upgrade

DragonByte Tech

Well-known member
When attempting to upgrade from Beta 3 to Beta 4, this happens after clicking "Download and upgrade":

1598437337448.png

  • ErrorException: [E_NOTICE] Undefined index: error - src/XF/Service/Upgrade/Downloader.php:62
Code:
#0 src/XF/Service/Upgrade/Downloader.php(62): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/dbtech/pu...', 62, Array)
#1 src/XF/Admin/Controller/Tools.php(475): XF\Service\Upgrade\Downloader->download(2020034, 1598363106, NULL)
#2 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionUpgradeXf(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'UpgradeXf', Object(XF\Mvc\RouteMatch), Object(SV\XeroInvoiceSync\XF\Admin\Controller\Tools), NULL)
#4 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\XeroInvoiceSync\XF\Admin\Controller\Tools), NULL)
#5 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(2298): XF\Mvc\Dispatcher->run()
#7 src/XF.php(459): XF\App->run()
#8 admin.php(13): XF::runApp('XF\\Admin\\App')
#9 {main}

  • ErrorException: [E_NOTICE] Undefined index: error - src/XF/Service/Upgrade/Downloader.php:68
Code:
#0 src/XF/Service/Upgrade/Downloader.php(68): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/dbtech/pu...', 68, Array)
#1 src/XF/Admin/Controller/Tools.php(475): XF\Service\Upgrade\Downloader->download(2020034, 1598363106, NULL)
#2 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionUpgradeXf(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'UpgradeXf', Object(XF\Mvc\RouteMatch), Object(SV\XeroInvoiceSync\XF\Admin\Controller\Tools), NULL)
#4 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\XeroInvoiceSync\XF\Admin\Controller\Tools), NULL)
#5 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(2298): XF\Mvc\Dispatcher->run()
#7 src/XF.php(459): XF\App->run()
#8 admin.php(13): XF::runApp('XF\\Admin\\App')
#9 {main}
  • src/XF/Service/Upgrade/Downloader.php:68
 

DragonByte Tech

Well-known member
Modifying the relevant block of code like so:
PHP:
            $responseJson = \GuzzleHttp\json_decode(
                $e->getResponse()->getBody()->getContents(), true
            );
            \XF::dump($responseJson);
            die();
            if (is_array($responseJson['error']))
            {
                $error = reset($responseJson['error']);
            }
            else
            {
                $error = $responseJson['error'];
            }
shows:
1598437662222.png
 

DragonByte Tech

Well-known member
Might still be relevant as a bug, though, considering the issue where the code expects error as the index but the server will return errors :)

Or if your custom code is hardcoded to return error, then it should probably be updated to return errors as the index instead so that these kind of XF.com issues are handled gracefully.
 

Chris D

XenForo developer
Staff member
We updated PHP here this morning and unfortunately the new default PHP-FPM config automatically disabled shell_exec (we run shell commands directly to build a download package).
 
Last edited:
Top