Skip to content

Conversation

@dannynimmo
Copy link
Contributor

I am getting "Area code is already set" on my installation. This fix catches the exception and allows the process to continue on.

@convenient
Copy link
Contributor

Hello @dannynimmo

Thank you for the PR. This would imply that the constructor of one of your other console commands is calling "setAreaCode" which is conflicting with this bit of code.

I'm happy to merge this, however before I do that I need to verify that this code is still functioning properly

https://github.com/pepe1518/magento2/blob/89adbabc2a295c9b6f88768d541fd2858f59aae5/vendor/magento/module-encryption-key/Model/ResourceModel/Key/Change.php#L144

Seeing as I cannot replicate the issue with your Instance could you please put a breakpoint at the above line, and verify that the $paths variable is not empty? It needs to have correctly initialised as adminhtml to be functional which should be sufficient with the app emulation call, but good to check.

Thanks

@dannynimmo
Copy link
Contributor Author

Hey @convenient that's good insight, thanks for that. I will dig into our commands to track that down.

FWIW I've checked and confirmed $paths is all good:
Screenshot 2024-07-23 at 7 44 18 PM

@convenient
Copy link
Contributor

Thanks for testing @dannynimmo that looks sensible to me.

You may also be interested in this module https://github.com/run-as-root/magento-cli-auto-proxy, I have not tested it, but it aims to make all the console commands inject their dependencies as proxy. Which may help in your situation but i'm not sure.

@convenient convenient merged commit 8f231e1 into genecommerce:master Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants