netz98 / n98-magerun2

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.
https://magerun.net
Other
876 stars 225 forks source link

--root-dir causes: Warning: ini_set(): Cannot find save handler 'db' in .../magento/vendor/magento/framework/Session/SessionManager.php on line 563 #421

Closed mathijsm closed 5 years ago

mathijsm commented 5 years ago

Hello,

When we do a n98 command with --root-dir it fails with version 3.0.2. n98-magerun2 --root-dir=/data/web/magento2 pimgento:import --code=category --file=categories.csv => Warning: ini_set(): Cannot find save handler ‘db’ in /data/web/magedeploy2/releases/20181217122712/magento/vendor/magento/framework/Session/SessionManager.php on line 563

we we go back to version 2.3.3 it works

thanks

cmuench commented 5 years ago

@mathijsm can you provide additional infos about the used Magento version. Does the problem exists if you call other commands like sys:info?

mathijsm commented 5 years ago

hello @cmuench,

The is sys:info works

`app@5vi95i-debanier-magweb-do:~$ n98-magerun2 --root-dir=/data/web/magento2 sys:info

Magento System Information

+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | name | value | +------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Name | Magento | | Version | 2.2.6 | | Edition | Community | | Application Mode | production | | Session | db | | Crypt Key |<....> | | Install Date | Wed, 07 Jun 2017 09:37:44 +0000 | | Cache Backend | Cm_Cache_Backend_Redis | | Vendors | Magento, Amasty, Ho, IndieGroup, Pimgento, KiwiCommerce, Klarna, MGS, MageWorx, Magefan, Aheadworks, Amazon, Mirasvit, Fooman, Bpost, Ebizmarts, Dotdigitalgroup, MultiSafepay, Pektsekye, DeBanier, Staempfli, Temando, Vertex, VladimirPopov, Xtento, Yireo | | Attribute Count | 224 | | Customer Count | 16686 | | Category Count | 208 | | Product Count | 17115 | +------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ `

cmuench commented 5 years ago

@mathijsm It seems that this could be a Magento core problem. See: https://github.com/magento/magento2/issues/18182

mathijsm commented 5 years ago

hello @cmuench

This is strange because only thing that has changed on the server is the version of n98-magerun from 2.3.3 to 3.0.x

If it would a be a core bug it would be happening on the 2.3.3 version as well.

cmuench commented 5 years ago

@mathijsm Yes, we had to change some session stuff to be compatible with Magento 2.3.0. Do you really use "db" as session save handler?

nocturnalfrog commented 5 years ago

Yes, we do

cmuench commented 5 years ago

@mathijsm Maybe my last changes with the session could be responsible. At the moment I am not able to reproduce the issue on my machine.

nocturnalfrog commented 5 years ago

I added a var_dump(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); to vendor/magento/framework/Session/SessionManager.php to provide some more insight into what is happening. Hopefully this rings a bell for you. ;)


