Code Monkey home page Code Monkey logo

Comments (10)

florianpreusner avatar florianpreusner commented on June 3, 2024

Hi,

thanks for your information.

  • Which version of bundle are you using?
  • Can you provide some snippets of code to see how you are using Guzzle with PDO objects?

Best regards
Florian

from eightpointsguzzlebundle.

nurikabe avatar nurikabe commented on June 3, 2024

Seeing the same thing here: Seems to be crashing when rendering a controller:

{{ render(controller('Bundle:Controller:action')) }}

from within Twig.

I haven't dug much deeper than this but I'm going to guess that GuzzleBundle needs to be aware of a master request versus a sub-request when serializing.

We've been using dev-master until now.

from eightpointsguzzlebundle.

p-bizouard avatar p-bizouard commented on June 3, 2024

Same here. I just installed the bundle (dev-master), and when I enable it, I got this :

Exception in DataCollector.php line 35:
Serialization of 'Closure' is not allowed
in DataCollector.php line 35
at SplObjectStorage->serialize()
at serialize(array('logs' => array('http://****/app_dev.php/admin/login' => object(LogGroup)), 'callCount' => '0')) in DataCollector.php line 35
at DataCollector->serialize()
at serialize(array('token' => 'd6c559', 'parent' => null, 'children' => array(), 'data' => array('form' => object(FormDataCollector), 'config' => object(ConfigDataCollector), 'request' => object(RequestDataCollector), 'ajax' => object(AjaxDataCollector), 'exception' => object(ExceptionDataCollector), 'events' => object(EventDataCollector), 'logger' => object(LoggerDataCollector), 'time' => object(TimeDataCollector), 'memory' => object(MemoryDataCollector), 'router' => object(RouterDataCollector), 'security' => object(SecurityDataCollector), 'swiftmailer' => object(MessageDataCollector), 'db' => object(DoctrineDataCollector), 'guzzle' => object(HttpDataCollector), 'ladybug' => object(LadybugDataCollector)), 'ip' => '195.132.182.57', 'method' => 'GET', 'url' => 'http://******/app_dev.php/admin/login', 'time' => '1432054784')) in FileProfilerStorage.php line 153
at FileProfilerStorage->write(object(Profile)) in Profiler.php line 119
at Profiler->saveProfile(object(Profile)) in ProfilerListener.php line 139
at ProfilerListener->onKernelTerminate(object(PostResponseEvent), 'kernel.terminate', object(TraceableEventDispatcher))
at call_user_func(array(object(ProfilerListener), 'onKernelTerminate'), object(PostResponseEvent), 'kernel.terminate', object(TraceableEventDispatcher)) in WrappedListener.php line 61
at WrappedListener->__invoke(object(PostResponseEvent), 'kernel.terminate', object(ContainerAwareEventDispatcher))
at call_user_func(object(WrappedListener), object(PostResponseEvent), 'kernel.terminate', object(ContainerAwareEventDispatcher)) in classes.php line 1790
at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener)), 'kernel.terminate', object(PostResponseEvent)) in classes.php line 1723
at EventDispatcher->dispatch('kernel.terminate', object(PostResponseEvent)) in classes.php line 1884
at ContainerAwareEventDispatcher->dispatch('kernel.terminate', object(PostResponseEvent)) in TraceableEventDispatcher.php line 112
at TraceableEventDispatcher->dispatch('kernel.terminate', object(PostResponseEvent)) in bootstrap.php.cache line 2995
at HttpKernel->terminate(object(Request), object(Response)) in bootstrap.php.cache line 2357
at Kernel->terminate(object(Request), object(Response)) in app_dev.php line 31

My page is fully loaded, I see the template results, but at the end of the page an exception is thrown.
When I disable the bundle, everything works fine.

Cache cleared, not any Guzzle function called, cookies cleared

from eightpointsguzzlebundle.

florianpreusner avatar florianpreusner commented on June 3, 2024

I have tried to reproduce this bug but I'm not able to get this exception. I tested using rendering a controller inside a twig template. I got a Guzzle request inside this controller, also one in the main controller. I'm getting no error. All classes inside this bundle are not using closures.

Using PHP 5.5.10 and Symfony 2.6.7.

Can someone try to deactivate using "Request" in collect function in HttpDataCollector? Or providing some snippets of code that I'm able to reproduce.

from eightpointsguzzlebundle.

respinoza avatar respinoza commented on June 3, 2024

Florian,

If I pull the latest commit and disabled the Request by commenting out the line 65 in HttpDataCollector
$logGroup->setRequest($request);

No PDO Exception was thrown.
Now, I don't have a snippet but the problem arises when a Request attribute is an entity.

Specifically, I am seeing this problem in a sub-request (fragment) as my controller action is expecting an object of type X, like:

SomeController::someAction(Request $request, MyObject $object)

from eightpointsguzzlebundle.

florianpreusner avatar florianpreusner commented on June 3, 2024

Now the collector is just storing a name of the request instead of the whole object. This should fix the issue. Please verify so I can create a new tag/version. Thanks!

from eightpointsguzzlebundle.

respinoza avatar respinoza commented on June 3, 2024

Thank you for the quick fix.
I pulled your changes and started running the tests from my application. I will let you know in an hour if everything worked as expected.

from eightpointsguzzlebundle.

respinoza avatar respinoza commented on June 3, 2024

Everything seems to be working.

Thank you again for the quick fix.

from eightpointsguzzlebundle.

florianpreusner avatar florianpreusner commented on June 3, 2024

You are welcome. Thanks also.

from eightpointsguzzlebundle.

p-bizouard avatar p-bizouard commented on June 3, 2024

Everything works fine here too. Thank you

from eightpointsguzzlebundle.

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.