0

Can't access Magento 2.2.1 admin, Stores > Configuration, anyone have this error before? How I can fix this.

Thank you

1 exception(s):
Exception #0 (Exception): Notice: Undefined offset: 2 in /home/public_html/app/code/Apptrian/ImageOptimizer/Helper/Data.php on line 724

Exception #0 (Exception): Notice: Undefined offset: 2 in /home/public_html/app/code/Apptrian/ImageOptimizer/Helper/Data.php on line 724
#0 /home/public_html/app/code/Apptrian/ImageOptimizer/Helper/Data.php(724): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined offse...', '/home/...', 724, Array)
#1 /home/public_html/app/code/Apptrian/ImageOptimizer/Helper/Data.php(665): Apptrian\ImageOptimizer\Helper\Data->loadIndex()
#2 /home/public_html/app/code/Apptrian/ImageOptimizer/Block/Adminhtml/Stats.php(47): Apptrian\ImageOptimizer\Helper\Data->getFileCount()
#3 /home/public_html/vendor/magento/module-config/Block/System/Config/Form/Field.php(73): Apptrian\ImageOptimizer\Block\Adminhtml\Stats->_getElementHtml(NULL)
#4 /home/public_html/vendor/magento/module-config/Block/System/Config/Form/Field.php(52): Magento\Config\Block\System\Config\Form\Field->_renderValue(Object(Magento\Framework\Data\Form\Element\Button))
#5 /home/public_html/vendor/magento/framework/Data/Form/Element/AbstractElement.php(454): Magento\Config\Block\System\Config\Form\Field->render(Object(Magento\Framework\Data\Form\Element\Button))
#6 /home/public_html/vendor/magento/framework/Data/Form/Element/AbstractElement.php(468): Magento\Framework\Data\Form\Element\AbstractElement->getHtml()
#7 /home/public_html/vendor/magento/module-config/Block/System/Config/Form/Fieldset.php(86): Magento\Framework\Data\Form\Element\AbstractElement->toHtml()
#8 /home/public_html/vendor/magento/module-config/Block/System/Config/Form/Fieldset.php(66): Magento\Config\Block\System\Config\Form\Fieldset->_getChildrenElementsHtml(Object(Magento\Framework\Data\Form\Element\Fieldset))
#9 /home/public_html/vendor/magento/framework/Data/Form/Element/AbstractElement.php(454): Magento\Config\Block\System\Config\Form\Fieldset->render(Object(Magento\Framework\Data\Form\Element\Fieldset))
#10 /home/public_html/vendor/magento/framework/Data/Form/Element/AbstractElement.php(468): Magento\Framework\Data\Form\Element\AbstractElement->getHtml()
#11 /home/public_html/vendor/magento/framework/Data/Form.php(325): Magento\Framework\Data\Form\Element\AbstractElement->toHtml()
#12 /home/public_html/vendor/magento/framework/Data/Form.php(340): Magento\Framework\Data\Form->toHtml()
#13 /home/public_html/vendor/magento/module-backend/Block/Widget/Form.php(101): Magento\Framework\Data\Form->getHtml()
#14 /home/public_html/vendor/magento/module-backend/view/adminhtml/templates/widget/form.phtml(15): Magento\Backend\Block\Widget\Form->getFormHtml()
#15 /home/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/home/...')
#16 /home/public_html/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Config\Block\System\Config\Form), '/home/...', Array)
#17 /home/public_html/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/home/...')
#18 /home/public_html/vendor/magento/module-backend/Block/Template.php(124): Magento\Framework\View\Element\Template->_toHtml()
#19 /home/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(667): Magento\Backend\Block\Template->_toHtml()
#20 /home/public_html/vendor/magento/framework/View/Layout.php(558): Magento\Framework\View\Element\AbstractBlock->toHtml()
#21 /home/public_html/vendor/magento/framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('system\\config\\f...')
#22 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('system\\config\\f...')
#23 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('system\\config\\f...')
#24 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('system\\config\\f...', true)
#25 /home/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(507): Magento\Framework\View\Layout\Interceptor->renderElement('system\\config\\f...', true)
#26 /home/public_html/generated/code/Magento/Config/Block/System/Config/Edit/Interceptor.php(479): Magento\Framework\View\Element\AbstractBlock->getChildHtml('form', true)
#27 /home/public_html/vendor/magento/module-config/view/adminhtml/templates/system/config/edit.phtml(22): Magento\Config\Block\System\Config\Edit\Interceptor->getChildHtml('form')
#28 /home/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/home/...')
#29 /home/public_html/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Config\Block\System\Config\Edit\Interceptor), '/home/...', Array)
#30 /home/public_html/generated/code/Magento/Config/Block/System/Config/Edit/Interceptor.php(245): Magento\Framework\View\Element\Template->fetchView('/home/...')
#31 /home/public_html/vendor/magento/framework/View/Element/Template.php(300): Magento\Config\Block\System\Config\Edit\Interceptor->fetchView('/home/...')
#32 /home/public_html/vendor/magento/module-backend/Block/Template.php(124): Magento\Framework\View\Element\Template->_toHtml()
#33 /home/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(667): Magento\Backend\Block\Template->_toHtml()
#34 /home/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Element\AbstractBlock->toHtml()
#35 /home/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Config\Block\System\Config\Edit\Interceptor->___callParent('toHtml', Array)
#36 /home/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Config\Block\System\Config\Edit\Interceptor->Magento\Framework\Interception\{closure}()
#37 /home/public_html/generated/code/Magento/Config/Block/System/Config/Edit/Interceptor.php(572): Magento\Config\Block\System\Config\Edit\Interceptor->___callPlugins('toHtml', Array, Array)
#38 /home/public_html/vendor/magento/framework/View/Layout.php(558): Magento\Config\Block\System\Config\Edit\Interceptor->toHtml()
#39 /home/public_html/vendor/magento/framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('system.config.e...')
#40 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('system.config.e...')
#41 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('system.config.e...')
#42 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('system.config.e...', true)
#43 /home/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('system.config.e...')
#44 /home/public_html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('content')
#45 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('content')
#46 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content')
#47 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('content', true)
#48 /home/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('content')
#49 /home/public_html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('admin.scope.col...')
#50 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('admin.scope.col...')
#51 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('admin.scope.col...')
#52 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('admin.scope.col...', true)
#53 /home/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('admin.scope.col...')
#54 /home/public_html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('main.col')
#55 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('main.col')
#56 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.col')
#57 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('main.col', true)
#58 /home/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('main.col')
#59 /home/public_html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.main.conta...')
#60 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.main.conta...')
#61 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.main.conta...')
#62 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.main.conta...', true)
#63 /home/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('page.main.conta...')
#64 /home/public_html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.content')
#65 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.content')
#66 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.content')
#67 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.content', true)
#68 /home/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('page.content')
#69 /home/public_html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.wrapper')
#70 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#71 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper')
#72 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.wrapper', true)
#73 /home/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper')
#74 /home/public_html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('backend.page')
#75 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('backend.page')
#76 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('backend.page')
#77 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('backend.page', true)
#78 /home/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('backend.page')
#79 /home/public_html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('root')
#80 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('root')
#81 /home/public_html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root')
#82 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('root', true)
#83 /home/public_html/vendor/magento/framework/View/Layout.php(954): Magento\Framework\View\Layout\Interceptor->renderElement('root')
#84 /home/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(492): Magento\Framework\View\Layout->getOutput()
#85 /home/public_html/vendor/magento/framework/View/Result/Page.php(257): Magento\Framework\View\Layout\Interceptor->getOutput()
#86 /home/public_html/vendor/magento/framework/View/Result/Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#87 /home/public_html/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(193): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#88 /home/public_html/vendor/magento/framework/App/Http.php(139): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#89 /home/public_html/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#90 /home/public_html/index.php(57): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
7
  • Please disable module Apptrian_ImageOptimizer for a while and check if admin is working or not. If yes, then you need to debug into Apptrian_ImageOptimizer module. Commented Jun 3, 2021 at 13:34
  • @DharaBhatti when I try to disable this module I have this error: public_html/generated/code/Magento/Framework): Directory not empty
    – Robert
    Commented Jun 3, 2021 at 13:42
  • Run this command: rm -rf generated/ var/view_preprocessed/* var/page_cache/* Commented Jun 3, 2021 at 13:48
  • @DharaBhatti I try that command is the same error when try to disable the module
    – Robert
    Commented Jun 3, 2021 at 14:05
  • My next move would be to look at line 724 of the file that is causing the error and edit it as necessary to avoid whatever the problem is. No need to "fix" anything, since whatever the problem is doesn't seem like it is needed just to view the admin. You can also try renaming that module's etc/admin/system.xml to etc/admin/system.xml.off and clear the cache from the command line. That might temporarily stop it from blocking the rest of the configurations.
    – jiheison
    Commented Jun 4, 2021 at 4:58

1 Answer 1

1

please run below both command and check your adminm

php bin/magento module:disable Apptrian_ImageOptimizer 
php bin/magento cache:flush
php bin/magento setup:di:compile

hope this helps you :)

2
  • you have read the discussion with @DharaBhatti from top? there I say this: when I try to disable this module I have this error: public_html/generated/code/Magento/Framework): Directory not empty, how I can disable that module?
    – Robert
    Commented Jun 3, 2021 at 16:35
  • Please go to app/etc/config.php search your module and please change 1 to 0 and clear cache and run compile comand Commented Jun 3, 2021 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.