array(53) {
  [0] =>
  array(5) {
    'file' =>
    string(78) "/data/web/magento2/magento/vendor/magento/framework/Session/SessionManager.php"
    'line' =>
    int(184)
    'function' =>
    string(14) "initIniOptions"
    'class' =>
    string(40) "Magento\Framework\Session\SessionManager"
    'type' =>
    string(2) "->"
  }
  [1] =>
  array(5) {
    'file' =>
    string(92) "/data/web/magento2/magento/generated/code/Magento/Backend/Model/Auth/Session/Interceptor.php"
    'line' =>
    int(167)
    'function' =>
    string(5) "start"
    'class' =>
    string(40) "Magento\Framework\Session\SessionManager"
    'type' =>
    string(2) "->"
  }
  [2] =>
  array(5) {
    'file' =>
    string(78) "/data/web/magento2/magento/vendor/magento/framework/Session/SessionManager.php"
    'line' =>
    int(130)
    'function' =>
    string(5) "start"
    'class' =>
    string(46) "Magento\Backend\Model\Auth\Session\Interceptor"
    'type' =>
    string(2) "->"
  }
  [3] =>
  array(5) {
    'file' =>
    string(79) "/data/web/magento2/magento/vendor/magento/module-backend/Model/Auth/Session.php"
    'line' =>
    int(100)
    'function' =>
    string(11) "__construct"
    'class' =>
    string(40) "Magento\Framework\Session\SessionManager"
    'type' =>
    string(2) "->"
  }
  [4] =>
  array(5) {
    'file' =>
    string(92) "/data/web/magento2/magento/generated/code/Magento/Backend/Model/Auth/Session/Interceptor.php"
    'line' =>
    int(14)
    'function' =>
    string(11) "__construct"
    'class' =>
    string(34) "Magento\Backend\Model\Auth\Session"
    'type' =>
    string(2) "->"
  }
  [5] =>
  array(5) {
    'file' =>
    string(93) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php"
    'line' =>
    int(111)
    'function' =>
    string(11) "__construct"
    'class' =>
    string(46) "Magento\Backend\Model\Auth\Session\Interceptor"
    'type' =>
    string(2) "->"
  }
  [6] =>
  array(5) {
    'file' =>
    string(95) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php"
    'line' =>
    int(66)
    'function' =>
    string(12) "createObject"
    'class' =>
    string(55) "Magento\Framework\ObjectManager\Factory\AbstractFactory"
    'type' =>
    string(2) "->"
  }
  [7] =>
  array(5) {
    'file' =>
    string(83) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/ObjectManager.php"
    'line' =>
    int(70)
    'function' =>
    string(6) "create"
    'class' =>
    string(57) "Magento\Framework\ObjectManager\Factory\Dynamic\Developer"
    'type' =>
    string(2) "->"
  }
  [8] =>
  array(5) {
    'file' =>
    string(93) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php"
    'line' =>
    int(144)
    'function' =>
    string(3) "get"
    'class' =>
    string(45) "Magento\Framework\ObjectManager\ObjectManager"
    'type' =>
    string(2) "->"
  }
  [9] =>
  array(5) {
    'file' =>
    string(93) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php"
    'line' =>
    int(230)
    'function' =>
    string(15) "resolveArgument"
    'class' =>
    string(55) "Magento\Framework\ObjectManager\Factory\AbstractFactory"
    'type' =>
    string(2) "->"
  }
  [10] =>
  array(5) {
    'file' =>
    string(95) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php"
    'line' =>
    int(34)
    'function' =>
    string(25) "resolveArgumentsInRuntime"
    'class' =>
    string(55) "Magento\Framework\ObjectManager\Factory\AbstractFactory"
    'type' =>
    string(2) "->"
  }
  [11] =>
  array(5) {
    'file' =>
    string(95) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php"
    'line' =>
    int(59)
    'function' =>
    string(17) "_resolveArguments"
    'class' =>
    string(57) "Magento\Framework\ObjectManager\Factory\Dynamic\Developer"
    'type' =>
    string(2) "->"
  }
  [12] =>
  array(5) {
    'file' =>
    string(83) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/ObjectManager.php"
    'line' =>
    int(70)
    'function' =>
    string(6) "create"
    'class' =>
    string(57) "Magento\Framework\ObjectManager\Factory\Dynamic\Developer"
    'type' =>
    string(2) "->"
  }
  [13] =>
  array(5) {
    'file' =>
    string(93) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php"
    'line' =>
    int(144)
    'function' =>
    string(3) "get"
    'class' =>
    string(45) "Magento\Framework\ObjectManager\ObjectManager"
    'type' =>
    string(2) "->"
  }
  [14] =>
  array(5) {
    'file' =>
    string(93) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php"
    'line' =>
    int(230)
    'function' =>
    string(15) "resolveArgument"
    'class' =>
    string(55) "Magento\Framework\ObjectManager\Factory\AbstractFactory"
    'type' =>
    string(2) "->"
  }
  [15] =>
  array(5) {
    'file' =>
    string(95) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php"
    'line' =>
    int(34)
    'function' =>
    string(25) "resolveArgumentsInRuntime"
    'class' =>
    string(55) "Magento\Framework\ObjectManager\Factory\AbstractFactory"
    'type' =>
    string(2) "->"
  }
  [16] =>
  array(5) {
    'file' =>
    string(95) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php"
    'line' =>
    int(59)
    'function' =>
    string(17) "_resolveArguments"
    'class' =>
    string(57) "Magento\Framework\ObjectManager\Factory\Dynamic\Developer"
    'type' =>
    string(2) "->"
  }
  [17] =>
  array(5) {
    'file' =>
    string(83) "/data/web/magento2/magento/vendor/magento/framework/ObjectManager/ObjectManager.php"
    'line' =>
    int(70)
    'function' =>
    string(6) "create"
    'class' =>
    string(57) "Magento\Framework\ObjectManager\Factory\Dynamic\Developer"
    'type' =>
    string(2) "->"
  }
  [18] =>
  array(5) {
    'file' =>
    string(77) "/data/web/magento2/magento/vendor/magento/framework/Event/ObserverFactory.php"
    'line' =>
    int(33)
    'function' =>
    string(3) "get"
    'class' =>
    string(45) "Magento\Framework\ObjectManager\ObjectManager"
    'type' =>
    string(2) "->"
  }
  [19] =>
  array(5) {
    'file' =>
    string(84) "/data/web/magento2/magento/vendor/magento/framework/Event/Invoker/InvokerDefault.php"
    'line' =>
    int(58)
    'function' =>
    string(3) "get"
    'class' =>
    string(39) "Magento\Framework\Event\ObserverFactory"
    'type' =>
    string(2) "->"
  }
  [20] =>
  array(5) {
    'file' =>
    string(69) "/data/web/magento2/magento/vendor/magento/framework/Event/Manager.php"
    'line' =>
    int(66)
    'function' =>
    string(8) "dispatch"
    'class' =>
    string(46) "Magento\Framework\Event\Invoker\InvokerDefault"
    'type' =>
    string(2) "->"
  }
  [21] =>
  array(5) {
    'file' =>
    string(80) "/data/web/magento2/magento/vendor/magento/framework/Interception/Interceptor.php"
    'line' =>
    int(58)
    'function' =>
    string(8) "dispatch"
    'class' =>
    string(31) "Magento\Framework\Event\Manager"
    'type' =>
    string(2) "->"
  }
  [22] =>
  array(5) {
    'file' =>
    string(80) "/data/web/magento2/magento/vendor/magento/framework/Interception/Interceptor.php"
    'line' =>
    int(138)
    'function' =>
    string(13) "___callParent"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [23] =>
  array(5) {
    'file' =>
    string(86) "/data/web/magento2/magento/vendor/msp/devtools/Plugin/Event/ManagerInterfacePlugin.php"
    'line' =>
    int(77)
    'function' =>
    string(40) "Magento\Framework\Interception\{closure}"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [24] =>
  array(5) {
    'file' =>
    string(80) "/data/web/magento2/magento/vendor/magento/framework/Interception/Interceptor.php"
    'line' =>
    int(135)
    'function' =>
    string(14) "aroundDispatch"
    'class' =>
    string(48) "MSP\DevTools\Plugin\Event\ManagerInterfacePlugin"
    'type' =>
    string(2) "->"
  }
  [25] =>
  array(5) {
    'file' =>
    string(80) "/data/web/magento2/magento/vendor/magento/framework/Interception/Interceptor.php"
    'line' =>
    int(153)
    'function' =>
    string(40) "Magento\Framework\Interception\{closure}"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [26] =>
  array(5) {
    'file' =>
    string(89) "/data/web/magento2/magento/generated/code/Magento/Framework/Event/Manager/Interceptor.php"
    'line' =>
    int(26)
    'function' =>
    string(14) "___callPlugins"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [27] =>
  array(5) {
    'file' =>
    string(83) "/data/web/magento2/magento/generated/code/Magento/Framework/Event/Manager/Proxy.php"
    'line' =>
    int(95)
    'function' =>
    string(8) "dispatch"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [28] =>
  array(5) {
    'file' =>
    string(75) "/data/web/magento2/magento/vendor/magento/framework/Model/AbstractModel.php"
    'line' =>
    int(693)
    'function' =>
    string(8) "dispatch"
    'class' =>
    string(37) "Magento\Framework\Event\Manager\Proxy"
    'type' =>
    string(2) "->"
  }
  [29] =>
  array(5) {
    'file' =>
    string(89) "/data/web/magento2/magento/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php"
    'line' =>
    int(406)
    'function' =>
    string(10) "beforeSave"
    'class' =>
    string(37) "Magento\Framework\Model\AbstractModel"
    'type' =>
    string(2) "->"
  }
  [30] =>
  array(5) {
    'file' =>
    string(75) "/data/web/magento2/magento/vendor/magento/framework/Model/AbstractModel.php"
    'line' =>
    int(647)
    'function' =>
    string(4) "save"
    'class' =>
    string(51) "Magento\Framework\Model\ResourceModel\Db\AbstractDb"
    'type' =>
    string(2) "->"
  }
  [31] =>
  array(5) {
    'file' =>
    string(108) "/data/web/magento2/magento/vendor/agencednd/module-pimgento/Log/Observer/PimgentoImportStepStartObserver.php"
    'line' =>
    int(49)
    'function' =>
    string(4) "save"
    'class' =>
    string(37) "Magento\Framework\Model\AbstractModel"
    'type' =>
    string(2) "->"
  }
  [32] =>
  array(5) {
    'file' =>
    string(84) "/data/web/magento2/magento/vendor/magento/framework/Event/Invoker/InvokerDefault.php"
    'line' =>
    int(72)
    'function' =>
    string(7) "execute"
    'class' =>
    string(53) "Pimgento\Log\Observer\PimgentoImportStepStartObserver"
    'type' =>
    string(2) "->"
  }
  [33] =>
  array(5) {
    'file' =>
    string(84) "/data/web/magento2/magento/vendor/magento/framework/Event/Invoker/InvokerDefault.php"
    'line' =>
    int(60)
    'function' =>
    string(19) "_callObserverMethod"
    'class' =>
    string(46) "Magento\Framework\Event\Invoker\InvokerDefault"
    'type' =>
    string(2) "->"
  }
  [34] =>
  array(5) {
    'file' =>
    string(69) "/data/web/magento2/magento/vendor/magento/framework/Event/Manager.php"
    'line' =>
    int(66)
    'function' =>
    string(8) "dispatch"
    'class' =>
    string(46) "Magento\Framework\Event\Invoker\InvokerDefault"
    'type' =>
    string(2) "->"
  }
  [35] =>
  array(5) {
    'file' =>
    string(80) "/data/web/magento2/magento/vendor/magento/framework/Interception/Interceptor.php"
    'line' =>
    int(58)
    'function' =>
    string(8) "dispatch"
    'class' =>
    string(31) "Magento\Framework\Event\Manager"
    'type' =>
    string(2) "->"
  }
  [36] =>
  array(5) {
    'file' =>
    string(80) "/data/web/magento2/magento/vendor/magento/framework/Interception/Interceptor.php"
    'line' =>
    int(138)
    'function' =>
    string(13) "___callParent"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [37] =>
  array(5) {
    'file' =>
    string(86) "/data/web/magento2/magento/vendor/msp/devtools/Plugin/Event/ManagerInterfacePlugin.php"
    'line' =>
    int(77)
    'function' =>
    string(40) "Magento\Framework\Interception\{closure}"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [38] =>
  array(5) {
    'file' =>
    string(80) "/data/web/magento2/magento/vendor/magento/framework/Interception/Interceptor.php"
    'line' =>
    int(135)
    'function' =>
    string(14) "aroundDispatch"
    'class' =>
    string(48) "MSP\DevTools\Plugin\Event\ManagerInterfacePlugin"
    'type' =>
    string(2) "->"
  }
  [39] =>
  array(5) {
    'file' =>
    string(80) "/data/web/magento2/magento/vendor/magento/framework/Interception/Interceptor.php"
    'line' =>
    int(153)
    'function' =>
    string(40) "Magento\Framework\Interception\{closure}"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [40] =>
  array(5) {
    'file' =>
    string(89) "/data/web/magento2/magento/generated/code/Magento/Framework/Event/Manager/Interceptor.php"
    'line' =>
    int(26)
    'function' =>
    string(14) "___callPlugins"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [41] =>
  array(5) {
    'file' =>
    string(83) "/data/web/magento2/magento/generated/code/Magento/Framework/Event/Manager/Proxy.php"
    'line' =>
    int(95)
    'function' =>
    string(8) "dispatch"
    'class' =>
    string(43) "Magento\Framework\Event\Manager\Interceptor"
    'type' =>
    string(2) "->"
  }
  [42] =>
  array(5) {
    'file' =>
    string(84) "/data/web/magento2/magento/vendor/agencednd/module-pimgento/Import/Model/Factory.php"
    'line' =>
    int(70)
    'function' =>
    string(8) "dispatch"
    'class' =>
    string(37) "Magento\Framework\Event\Manager\Proxy"
    'type' =>
    string(2) "->"
  }
  [43] =>
  array(5) {
    'file' =>
    string(96) "/data/web/magento2/magento/generated/code/Pimgento/Category/Model/Factory/Import/Interceptor.php"
    'line' =>
    int(180)
    'function' =>
    string(7) "execute"
    'class' =>
    string(29) "Pimgento\Import\Model\Factory"
    'type' =>
    string(2) "->"
  }
  [44] =>
  array(5) {
    'file' =>
    string(108) "/data/web/magento2/magento/vendor/agencednd/module-pimgento/Import/Console/Command/PimgentoImportCommand.php"
    'line' =>
    int(91)
    'function' =>
    string(7) "execute"
    'class' =>
    string(50) "Pimgento\Category\Model\Factory\Import\Interceptor"
    'type' =>
    string(2) "->"
  }
  [45] =>
  array(5) {
    'file' =>
    string(108) "/data/web/magento2/magento/vendor/agencednd/module-pimgento/Import/Console/Command/PimgentoImportCommand.php"
    'line' =>
    int(73)
    'function' =>
    string(7) "_import"
    'class' =>
    string(53) "Pimgento\Import\Console\Command\PimgentoImportCommand"
    'type' =>
    string(2) "->"
  }
  [46] =>
  array(5) {
    'file' =>
    string(69) "/data/web/magento2/magento/vendor/symfony/console/Command/Command.php"
    'line' =>
    int(245)
    'function' =>
    string(7) "execute"
    'class' =>
    string(53) "Pimgento\Import\Console\Command\PimgentoImportCommand"
    'type' =>
    string(2) "->"
  }
  [47] =>
  array(5) {
    'file' =>
    string(73) "phar:///data/web/n98-magerun2-latest.phar/src/N98/Magento/Application.php"
    'line' =>
    int(739)
    'function' =>
    string(3) "run"
    'class' =>
    string(41) "Symfony\Component\Console\Command\Command"
    'type' =>
    string(2) "->"
  }
  [48] =>
  array(5) {
    'file' =>
    string(80) "phar:///data/web/n98-magerun2-latest.phar/vendor/symfony/console/Application.php"
    'line' =>
    int(185)
    'function' =>
    string(12) "doRunCommand"
    'class' =>
    string(23) "N98\Magento\Application"
    'type' =>
    string(2) "->"
  }
  [49] =>
  array(5) {
    'file' =>
    string(73) "phar:///data/web/n98-magerun2-latest.phar/src/N98/Magento/Application.php"
    'line' =>
    int(237)
    'function' =>
    string(5) "doRun"
    'class' =>
    string(37) "Symfony\Component\Console\Application"
    'type' =>
    string(2) "->"
  }
  [50] =>
  array(5) {
    'file' =>
    string(80) "phar:///data/web/n98-magerun2-latest.phar/vendor/symfony/console/Application.php"
    'line' =>
    int(117)
    'function' =>
    string(5) "doRun"
    'class' =>
    string(23) "N98\Magento\Application"
    'type' =>
    string(2) "->"
  }
  [51] =>
  array(5) {
    'file' =>
    string(73) "phar:///data/web/n98-magerun2-latest.phar/src/N98/Magento/Application.php"
    'line' =>
    int(319)
    'function' =>
    string(3) "run"
    'class' =>
    string(37) "Symfony\Component\Console\Application"
    'type' =>
    string(2) "->"
  }
  [52] =>
  array(5) {
    'file' =>
    string(34) "/data/web/n98-magerun2-latest.phar"
    'line' =>
    int(8)
    'function' =>
    string(3) "run"
    'class' =>
    string(23) "N98\Magento\Application"
    'type' =>
    string(2) "->"
  }
}```
cmuench commented 5 years ago

@nocturnalfrog I setup a fresh Magento 2.2.7 on my machine and installed the Pimgento_Api module and configured the sesision save to "db". Sadly I am still not able to reproduce the problem. My system works like a charm. If i search for your problem I find a lot of problems with redis and session save. One of the guys mentioned that he added session.save_handler = "db" to his php.ini config which seems to fix the problem.

cmuench commented 5 years ago

Cannot be reproduced. Feel free to reopen.