1

Trying to do a bulk product attribute update in the magento GUI and feedback is that the message is queued. Messages in the database table queue_message seem right, the logs and a manual php bin/magento cron:run have the message:

queue:consumers:start [--max-messages MAX-MESSAGES] [--batch-size BATCH-SIZE] [--area-code AREA-CODE] [--pid-file-path PID-FILE-PATH] [--]

In State.php line 136:

Area code is already set

So for now I've commented out that check in /http/vendor/magento/framework/App/State.php and the jobs run.

It does not seem right to hack the magento core code, but I have done this before for php bin/magento catalog:images:resize for that specific job to skip that and it worked fine - but that was a job I'd expect to run one time only and could revert the change. This is required to be constantly running and to process exports and attribute updates.

Is there any advice you could give me to get this feature working without having to hack the core please?

1
  • Hi @wesleywmd sorry for the delay, this went away as I'd actually disabled the module that had this in... and then it's come back as it's disabled... so thank you very much for the advice and if you'd like to put that as the answer then I can accept it :)
    – Barry
    Dec 30, 2019 at 15:06

2 Answers 2

2

This is usually due to some other bit of code setting the areaCode before core is trying to set it. Usually because it is trying to be set in __construct() some where. With how dependency injection works, all objects are loaded and their constructors are ran, even if your not using that object. I would check that the areaCode is not being set in a __construct()

1

I got same issue and i have fixed it by follow instruction in below link

https://support.klevu.com/knowledgebase/resolving-area-code-already-set/

Hope it helps to others

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.