Giter Site home page Giter Site logo

The service "sonata.block.renderer.traceable" has a dependency on a non-existent service "debug.stopwatch" about sonatablockbundle HOT 19 CLOSED

sonata-project avatar sonata-project commented on August 16, 2024
The service "sonata.block.renderer.traceable" has a dependency on a non-existent service "debug.stopwatch"

from sonatablockbundle.

Comments (19)

lsmith77 avatar lsmith77 commented on August 16, 2024

do you not have the WebProfilerBundle enabled?

from sonatablockbundle.

lsmith77 avatar lsmith77 commented on August 16, 2024

hmm reading the code it shouldnt matter:

        if (!$config['profiler']['enabled']) {
            $container->setAlias('sonata.block.renderer', 'sonata.block.renderer.default');

            $container->removeDefinition('sonata.block.renderer.traceable');

            return;
        }

from sonatablockbundle.

lsmith77 avatar lsmith77 commented on August 16, 2024

ah .. imho this should additionally check if the bundle is enabled similar to how we check for the SonataAdminBundle here https://github.com/symfony-cmf/MenuBundle/blob/master/DependencyInjection/SymfonyCmfMenuExtension.php#L70

from sonatablockbundle.

dkorsak avatar dkorsak commented on August 16, 2024

Yes I have WebProfilerBundle enabled

Service debug.stopwatch is visible in command line (app/console container:debug)

from sonatablockbundle.

lsmith77 avatar lsmith77 commented on August 16, 2024

i assume you have tried to manually clear your cache?

from sonatablockbundle.

dkorsak avatar dkorsak commented on August 16, 2024

yes

from sonatablockbundle.

lsmith77 avatar lsmith77 commented on August 16, 2024

for the correct environment? the error message you pasted simply cannot happen if you do have the debug.stopwatch service. so this doesnt point to an issue in the bundle per se but rather that there is some inconsistency.

from sonatablockbundle.

smoove avatar smoove commented on August 16, 2024

I have the same problem, in the dev environment, everything works fine, in the prod environment the above error is thrown.

Also when clearing the cache, this one works:
app/console cache:clear --env=prod

This one triggers the error:
app/console cache:clear --env=prod --no-debug

I guess the stopwatch service is not available in the prod environment.

from sonatablockbundle.

lsmith77 avatar lsmith77 commented on August 16, 2024

aha! .. so you dont have the profiler enabled but you do have profiling enabled in sonata block bundle.

from sonatablockbundle.

lsmith77 avatar lsmith77 commented on August 16, 2024

but this is a bit trickier to check for without a compiler pass. i can submit a fix that makes the service optional but it would still mean that people have profiling enabled without actually being able to profile

from sonatablockbundle.

smoove avatar smoove commented on August 16, 2024

I really don't understand. I use the block bundle "passively", as it's needed for sonata-admin. I did not "enable profiling" or configure anything related to the block bundle.

from sonatablockbundle.

lsmith77 avatar lsmith77 commented on August 16, 2024

profiling is enabled by default when you are in debug mode. however in prod it should be disabled and therefore this trace service shouldnt even be used. so from my point of view you either enabled debugging in prod or you did infact set profiling to enabled in the block bundle.

from sonatablockbundle.

lsmith77 avatar lsmith77 commented on August 16, 2024

at any rate .. can you try this PR #61 ?

from sonatablockbundle.

smoove avatar smoove commented on August 16, 2024

Yeah, that fixes it. I can clear the cache with "--no-debug" and the page does not throw the error in the prod environment anymore.

from sonatablockbundle.

dkorsak avatar dkorsak commented on August 16, 2024

Im waiting for merge PR

from sonatablockbundle.

rande avatar rande commented on August 16, 2024

done

from sonatablockbundle.

BraisGabin avatar BraisGabin commented on August 16, 2024

The problem lies not in the console only: http://stackoverflow.com/q/16563442/842697

I fix it merging manually #61. How could I get the fix with composer? (Sorry if this is offtopic)

from sonatablockbundle.

Maxwell2022 avatar Maxwell2022 commented on August 16, 2024

Same here can you release 2.2.2 because this is an issue happening in production env?

from sonatablockbundle.

Maxwell2022 avatar Maxwell2022 commented on August 16, 2024

It's been fixed in 2.2.3, thanks ;)

from sonatablockbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.