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

Area Code is already set. #296

Open
vipul-evrig opened this issue May 10, 2024 · 7 comments
Open

Area Code is already set. #296

vipul-evrig opened this issue May 10, 2024 · 7 comments

Comments

@vipul-evrig
Copy link

vipul-evrig commented May 10, 2024

Environment details

PHP version: 8.1.25
Magento version: 2.4.5-p7
Klaviyo extension version: 4.1.0
Anything else that would help a developer reproduce the bug?

Steps to reproduce

Hi,

Error : area code is already set when we run consumers queue command on terminal.

eg. php n98-magerun2.phar queue:consumers:start exportProcessor

It will give the error from bellow code -

Path: vendor/klaviyo/magento2-extension/Helper/ScopeSetting.php
Line no: 63
Code: $this->_state->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML);

Please look into this and provide solution as soon as possible.
Screenshot from 2024-05-10 10-41-56

Expected result

It should properly working with consumer queue.

Actual result

Error : area code is already set when we run consumers queue command on terminal.

eg. php n98-magerun2.phar queue:consumers:start exportProcessor

It will give the error from bellow code -

Path: vendor/klaviyo/magento2-extension/Helper/ScopeSetting.php
Line no: 63
Code: $this->_state->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML);

Please look into this and provide solution as soon as possible.

Additional information

No response

@kamidzi-klaviyo-integrations
Copy link
Contributor

@vipul-evrig - I am not able to reproduce this. Do you have something specific in your configurations that may assist in reproducing? Could you post the output of running queue:consumers:start with -vvv flag?

@vipul-evrig
Copy link
Author

Hello Sir,

I have attached a log file as per your request.

Also I have attached a video on how to reproduce the issue for this.

Please look into this and provide a solution as soon as possible.

Area-Code-is-already-set-Issue-296-klaviyo-magento2-klaviyo-14may2024.mp4

Area-Code-is-already-set-Issue-296-klaviyo-magento2-klaviyo-14may2024.txt

@kamidzi-klaviyo-integrations
Copy link
Contributor

@vipul-evrig - Just to update you; looking at this, it does appear that there is a method checkAreaCode which has side-effect of attempting to set the Area Code. We are investigating further.

@vipul-evrig
Copy link
Author

vipul-evrig commented May 20, 2024

Hello Sir,

Thank you for your replied.

Please investigate and provide solution.

@cykolln
Copy link
Contributor

cykolln commented May 21, 2024

@vipul-evrig Thanks for raising - we are unable to recreate locally on the same version of magento with the same version of klaviyo extension installed. Can you be more specific about what export jobs you are trying to run, this will help us recreate and put out a fix.

@vipul-evrig
Copy link
Author

Hello Dear,

We are using below export job command in terminal.

php n98-magerun2.phar queue:consumers:start exportProcessor

Also you can try below command
bin/magento queue:consumers:start exportprocessor

Please look into this and provide solution.

Thanks,

@cykolln
Copy link
Contributor

cykolln commented May 23, 2024

@vipul-evrig I understand that you are trying to run the export job command. However running the same command we are unable to recreate unless we know what specific resources are being exported. Please respond with which entity type you are trying to export:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants