magento2-regenurl icon indicating copy to clipboard operation
magento2-regenurl copied to clipboard

Exception M 2.1.6: Area code is already set.

Open lfritsche opened this issue 7 years ago • 5 comments

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.

lfritsche avatar May 19 '17 18:05 lfritsche

Confirming

nkajic avatar May 31 '17 15:05 nkajic

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

aaronware avatar Jun 01 '17 17:06 aaronware

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

nkajic avatar Jun 01 '17 17:06 nkajic

See PR #15 for fixed version

grafikchaos avatar Jun 07 '17 19:06 grafikchaos

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

peterjaap avatar Feb 22 '18 16:02 peterjaap