Skip to content

Import failed: Area code not set: Area code must be set before starting a session. #16171

Closed
@springerin

Description

@springerin

Preconditions

  1. Magento 2.2.3 or 2.2.4
  2. PHP 7.1.18
  3. Ubuntu 16.04.4 LTS
  4. mysql Ver 14.14 Distrib 5.7.22-22, for debian-linux-gnu (x86_64) using 6.3

Steps to reproduce

  1. clean install of Magento 2.2.3 or 2.2.4
  2. bin/magento app:config:dump
  3. bin/magento app:config:import
  4. change only the base_url in the env.php files
    'web' => array ( 'unsecure' => array ( 'base_url' => 'http://m223ee.ffm/', 'base_link_url' => '{{unsecure_base_url}}',
  5. bin/magento app:config:import

Expected result

  1. Expected output :
    Processing configurations data from configuration file...
    System config was processed

Actual result

  1. Output: Processing configurations data from configuration file...
    Import failed: Area code not set: Area code must be set before starting a session.
  2. var/log/exception.log:

report.ERROR: Area code not set: Area code must be set before starting a session. {"exception":"[object] (Magento\Framework\Exception\State\InvalidTransitionException(code: 0): Area code not set: Area code must be set before starting a session. at /home/springerin/Workspace/Progetti/m224ee/vendor/magento/module-config/Model/Config/Importer.php:137, Magento\Framework\Exception\SessionException(code: 0): Area code not set: Area code must be set before starting a session. at /home/springerin/Workspace/Progetti/m224ee/vendor/magento/framework/Session/SessionManager.php:175, Magento\Framework\Exception\LocalizedException(code: 0): Area code is not set at /home/springerin/Workspace/Progetti/m224ee/vendor/magento/framework/App/State.php:152)"} []

Metadata

Metadata

Labels

Area: Import / exportComponent: ConfigIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReported on 2.3.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions