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

Non-existent service "rekalogika.mapper.cache.property_info" #47

Closed
rsavuliak-macpaw opened this issue Apr 23, 2024 · 4 comments · Fixed by #50
Closed

Non-existent service "rekalogika.mapper.cache.property_info" #47

rsavuliak-macpaw opened this issue Apr 23, 2024 · 4 comments · Fixed by #50

Comments

@rsavuliak-macpaw
Copy link

rsavuliak-macpaw commented Apr 23, 2024

Just after installation of your package I got an error while running cache:clear:

In DecoratorServicePass.php line 88:
                                                                                                                                             
  The service "rekalogika.mapper.cache.property_info.traceable" has a dependency on a non-existent service "rekalogika.mapper.cache.propert  
  y_info". 

Symfony version 7, package version 1.1.1, environment: dev, installed with Flex, APP_DEBUG: true

Seems the reason is in DebugPass, which removes this definition from container if app_debug is enabled. But on dev environment I obviously have it enabled...

@priyadi
Copy link
Member

priyadi commented Apr 23, 2024

I cannot reproduce the error from a clean install:

symfony new --webapp test
cd test
composer require rekalogika/mapper

You probably have another bundle decorating the service. Try running this:

bin/console debug:container rekalogika.mapper.cache.property_info.traceable

If it gives an error, try editing DebugPass.php and comment out the removeDefinition() lines.

@rsavuliak-macpaw
Copy link
Author

rsavuliak-macpaw commented Apr 23, 2024

Exception trace:

In DecoratorServicePass.php line 88:
                                                                                                                                             
  [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]                                                                 
  The service "rekalogika.mapper.cache.property_info.traceable" has a dependency on a non-existent service "rekalogika.mapper.cache.propert  
  y_info".                                                                                                                                   
                                                                                                                                             

Exception trace:
  at /app/device/vendor/symfony/dependency-injection/Compiler/DecoratorServicePass.php:88
 Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass->process() at /app/device/vendor/symfony/dependency-injection/Compiler/Compiler.php:73
 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /app/device/vendor/symfony/dependency-injection/ContainerBuilder.php:750
 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /app/device/vendor/symfony/http-kernel/Kernel.php:488
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /app/device/vendor/symfony/http-kernel/Kernel.php:725
 Symfony\Component\HttpKernel\Kernel->preBoot() at /app/device/vendor/symfony/http-kernel/Kernel.php:123
 Symfony\Component\HttpKernel\Kernel->boot() at /app/device/vendor/symfony/framework-bundle/Console/Application.php:179
 Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() at /app/device/vendor/symfony/framework-bundle/Console/Application.php:71
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /app/device/vendor/symfony/console/Application.php:169
 Symfony\Component\Console\Application->run() at /app/device/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /app/device/vendor/autoload_runtime.php:29
 require_once() at /app/device/bin/console:11

debug:container

 ./bin/console debug:container rekalogika.mapper.cache.property_info.traceable     

Information for Service "rekalogika.mapper.cache.property_info.traceable"
=========================================================================

 This implementation of a cache adapter supports the distributed tracing feature of Sentry.

 ---------------- ------------------------------------------------------------------------------------------------------------------------------- 
  Option           Value                                                                                                                          
 ---------------- ------------------------------------------------------------------------------------------------------------------------------- 
  Service ID       rekalogika.mapper.cache.property_info.traceable                                                                                
  Class            Sentry\SentryBundle\Tracing\Cache\TraceableCacheAdapter                                                                        
  Tags             cache.pool                                                                                                                     
                   kernel.reset (method: reset)                                                                                                   
                   container.decorator (id: rekalogika.mapper.cache.property_info, inner: rekalogika.mapper.cache.property_info.traceable.inner)  
  Public           no                                                                                                                             
  Synthetic        no                                                                                                                             
  Lazy             no                                                                                                                             
  Shared           yes                                                                                                                            
  Abstract         no                                                                                                                             
  Autowired        no                                                                                                                             
  Autoconfigured   no                                                                                                                             
  Usages           rekalogika.mapper.cache.property_info                                                                                          
                   services_resetter                                                                                                              
                   cache.system_clearer                                                                                                           
                   cache.global_clearer                                                                                                           
                   rekalogika.mapper.property_info.cache                                                                                          
 ---------------- ------------------------------------------------------------------------------------------------------------------------------- 

@rsavuliak-macpaw
Copy link
Author

Reordering bundle with SentryBundle fixed the problem. Not sure if it's expected behaviour or not )

@priyadi
Copy link
Member

priyadi commented Apr 24, 2024

It should be fixed with #50

Previously, it sets property info caching, and removes it if debug is enabled. Now it doesn't set caching by default, only enabling it if debug is disabled.

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

Successfully merging a pull request may close this issue.

2 participants