Zend certified PHP/Magento developer

bulk product attribute update error with Area code is already set

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?