Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running multiple customer:createin script fails with "Area code is already set" #1414

Closed
DanieliMi opened this issue Feb 22, 2024 · 3 comments
Assignees
Labels
bug reproduced Issue could be reproduced

Comments

@DanieliMi
Copy link

Describe the bug

We are trying to create a test customer for every website via script (script seems to be slightly more performant than separate calls). But after creating the first customer it fails with the message "Area code is already set".

$ printf "customer:create customer@imi.dev Dev123456789# Dev Customer 1\ncustomer:create customer@imi.dev Dev123456789# Dev Customer 2\ncustomer:create customer@imi.dev Dev123456789# Dev Customer 3" | n98-magerun2 script
Customer customer@imi.dev successfully created
Area code is already set
Area code is already set

Expected behaviour

All customers are created.

Steps to reproduce the issue

Run the following command:

printf "customer:create customer@imi.dev Dev123456789# Dev Customer 1\ncustomer:create customer@imi.dev Dev123456789# Dev Customer 2\ncustomer:create customer@imi.dev Dev123456789# Dev Customer 3" | n98-magerun2 script

Technical details

  • Host Machine OS (Windows/Linux/Mac): Ubuntu 20.04
  • Magento 2.4.6-p3
  • n98-magerun2 Version: Tested on 7.0.3 and 7.3.1

Possible Fix

Additional context

@DanieliMi DanieliMi added the bug label Feb 22, 2024
@cmuench cmuench added the reproduced Issue could be reproduced label Feb 22, 2024
@cmuench cmuench self-assigned this Feb 22, 2024
cmuench added a commit to cmuench/n98-magerun2 that referenced this issue Feb 22, 2024
It's not really possible to find a really good solution to
prevent this error.
@amenk
Copy link
Contributor

amenk commented Feb 22, 2024

Wow 🏎️

cmuench added a commit to cmuench/n98-magerun2 that referenced this issue Feb 22, 2024
cmuench added a commit that referenced this issue Feb 22, 2024
It's not really possible to find a really good solution to
prevent this error.
cmuench added a commit that referenced this issue Feb 22, 2024
@cmuench
Copy link
Member

cmuench commented Feb 22, 2024

@DanieliMi I added a fix. You can test it in the unreleased version by updating to it with n98-magerun2.phar self-update --unstable.

@DanieliMi
Copy link
Author

@cmuench thank you for the quick fix! I can confirm this issue is fixed in the latest unstable version:

 [Exec] Running echo 'customer:create customer@imi.dev Dev123456789# Dev Customer 1
customer:create customer@imi.dev Dev123456789# Dev Customer 2
customer:create customer@imi.dev Dev123456789# Dev Customer 3
'| ./n98-magerun2.phar --no-interaction script
Customer customer@imi.dev successfully created
Customer customer@imi.dev successfully created
Customer customer@imi.dev successfully created
 [Exec] Done in 11.705s

@cmuench cmuench closed this as completed Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug reproduced Issue could be reproduced
Projects
None yet
Development

No branches or pull requests

3 participants