Skip to content
New issue

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

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

Already on GitHub? # to your account

Class Magento\Framework\Serialize\Serializer\Json does not exist when installing Smile 2.3.8 #559

Closed
genyuk opened this issue Oct 9, 2017 · 5 comments

Comments

@genyuk
Copy link

genyuk commented Oct 9, 2017

We were using Smile-Sa 2.4.x-dev which was working. After recent commits we can't use composer to updeate it, so we reverted to Smile 2.3.8 (we set ^2.3 in composer).
When we recompile, redeploy, clear all possible caches we are getting an error on any page (fron-end or back-end

Magento Version :
Magento 2.1.9 CE

ElasticSuite Version :
2.4.6

Environment : Production or Developer

Third party modules :
quite long list

Steps to reproduce

Install Smile-SA 2.4.x-dev, them downgrade to Smile-SA:2.3.8

Expected result

The store should open

Actual result

After successful recompilation (no errors during redeployment) and all cache clear we are getting this error on any page of the store:
Fatal error: Uncaught Error: Class 'Magento\Framework\Serialize\Serializer\Json' not found in /var/www/svm/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93 Stack trace: #0 /var/www/svm/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Framewo...', Array) #1 /var/www/svm/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\Framewo...') #2 /var/www/svm/pub/errors/processor.php(148): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...') #3 /var/www/svm/pub/errors/processorFactory.php(26): Magento\Framework\Error\Processor->__construct(Object(Magento\Framework\App\Response\Http\Interceptor)) #4 /var/www/svm/pub/errors/report.php(10): Magento\Framework\Error\ProcessorFactory->createProcessor() #5 /var/www/svm/vendor/magento/framework/App/Http.php(323): require('/var/www/svm/pu...') #6 /var/www/svm/vendor/magento/framew in /var/www/svm/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93

Any ideas what can cause it?

@romainruaud
Copy link
Collaborator

@genyuk one cannot simply downgrade a Magento 2 module. By downgrading Elasticsuite you will face following issues :

  • Magento saying that the required version of ElasticsuiteCatalog is "1.2.1" when installed version is "1.2.2"
  • the DI will be broken until you clear the DI cache and the "var/generation" or "/generated" directory.

It's a known limitation of Magento, we cannot provide any working way of downgrading our module.

Regards

@genyuk
Copy link
Author

genyuk commented Oct 9, 2017

Hi.
We don't facing the issues you described and we did clear all kind of pre-generated code including "/var/generation".
As described in issue #547 we can't use composer any longer. Is there are way to continue to use 2.4.x-dev on MAGENTO 2.1.9, maybe with some minor Smile-SA's composer fixes?
We just stuck in the "middle" and can't use our store neither with 2.4 nor with 2.3 Smile-Sa version.

Thank you for your help.

@romainruaud
Copy link
Collaborator

@genyuk I do not understand what you are trying to do.

As explained by @afoucret here is the compatibility matrix :

  • Elasticsuite 2.4.x : Magento >= 2.2.0
  • Elasticsuite 2.3.8 : Magento >= 2.1.0 including 2.20
  • Elasticsuite <2.3.8 : Magento 2.1.x

So if you are using Magento 2.1.9, Elasticsuite 2.3.8 should work fine.

What makes you think that Elasticsuite is requiring Serializer\Json somewhere ? Are you sure this error is coming from Elasticsuite ?

@genyuk
Copy link
Author

genyuk commented Oct 10, 2017

Hi.
Thanks for the version explanation.

When we use Elasticsuite 2.3.8 - we enable modules one by one.
When we enable Smile_ElasticsuiteCore - no errors
next we enable Smile_ElasticsuiteCatalog - and getting this error:

main.CRITICAL: ReflectionException: Class Magento\Framework\Serialize\Serializer\Json does not exist in /var/www/svm/vendor/magento/framework/Code/Reader/ClassReader.php:19
Stack trace:
#0 /var/www/svm/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...')
#1 /var/www/svm/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...')
#2 /var/www/svm/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Framewo...')
#3 /var/www/svm/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')
#4 /var/www/svm/pub/errors/processor.php(148): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')
#5 /var/www/svm/pub/errors/processorFactory.php(26): Magento\Framework\Error\Processor->__construct(Object(Magento\Framework\App\Response\Http\Interceptor))
#6 /var/www/svm/pub/errors/report.php(10): Magento\Framework\Error\ProcessorFactory->createProcessor()
#7 /var/www/svm/vendor/magento/framework/App/Http.php(323): require('/var/www/svm/pu...')
#8 /var/www/svm/vendor/magento/framework/App/Http.php(160): Magento\Framework\App\Http->handleGenericReport(Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\LocalizedException))
#9 /var/www/svm/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\LocalizedException))
#10 /var/www/svm/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#11 {main} [] []

I agree, that is is not clear from this log that it is coming from ElasticSuite, but it happens just if we enable Smile_ElasticsuiteCatalog. When we use older commit of the 2.4.x-dev - no errors like this.

Any ideas?

Thank you for your time.

@romainruaud
Copy link
Collaborator

I did dig a bit on this issue.

the Magento\Framework\Serialize\Serializer\Json appeared in Magento 2.2 (see magento/magento2@363f1ca ) and is not existing in Magento 2.1.9

Did you process an update to Magento 2.2 and then a rollback to 2.1.9 ?

Or maybe when you upgraded to Elasticsuite 2.4.x it did upgrade the Magento Framework package.

In any cases, something is not clear about the versions you are using. It seems you are like "stuck in the middle" between Magento 2.1.9 and 2.2

Do you have any results when searching for "Magento\Framework\Serialize\Serializer\Json" in the source code ? you should not have any occurence if you are using Magento 2.1.9

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

No branches or pull requests

2 participants