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

Magento 2.4.5 compatibility - cron job gigya_offline_sync fails #134

Open
gianstraf opened this issue Dec 29, 2022 · 3 comments
Open

Magento 2.4.5 compatibility - cron job gigya_offline_sync fails #134

gianstraf opened this issue Dec 29, 2022 · 3 comments

Comments

@gianstraf
Copy link

Dear support,
we have a problem with version 6.0 on Magento 2.4.5

The job gigya_offline_sync does not run properly:

This line:

$this->defConfigFilePath = ".." . DIRECTORY_SEPARATOR . "configuration/DefaultConfiguration.json";

seems reference a file that does not exist.
We have patched temporanilly with:
$this->defConfigFilePath = __DIR__."/configuration/DefaultConfiguration.json";

Also, line:
$confArray = json_decode(file_get_contents($this->defConfigFilePath));

should be:
$confArray = json_decode(file_get_contents($this->defConfigFilePath),true);

because the line:
$this->userKey = !empty($userKey) ? $userKey : $confArray['appKey'];

traits variable $confArray as an array.

Could you support us ?

Thank you,
Gianluca

@Ynhockey
Copy link
Collaborator

Hi gianstraf,

Apologies for the delayed response. We are still working on supporting 2.4.5 fully. Some of the problems stem from compatibility issues with newer PHP versions, and not Magento 2.4.5 per se.

You are right about the 2nd part, that json_decode should output an associative array.

About the first part though: can you share what the issue is in your case?
The configuration file is optional, and if you use this option, you can put it in the specific path.
If you configure the module through the UI/Magento API and not with this file, then it can be ignored.
If you're using any kind of strict mode, or just displaying errors on your site, you will get a deprecation notice for passing an empty value into json_decode. We will fix this in the near future, but it shouldn't affect production environments, which don't normally display errors, or block everything that's marked deprecated.

Are you experiencing the deprecation notice, or is there another issue that I didn't mention?

Thanks!

@gianstraf
Copy link
Author

Hi @Ynhockey,
for the 2nd part ok.

For the first error, I report you our console log when we attempt to run manually the cron (via n98magerun):

www-data@dockerprj-php:~/proj/htdocs$ php bin/n98-magerun2.phar sys:cron:run gigya_offline_sync
Run Gigya\GigyaIM\Model\Cron\GigyaOfflineSync::execute PHP Fatal error:  Uncaught Error: Call to a member function searchGigyaUsers() on bool in /var/www/proj/htdocs/app/code/Gigya/GigyaIM/Model/Cron/GigyaOfflineSync.php:121
Stack trace:
#0 /var/www/proj/htdocs/app/code/Gigya/GigyaIM/Model/Cron/GigyaOfflineSync.php(177): Gigya\GigyaIM\Model\Cron\GigyaOfflineSync->searchGigyaUsers()
#1 phar:///var/www/proj/htdocs/bin/n98-magerun2.phar/src/N98/Magento/Command/System/Cron/RunCommand.php(66): Gigya\GigyaIM\Model\Cron\GigyaOfflineSync->execute()
#2 /var/www/proj/htdocs/vendor/symfony/console/Command/Command.php(255): N98\Magento\Command\System\Cron\RunCommand->execute()
#3 phar:///var/www/proj/htdocs/bin/n98-magerun2.phar/src/N98/Magento/Command/AbstractMagentoCommand.php(249): Symfony\Component\Console\Command\Command->run()
#4 phar:///var/www/proj/htdocs/bin/n98-magerun2.phar/vendor/symfony/console/Application.php(1039): N98\Magento\Command\AbstractMagentoCommand->run()
#5 phar:///var/www/proj/htdocs/bin/n98-magerun2.phar/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#6 phar:///var/www/proj/htdocs/bin/n98-magerun2.phar/src/N98/Magento/Application.php(235): Symfony\Component\Console\Application->doRun()
#7 phar:///var/www/proj/htdocs/bin/n98-magerun2.phar/vendor/symfony/console/Application.php(149): N98\Magento\Application->doRun()
#8 phar:///var/www/proj/htdocs/bin/n98-magerun2.phar/src/N98/Magento/Application.php(338): Symfony\Component\Console\Application->run()
#9 /var/www/proj/htdocs/bin/n98-magerun2.phar(8): N98\Magento\Application->run()
#10 {main}
  thrown in /var/www/proj/htdocs/app/code/Gigya/GigyaIM/Model/Cron/GigyaOfflineSync.php on line 121

As you see, the error is a fatal error.
Note that we are using the gigya suite under app/code, to fix these problems temporarily.

Thanks!

@Ynhockey
Copy link
Collaborator

Hi, it was fixed in 6.1.0, please check that it's working for you

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

No branches or pull requests

2 participants