Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Exception M 2.1.6: Area code is already set. #13

Open
lfritsche opened this issue May 19, 2017 · 5 comments
Open

Exception M 2.1.6: Area code is already set. #13

lfritsche opened this issue May 19, 2017 · 5 comments

Comments

@lfritsche
Copy link

Regenerating Magento 2.1.6 Image cache by running command bin/magento catalog:images:resize leads to the following exception with this module enabled:

  [Magento\Framework\Exception\LocalizedException]  
  Area code is already set                          
                                                    


catalog:images:resize

Simply deactivate bin/magento module:disable Iazel_RegenProductUrl and the resize prozess proceeds.

@nkajic
Copy link

nkajic commented May 31, 2017

Confirming

@aaronware
Copy link

Some insight into the issue. magento/magento2#5285 Looks like it's due to the setAreaCode being used within the constructor of the module

@nkajic
Copy link

nkajic commented Jun 1, 2017

Yup, works without setAreaCode('adminhtml') and I don't see any point for it since it is always run from CLI

grafikchaos pushed a commit to grafikchaos/magento2-regenurl that referenced this issue Jun 7, 2017
Avoids the LocalizedException error message 'Area code is already set'
by first checking to see if the area code is set or not. If area code is
not set, then set it to 'adminhtml'
@grafikchaos
Copy link
Contributor

See PR #15 for fixed version

iazel pushed a commit that referenced this issue Aug 12, 2017
Fix Area code is already set

Avoids the LocalizedException error message 'Area code is already set'
by first checking to see if the area code is set or not. If area code is
not set, then set it to 'adminhtml'
grafikchaos pushed a commit to grafikchaos/magento2-regenurl that referenced this issue Nov 21, 2017
@peterjaap
Copy link

This is fixed in my fork, amongst other issues https://github.com/peterjaap/magento2-regenurl

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

No branches or pull requests

5 participants