未设置区号


10

我一直在尝试解决此区域代码未设置错误的问题,并在此处引用了其他代码,但是在跟踪该代码时遇到了问题。

我一直在尝试将2.0.7升级到2.1.0,当我到达运行点时:

php bin / magento设置:升级-vvv

我得到这个作为错误。

[Magento \ Framework \ Exception \ SessionException]未设置区号:必须在开始会话之前设置区号。

异常跟踪:()位于/ opt / bitnami / apps /中的/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Session/SessionManager.php:176 Magento \ Framework \ Session \ SessionManager-> start() magento / htdocs / var / generation / Magento / Framework / Session / Generic / Interceptor.php:50 Magento \ Framework \ Session \ Generic \ Interceptor-> start()在/ opt / bitnami / apps / magento / htdocs / vendor / magento /framework/Session/SessionManager.php:130 Magento \ Framework \ Session \ SessionManager-> __ construct()位于/opt/bitnami/apps/magento/htdocs/var/generation/Magento/Framework/Session/Generic/Interceptor.php: 14 Magento \ Framework \ Session \ Generic \ Interceptor-> __ construct()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93 Magento \ Framework \ Objectwork \ ObjectManager \ Factory \抽象工厂->在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php上的createObject()://上的89 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create() opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / ObjectManager.php:71 Magento \ Framework \ ObjectManager \ ObjectManager-> get()在/ opt / bitnami / apps / magento / htdocs / vendor / magento /framework/ObjectManager/Factory/AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create()在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php:71 Magento \ Framework \ ObjectManager \ ObjectManager \ ObjectManager- > get()在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()在/ opt / bitnami /apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:82 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer->在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php上创建():71 Magento \ Framework \ ObjectManager \ ObjectManager-> get()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager /Factory/Dynamic/Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments()位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:82在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php上的Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create():71 Magento \ Framework \ ObjectManager \ ObjectManager-> get()在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory- > resolveArgument()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments() /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / ObjectManager.php:71 Magento \ Framework \ ObjectManager \ ObjectManager->在(/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()处的get()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments()在/ opt / bitnami / apps / magento / htdocs /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / ObjectManager.php:71 Magento \ Framework \ ObjectManager \ ObjectManager-> get()位于/opt/bitnami/apps/magento/htdocs/app/code/J2t/Rewardpoints/Observer/ProcessSaveModel.php:21 J2t \ Rewardpoints \ Observer \ ProcessSaveModel-> execute()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Event/Invoker/InvokerDefault.php:73 Magento \ Framework \ Event \ Invoker \ InvokerDefault- > _callObserverMethod()在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Event/Invoker/InvokerDefault.php:61 Magento \ Framework \ Event \ Invoker \ InvokerDefault-> dispatch()在/ opt / bitnami /apps/magento/htdocs/vendor/magento/framework/Event/Manager.php:66 Magento \ Framework \ Event \ Manager-> dispatch()位于/ opt / bitnami / apps / magento / htdocs / var / generation / Magento / Framework / Event / Manager / Proxy.php:95 Magento \ Framework \ Event \ Manager \ Proxy-> dispatch()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Model/AbstractModel.php:800 Magento \ Framework \ Model \ AbstractModel->在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php:818 Magento \ Framework \ Model \ ResourceModel \ Db \ AbstractDb-> processAfterSaves()处的afterSave() opt / bitnami / apps / magento / htdocs / vendor / magento / framework / Model / ResourceModel / Db / AbstractDb.php:408 Magento \ Framework \ Model \ ResourceModel \ Db \ AbstractDb-> save()在/ opt / bitnami / apps /magento/htdocs/vendor/magento/framework/Model/AbstractModel.php:631 Magento \ Framework \ Model \ AbstractModel-> save(),位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / module-indexer / Setup / Recurring.php:108 Magento \ Indexer \ Setup \ Recurring-> install()位于/opt/bitnami/apps/magento/htdocs/setup/src/Magento/Setup/Model/Installer.php:871 Magento \ Setup \型号\安装程序->在/opt/bitnami/apps/magento/htdocs/setup/src/Magento/Setup/Model/Installer.php上的handleDBSchemaData():在/ opt / bitnami / apps /下的779 Magento \ Setup \ Model \ Installer-> installSchema() magento / htdocs / setup / src / Magento / Setup / Console / Command / UpgradeCommand.php:89 Magento \ Setup \ Console \ Command \ UpgradeCommand-> execute()在/ opt / bitnami / apps / magento / htdocs / vendor / symfony /console/Symfony/Component/Console/Command/Command.php:257 Symfony \ Component \ Console \ Command \ Command-> run()位于/ opt / bitnami / apps / magento / htdocs / vendor / symfony / console / Symfony / Component / Console / Application.php:874 Symfony \ Component \ Console \ Application-> doRunCommand()位于/opt/bitnami/apps/magento/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php:195 Symfony \ Component \ Console \ Application->位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Console/Cli.php的doRun():96 Magento \ Framework \ Console \ Cli->位于/ opt / bitnami / apps / magento /的doRun() htdocs / vendor / symfony / console / Symfony / Component / Console / Application.php:126 Symfony \ Component \ Console \ Application-> run()在/ opt / bitnami / apps / magento / htdocs / bin / magento:23

[Magento \ Framework \ Exception \ LocalizedException]未设置区号

异常跟踪:()位于/ opt / bitnami / apps /上的/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/App/State.php:139 Magento \ Framework \ App \ State-> getAreaCode() magento / htdocs / vendor / magento / framework / Session / SessionManager.php:174 Magento \ Framework \ Session \ SessionManager-> start()在/ opt / bitnami / apps / magento / htdocs / var / generation / Magento / Framework / Session /Generic/Interceptor.php:50 Magento \ Framework \ Session \ Generic \ Interceptor-> start()在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Session/SessionManager.php:130 Magento \ Framework \ Session \ SessionManager-> __ construct()在/opt/bitnami/apps/magento/htdocs/var/generation/Magento/Framework/Session/Generic/Interceptor.php:14 Magento \ Framework \ Session \ Generic \ Interceptor->__construct()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> createObject()位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:89 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create()在/ opt / bitnami / apps / magento / htdocs /vendor/magento/framework/ObjectManager/ObjectManager.php:71 Magento \ Framework \ ObjectManager \ ObjectManager-> get(),位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / AbstractFactory。 php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82 Magento \ Framework \位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php上的ObjectManager \ Factory \ Dynamic \ Developer-> create(),位于:71 Magento \ Framework \ ObjectManager \ ObjectManager-> get() /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer->_resolveArguments()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create() opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / ObjectManager.php:71 Magento \ Framework \ ObjectManager \ ObjectManager-> get()在/ opt / bitnami / apps / magento / htdocs / vendor / magento /framework/ObjectManager/Factory/AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create()在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php:71 Magento \ Framework \ ObjectManager \ ObjectManager \ ObjectManager- > get()在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()在/ opt / bitnami /apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:82 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer->在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php上创建():71 Magento \ Framework \ ObjectManager \ ObjectManager-> get()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / AbstractFactory.php:126 Magento \ Framework \ ObjectManager \ Factory \ AbstractFactory-> resolveArgument()位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager /Factory/Dynamic/Developer.php:53 Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> _ resolveArguments()位于/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / ObjectManager / Factory / Dynamic / Developer.php:82在/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php上的Magento \ Framework \ ObjectManager \ Factory \ Dynamic \ Developer-> create():71 Magento \ Framework \ ObjectManager \ ObjectManager-> get()在/opt/bitnami/apps/magento/htdocs/app/code/J2t/Rewardpoints/Observer/ProcessSaveModel.php:21 J2t \ Rewardpoints \ Observer \ ProcessSaveModel-> execute ()位于/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Event/Invoker/InvokerDefault.php:73 Magento \ Framework \ Event \ Invoker \ InvokerDefault-> _ callObserverMethod()位于/ opt / bitnami / apps /magento/htdocs/vendor/magento/framework/Event/Invoker/InvokerDefault.php:61 Magento \ Framework \ Event \ Invoker \ InvokerDefault-> dispatch()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / Event / Manager.php:66 Magento \ Framework \ Event \ Manager-> dispatch()位于/opt/bitnami/apps/magento/htdocs/var/generation/Magento/Framework/Event/Manager/Proxy.php:95 Magento \ Framework \ Event \ Manager \ Proxy->/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Model/AbstractModel.php上的dispatch():/ opt / bitnami / apps / magento /上的800 Magento \ Framework \ Model \ AbstractModel-> afterSave() htdocs / vendor / magento / framework / Model / ResourceModel / Db / AbstractDb.php:818 Magento \ Framework \ Model \ ResourceModel \ Db \ AbstractDb-> processAfterSaves()在/ opt / bitnami / apps / magento / htdocs / vendor / magento /framework/Model/ResourceModel/Db/AbstractDb.php:408 Magento \ Framework \ Model \ ResourceModel \ Db \ AbstractDb-> save()在/ opt / bitnami / apps / magento / htdocs / vendor / magento / framework / Model /在/opt/bitnami/apps/magento/htdocs/vendor/magento/module-indexer/Setup/Recurring.php上的AbstractModel.php:631 Magento \ Framework \ Model \ AbstractModel-> save()。php:108 Magento \ Indexer \ Setup \重复->install()位于/opt/bitnami/apps/magento/htdocs/setup/src/Magento/Setup/Model/Installer.php:871 Magento \ Setup \ Model \ Installer-> handleDBSchemaData()位于/ opt / bitnami / apps / magento / htdocs / setup / src / Magento / Setup / Model / Installer.php:779 Magento \ Setup \ Model \ Installer-> installSchema()位于/ opt / bitnami / apps / magento / htdocs / setup / src / Magento / Setup /Console/Command/UpgradeCommand.php:89 Magento \ Setup \ Console \ Command \ UpgradeCommand-> execute()位于/ opt / bitnami / apps / magento / htdocs / vendor / symfony / console / Symfony / Component / Console / Command / Command.php:257 Symfony \ Component \ Console \ Command \ Command-> run()位于/opt/bitnami/apps/magento/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php:874 Symfony \组件\控制台\应用程序->/opt/bitnami/apps/magento/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php上的doRunCommand():/ 195 / opt / bitnami /上的Symfony \ Component \ Console \ Application-> doRun() apps / magento / htdocs / vendor / magento / framework / Console / Cli.php:96 Magento \ Framework \ Console \ Cli-> doRun()位于/ opt / bitnami / apps / magento / htdocs / vendor / symfony / console / Symfony /Component/Console/Application.php:126 Symfony \ Component \ Console \ Application-> run()位于/ opt / bitnami / apps / magento / htdocs / bin / magento:23在(/ opt / bitnami / apps / magento / htdocs / bin / magento:23处运行()在(/ opt / bitnami / apps / magento / htdocs / bin / magento:23处运行()

设置:升级[-保持生成] [--magento-init-params =“ ...”]

因此,如果有人可以在哪里寻找帮助,那就太好了

提前致谢


首先看一下这里:magento-quickies.alanstorm.com/post/142652104930/…我不知道这是否对您有用,因为在这种情况下,他正在制作一个客户CLI模块。另外,通过堆栈跟踪,我看不到任何第三方模块。你在用吗?这些是此类错误的下一个触发器。那是我几周前遇到的问题:magento.stackexchange.com/questions/128658/…–
circleix

1
有两个,所以我将把它们退下来,看看会发生什么。
David Aschenbrener

突然出现的其他事情,请确保在测试时清除了/ var中的文件夹。如果var / generation中出现错误,即使您已在代码中解决了该问题,在执行任何其他CLI命令时也会使用此文件夹,并且可以在运行时跳闸。
circleix

确保这样做,所以我最终要做的是禁用J2t模块,然后再次运行。
David Aschenbrener

我遇到一个小错误,但是当Magento尝试更新“ Magento_Cms”本机扩展时,我得到了:页面URL密钥包含大写字母或不允许的符号。但是按照这个 magento.stackexchange.com/questions/123364/… 修复了它并建立了shazaam,我得到了升级。
David Aschenbrener

Answers:


5

在这里看看:

Magento的\框架\的ObjectManager \ ObjectManager-> get()方法上的/ opt / bitnami /应用/ Magento的/ htdocs中/ 应用程序/代码/ J2t / Rewardpoints /观察员/ ProcessSaveModel.php:21

似乎此模块正在尝试获取对象管理器,如果未设置该区号,则可能触发该错误。在我的评论中,我链接到一个解决方案,该解决方案是针对我正在使用的扩展程序发现此错误的。可能会在此处为您提供帮助,因为在观察者中正在发生对对象管理器的调用。

再次是该链接:第三方模块中的Magento 2“未设置地区代码”警告


1
我有同样的问题,但就我而言,我没有从异常跟踪中看到任何第三方模块。异常跟踪中的所有行都是Magento \ Framework \ ObjectManager .....我能否从日志中跟踪更多错误,例如-vvv选项?
Magento Learner

那是第一个开始的地方。我已经看到此问题是出于此特定问题之外的其他原因而提出的。尝试获取更详细的报告然后发布新问题是值得的。
circleix

3

我刚刚遇到了运行此问题bin/magento setup:upgrade的情况,并且抛出了异常module-config

Area code is not set {"exception":"[object] (Magento\\Framework\\Exception\\State\\InvalidTransitionException(code: 0): Area code is not set at /magento/htdocs/vendor/magento/module-config/Model/Config/Importer.php:137

原来,我有一些设置app/etc/env.php是配置导入器不喜欢的。在该行上设置一个断点,向我显示了要更新的数据,并app/etc/env.php为我解决了该问题。

希望这对某人有帮助!


0

有同样的问题。添加了var_export()来查看它的嗡嗡声。

        } catch (\Exception $e) {
        var_export($data);
        throw new InvalidTransitionException(__('%1', $e->getMessage()), $e);

然后它从我的app / ect / env.php返回了一些设置

array (
  'default' => 
  array (
    'dev' => 
    array (
      'debug' => 
      array (
        'debug_logging' => '0',
      ),
    ),
  ),
)

删除它,它可以再次工作。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.