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

bug: Update to SF6.1-RC leads to serialization type error on NotificationTaskBagNormalizer #259

Closed
nfragnet opened this issue May 25, 2022 · 9 comments · Fixed by #260
Closed
Assignees
Labels
bug Something isn't working PHP

Comments

@nfragnet
Copy link

Sf version: 6.1-RC
SchedulerBundle version: 0.9.2

On any web page loading I got the following error:

TypeError:
SchedulerBundle\Serializer\NotificationTaskBagNormalizer::__construct(): Argument symfony/symfony#1 ($objectNormalizer) must be of type Symfony\Component\Serializer\Normalizer\ObjectNormalizer, Symfony\Component\Serializer\Debug\TraceableNormalizer given, called in /var/www/html/var/cache/dev/ContainerA8SsNH6/App_KernelDevDebugContainer.php on line 3130

  at /var/www/html/vendor/guikingone/scheduler-bundle/src/Serializer/NotificationTaskBagNormalizer.php:22
  at SchedulerBundle\Serializer\NotificationTaskBagNormalizer->__construct(object(TraceableNormalizer))
     (/var/www/html/var/cache/dev/ContainerA8SsNH6/App_KernelDevDebugContainer.php:3130)
  at ContainerA8SsNH6\App_KernelDevDebugContainer->getDebug_SerializerService()
     (/var/www/html/var/cache/dev/ContainerA8SsNH6/App_KernelDevDebugContainer.php:3569)
  at ContainerA8SsNH6\App_KernelDevDebugContainer->getScheduler_ConfigurationService()
     (/var/www/html/var/cache/dev/ContainerA8SsNH6/App_KernelDevDebugContainer.php:3602)
  at ContainerA8SsNH6\App_KernelDevDebugContainer->getScheduler_TransportService()
     (/var/www/html/var/cache/dev/ContainerA8SsNH6/App_KernelDevDebugContainer.php:2371)
  at ContainerA8SsNH6\App_KernelDevDebugContainer->getSchedulerService()
     (/var/www/html/var/cache/dev/ContainerA8SsNH6/App_KernelDevDebugContainer.php:2310)
  at ContainerA8SsNH6\App_KernelDevDebugContainer->getTaskSubscriberService()
     (/var/www/html/var/cache/dev/ContainerA8SsNH6/App_KernelDevDebugContainer.php:1749)
  at ContainerA8SsNH6\App_KernelDevDebugContainer->ContainerA8SsNH6\{closure}()
     (/var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:245)
  at Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('kernel.request')
     (/var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:76)
  at Symfony\Component\EventDispatcher\EventDispatcher->getListeners('kernel.request')
     (/var/www/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:283)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->preProcess('kernel.request')
     (/var/www/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:147)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(RequestEvent), 'kernel.request')
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:128)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (/var/www/html/vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (/var/www/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (/var/www/html/vendor/autoload_runtime.php:29)
  at require_once('/var/www/html/vendor/autoload_runtime.php')
     (/var/www/html/public/index.php:5)

It may be related to the following: symfony/symfony#45656

@Guikingone Guikingone self-assigned this May 26, 2022
@Guikingone Guikingone added bug Something isn't working PHP labels May 26, 2022
@Guikingone
Copy link
Owner

Guikingone commented May 26, 2022

Hi @nfragnet 👋🏻

Sorry for the delay, could you check via dev-issue/259 if it fix the issue?

Thanks 🙂

@alessandro-podo
Copy link

i have Tested it after upgrade.

SchedulerBundle\EventListener\TaskSubscriber::__construct(): Argument symfony/symfony#4 ($serializer) must be of type Symfony\Component\Serializer\Serializer, Symfony\Component\Serializer\Debug\TraceableSerializer given, called in /var/www/html/netw-tools/var/cache/dev/ContainerWuUwmEU/App_KernelDevDebugContainer.php on line 1870

i got now this Error

@nfragnet
Copy link
Author

nfragnet commented May 30, 2022

Tested (on stable 6.1.0) & got the same issue as @alessandro-podo

Check the related ticket on Symfony repo

@Guikingone
Copy link
Owner

Guikingone commented May 30, 2022

Hi @nfragnet and @alessandro-podo 👋🏻

Sorry for the delay, I've pushed an update regarding the Serializer usage in TaskSubscriber, should be better now.

Regarding the issue and PR, should we fix it now or wait for symfony/symfony#46509 to be merged?

As we're under an RC period, maybe we could wait the merge and rebase this PR? WDYT? 🤔

@alessandro-podo
Copy link

No problem, we have time.
After 6.1 was officially released we are no longer at the RC.

I think you can wait it out, will then probably come with 6.1.1, which is coming soon.

@Guikingone
Copy link
Owner

Guikingone commented May 30, 2022

Nice catch on the RC period, didn't see the release 😅

I think it's better to wait for 6.1.1 regarding the issue of the __call method, the serializer call be easily be solved (and will be solved using another PR just for 0.9.3), regarding the normalizers/denormalizers, as the regression comes from Symfony and will be fixed, it's better IMHO to wait for the fix and improve the base code of the bundle according.

@Guikingone
Copy link
Owner

Hi 👋🏻

Small update, the serializer usage issue has been merged into main, regarding the Traceable* issue, I pushed an update on dev-issue/259, it seems to solve the issue (tested locally), the __call() usage seems to be an edge issue (the fix has been merged into 6.1 branch BTW) that we can solve in the bundle without breaking the API.

Could you test dev-issue/259 and see if it fix the issue in your projects? Thanks 🙂

@nfragnet
Copy link
Author

nfragnet commented Jun 1, 2022

It seems to fix the issue thank you.

While you're at it, you may also want to already add the context parameters to methods supportsNormalization && supportsDenormalization to handle the following deprecation notice for all your instances of NormalizerInterface & DenormalizerInterface

The "SchedulerBundle\Serializer\TaskNormalizer::supportsNormalization()" method will require a new "array $context" argument in the next major version of its interface "Symfony\Component\Serializer\Normalizer\NormalizerInterface", not defining it is deprecated.

@Guikingone
Copy link
Owner

Thanks for the fix confirmation 🚀

Regarding the deprecation, I think its better to plan it for 0.9.4 or even 0.10.0 as it's related to Symfony 7.0 (which requires 8.1 by default, this will break the current support for 8.0), be sure that this deprecation notice will be handled 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PHP
Projects
None yet
3 participants