Comments (10)
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.
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.
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.
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.
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.
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.
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.
Everything seems to be working.
Thank you again for the quick fix.
from eightpointsguzzlebundle.
You are welcome. Thanks also.
from eightpointsguzzlebundle.
Everything works fine here too. Thank you
from eightpointsguzzlebundle.
Related Issues (20)
- Possibility to log request and response in separate logs HOT 3
- [Feature Request] Custom Log Formats HOT 2
- User Deprecated: Since symfony/routing 5.1: The "Symfony\Component\Routing\RouteCollectionBuilder" class is deprecated, use "Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator" instead HOT 2
- Get EntityManager in guzzle plugin HOT 1
- Autowiring GuzzleHttp\ClientInterface does not work out of the box (as per documentation) HOT 4
- No information in Guzzle Profiler tab HOT 3
- Can't set cookies to a file path in config HOT 1
- A log channel by client HOT 1
- Composer description is outdated HOT 2
- Feature request: more information in the PostTransactionEvent
- feature request: allow to configure middleware on the handler
- A log without a message is not allowed by some log services
- Setting CURLMOPT_ options
- Security dependant bots alert in guzzlehttp/guzzle HOT 1
- Guzzle Logger is leaking in long running scripts
- Error since the support of guzzlehttp/promises v2 HOT 3
- User Deprecated in EightPoints\Bundle\GuzzleBundle\DataCollector\HttpDataCollector method collect() HOT 3
- Possibility of using callbacks to configure middlewares. HOT 1
- Error "Argument #1 ($reason) must be of type Exception, TypeError given" HOT 1
- Allow Symfony 7 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eightpointsguzzlebundle.