Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Area code not set: Area code must be set before starting a session. #28

Open
samuelecarpene opened this issue Jan 12, 2018 · 12 comments
Assignees
Labels

Comments

@samuelecarpene
Copy link

In production environment there is an error logged in exception log continuosly
[2018-01-05 08:19:16] main.CRITICAL: Area code not set: Area code must be set before starting a session. {"exception":"[object] (Magento\Framework\Exception\SessionException(code: 0): Area code not set: Area code must be set before starting a session. at [website_path]/vendor/magento/framework/Session/SessionManager.php:175, Magento\Framework\Exception\LocalizedException(code: 0): Area code is not set at [website_path]/vendor/magento/framework/App/State.php:152)"} []

Preconditions

  1. Magento 2.2.2
  2. Ubuntu 16.04 Server
  3. PHP 7.0.22
  4. Mysql 5.7.19
  5. Magento installed/deployed with composer
  6. Magento in production mode

After some search i found that with this module disabled the problem is disappeared.
How can i help you to identify the problem? If there is one...

@phoenix128 phoenix128 added the bug label Jan 15, 2018
@phoenix128 phoenix128 self-assigned this Jan 15, 2018
@phoenix128
Copy link
Contributor

Hello @samuelecarpene ,
we were unable to reproduce this issue, can you provide additional information?

@scottsb
Copy link

scottsb commented Jan 24, 2018

We saw the same issue. I wasn't able to identify the pattern exactly, but it seemed to happen after a deploy. I'm not sure if it's the recompliation, static deploy or cache flush that would trigger it. After a few page loads it would seem to go away.

@maqlec
Copy link
Contributor

maqlec commented Mar 9, 2018

I think I know where problem is. Your plugin is applied too deep on Zend Response guts where Magento area code is not set yet at least in production mode.

@jefflenz
Copy link

Same issue. Disabled this module and my store works now.

@phoenix128
Copy link
Contributor

Yes, the issue is confirmed on 2.2, we are working on that

@magefan
Copy link

magefan commented May 15, 2018

the same issue with the extension when enabling maintenance mode.

@phoenix128
Copy link
Contributor

So sorry for making you wait for so long time. We had crazy time :)
Thanks to @maqlec , this issue should be fixed.

@cavalier79
Copy link

Does this issue have been solved? We also need it.
Thanks!

@jissereitsma
Copy link
Contributor

I had the same issue today: When the maintenance mode is enabled (in either Production Mode or Developer Mode) this error pops up, hiding the actual message that is given by the maintenance mode itself.

However, I don't think this necessarily needs a fix: In the Developer Mode, you don't need a maintenance mode - perhaps the docs of DevTools could just give a hint that the maintenance mode doesn't work well with the DevTools extension. And in the Production Mode, you should not use the DevTools extension anyway! The extension should be added to the require-dev section, not the require section.

@jonasGossiaux
Copy link

We also experience this issue on our development sites, we run 2.3.1.
The issue occurs every time we perform a setup:upgrade or a cache clean.
It also prevents us from accessing the admin side of our site.

@VernonGrant
Copy link

After you set bin/magento maintenance:enable in both development or production, this error is thrown.

@stephen-larkbury
Copy link

Any update on a fix for this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests