Skip Menu |

This queue is for tickets about the GraphViz2 CPAN distribution.

Report information
The Basics
Id: 98895
Status: resolved
Worked: 3 min
Priority: 0/
Queue: GraphViz2

People
Owner: Nobody in particular
Requestors: andy [...] andybev.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.37



Subject: Exceptions running within Plack
Date: Mon, 15 Sep 2014 12:43:45 +0100
To: bug-GraphViz2 [...] rt.cpan.org
From: Andrew Beverley <andy [...] andybev.com>
Hi, Thanks for fixing my last bug report so quickly. This report is not necessarily a bug, but a problem I'm experiencing and really can't work out the solution. Any help would be appreciated. I'm using Graphviz2 within a web application to generate PDFs on-the-fly. I'm using Dancer2, and everything works well in my development environment. However, as soon as I deploy into Apache, using Plack and Fast CGI, I'm getting an exception which I can't track down. I appreciate this may be a problem with the environment it's running in, but I wondered whether you can suggest any areas to investigate. I'm getting problems when Graphviz2 attempts to open an IO::Handle object, within Capture::Tiny. The first few calls to capture() are successful, as they all refer to temporary files, but in this case "fileno" is returning -1 which then prevents the subsequent call to open(); Here's the trace: Error from open(GLOB(0x7f62febfb308), >&-1): Invalid argument at /usr/local/share/perl/5.14.2/Capture/Tiny.pm line 99. Capture::Tiny::_open(GLOB(0x7f62febfb308), ">&-1") called at /usr/local/share/perl/5.14.2/Capture/Tiny.pm line 186 Capture::Tiny::_open_std(HASH(0x7f63014d95a8)) called at /usr/local/share/perl/5.14.2/Capture/Tiny.pm line 375 Capture::Tiny::_capture_tee(1, 1, 0, 0, CODE(0x7f6301635940)) called at /usr/local/share/perl/5.14.2/GraphViz2.pm line 558 GraphViz2::load_valid_attributes(GraphViz2=HASH(0x7f6301164cb0)) called at /usr/local/share/perl/5.14.2/GraphViz2.pm line 156 GraphViz2::BUILD(GraphViz2=HASH(0x7f6301164cb0), HASH(0x7f630165c088)) called at (eval 2014) line 130 GraphViz2::new("GraphViz2", "edge", HASH(0x7f630252ee40), "global", HASH(0x7f62ff8b0b18), "graph", HASH(0x7f6301725e60), "logger", Log::Handler=HASH(0x7f630257c898), ...) called at /srv/Isaas/bin/../lib/Isaas/Asset.pm line 345 Isaas::Asset::tree("Isaas::Asset") called at /srv/Isaas/bin/../lib/Isaas.pm line 635 Isaas::__ANON__(Dancer2::Core::App=HASH(0x7f62ff379218)) called at /usr/local/share/perl/5.14.2/Dancer2/Core/Route.pm line 142 Dancer2::Core::Route::execute(Dancer2::Core::Route=HASH(0x7f6301f38f60), Dancer2::Core::App=HASH(0x7f62ff379218)) called at /usr/local/share/perl/5.14.2/Dancer2/Core/Dispatcher.pm line 172 eval {...} called at /usr/local/share/perl/5.14.2/Dancer2/Core/Dispatcher.pm line 172 Dancer2::Core::Dispatcher::_dispatch_route(Dancer2::Core::Dispatcher=HASH(0x7f62ff8c74c0), Dancer2::Core::Route=HASH(0x7f6301f38f60), Dancer2::Core::App=HASH(0x7f62ff379218)) called at /usr/local/share/perl/5.14.2/Dancer2/Core/Dispatcher.pm line 67 Dancer2::Core::Dispatcher::__ANON__(CODE(0x7f62ff26e518)) called at /usr/local/share/perl/5.14.2/Return/MultiLevel.pm line 49 Return::MultiLevel::__ANON__() called at /usr/local/share/perl/5.14.2/Return/MultiLevel.pm line 54 Return::MultiLevel::__ANON__(CODE(0x7f62ff87faa8)) called at /usr/local/share/perl/5.14.2/Dancer2/Core/Dispatcher.pm line 68 Dancer2::Core::Dispatcher::dispatch(Dancer2::Core::Dispatcher=HASH(0x7f62ff8c74c0), HASH(0x7f62ffacfec0)) called at /usr/local/share/perl/5.14.2/Dancer2/Core/Runner.pm line 220 eval {...} called at /usr/local/share/perl/5.14.2/Dancer2/Core/Runner.pm line 222 Dancer2::Core::Runner::__ANON__(HASH(0x7f62ffacfec0)) called at /usr/local/share/perl/5.14.2/Plack/Middleware/Head.pm line 9 Plack::Middleware::Head::call(Plack::Middleware::Head=HASH(0x7f6301f62160), HASH(0x7f62ffacfec0)) called at /usr/local/share/perl/5.14.2/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x7f62ffacfec0)) called at /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm line 87 Plack::Handler::Apache2::call_app("Plack::Handler::Apache2", Apache2::RequestRec=SCALAR(0x7f62fec27bb8), CODE(0x7f6301f61cf8)) called at /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm line 126 Plack::Handler::Apache2::handler(Apache2::RequestRec=SCALAR(0x7f62fec27bb8)) called at -e line 0 eval {...} called at -e line 0 Any ideas? Thanks, Andy
Subject: Re: [rt.cpan.org #98895] Exceptions running within Plack
Date: Tue, 16 Sep 2014 08:38:29 +1000
To: bug-GraphViz2 [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Andy A couple of things come to mind: o Capture::Tiny I see has issues with Dancer and FCGI: https://github.com/dagolden/Capture-Tiny/issues I did not read the detail - perhaps these have been fixed. You should start there. o I've read elsewhere someone had a problem with the way Capture::Tiny (I /think/ it was C::T) played with file handles. I'll keep looking. On 15/09/14 21:44, Andrew Beverley via RT wrote: Show quoted text
> Mon Sep 15 07:44:18 2014: Request 98895 was acted upon. > Transaction: Ticket created by abeverley > Queue: GraphViz2 > Subject: Exceptions running within Plack > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: andy@andybev.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=98895 > > > > Hi, > > Thanks for fixing my last bug report so quickly. This report is not > necessarily a bug, but a problem I'm experiencing and really can't work > out the solution. Any help would be appreciated. > > I'm using Graphviz2 within a web application to generate PDFs > on-the-fly. I'm using Dancer2, and everything works well in my > development environment. However, as soon as I deploy into Apache, using > Plack and Fast CGI, I'm getting an exception which I can't track down. > > I appreciate this may be a problem with the environment it's running in, > but I wondered whether you can suggest any areas to investigate. > > I'm getting problems when Graphviz2 attempts to open an IO::Handle > object, within Capture::Tiny. The first few calls to capture() are > successful, as they all refer to temporary files, but in this case > "fileno" is returning -1 which then prevents the subsequent call to > open(); > > Here's the trace: > > Error from open(GLOB(0x7f62febfb308), >&-1): Invalid argument > at /usr/local/share/perl/5.14.2/Capture/Tiny.pm line 99. > Capture::Tiny::_open(GLOB(0x7f62febfb308), ">&-1") called > at /usr/local/share/perl/5.14.2/Capture/Tiny.pm line 186 > Capture::Tiny::_open_std(HASH(0x7f63014d95a8)) called > at /usr/local/share/perl/5.14.2/Capture/Tiny.pm line 375 > Capture::Tiny::_capture_tee(1, 1, 0, 0, CODE(0x7f6301635940)) called > at /usr/local/share/perl/5.14.2/GraphViz2.pm line 558 > GraphViz2::load_valid_attributes(GraphViz2=HASH(0x7f6301164cb0)) called > at /usr/local/share/perl/5.14.2/GraphViz2.pm line 156 > GraphViz2::BUILD(GraphViz2=HASH(0x7f6301164cb0), HASH(0x7f630165c088)) > called at (eval 2014) line 130 GraphViz2::new("GraphViz2", "edge", > HASH(0x7f630252ee40), "global", HASH(0x7f62ff8b0b18), "graph", > HASH(0x7f6301725e60), "logger", Log::Handler=HASH(0x7f630257c898), ...) > called at /srv/Isaas/bin/../lib/Isaas/Asset.pm line 345 > Isaas::Asset::tree("Isaas::Asset") called > at /srv/Isaas/bin/../lib/Isaas.pm line 635 > Isaas::__ANON__(Dancer2::Core::App=HASH(0x7f62ff379218)) called > at /usr/local/share/perl/5.14.2/Dancer2/Core/Route.pm line 142 > Dancer2::Core::Route::execute(Dancer2::Core::Route=HASH(0x7f6301f38f60), > Dancer2::Core::App=HASH(0x7f62ff379218)) called > at /usr/local/share/perl/5.14.2/Dancer2/Core/Dispatcher.pm line 172 eval > {...} called at /usr/local/share/perl/5.14.2/Dancer2/Core/Dispatcher.pm > line 172 > Dancer2::Core::Dispatcher::_dispatch_route(Dancer2::Core::Dispatcher=HASH(0x7f62ff8c74c0), Dancer2::Core::Route=HASH(0x7f6301f38f60), Dancer2::Core::App=HASH(0x7f62ff379218)) called at /usr/local/share/perl/5.14.2/Dancer2/Core/Dispatcher.pm line 67 Dancer2::Core::Dispatcher::__ANON__(CODE(0x7f62ff26e518)) called at /usr/local/share/perl/5.14.2/Return/MultiLevel.pm line 49 Return::MultiLevel::__ANON__() called at /usr/local/share/perl/5.14.2/Return/MultiLevel.pm line 54 Return::MultiLevel::__ANON__(CODE(0x7f62ff87faa8)) called at /usr/local/share/perl/5.14.2/Dancer2/Core/Dispatcher.pm line 68 Dancer2::Core::Dispatcher::dispatch(Dancer2::Core::Dispatcher=HASH(0x7f62ff8c74c0), HASH(0x7f62ffacfec0)) called at /usr/local/share/perl/5.14.2/Dancer2/Core/Runner.pm line 220 eval {...} called at /usr/local/share/perl/5.14.2/Dancer2/Core/Runner.pm line 222 Dancer2::Core::Runner::__ANON__(HASH(0x7f62ffacfec0)) called at /usr/local/share/perl/5.14.2/Plack/Middleware/Head.pm line 9 Plack
:: Show quoted text
> Middleware::Head::call(Plack::Middleware::Head=HASH(0x7f6301f62160), HASH(0x7f62ffacfec0)) called at /usr/local/share/perl/5.14.2/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x7f62ffacfec0)) called at /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm line 87 Plack::Handler::Apache2::call_app("Plack::Handler::Apache2", Apache2::RequestRec=SCALAR(0x7f62fec27bb8), CODE(0x7f6301f61cf8)) called at /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm line 126 Plack::Handler::Apache2::handler(Apache2::RequestRec=SCALAR(0x7f62fec27bb8)) called at -e line 0 eval {...} called at -e line 0 > > Any ideas? > > Thanks, > > Andy > > >
-- Ron Savage - savage.net.au
On Mon Sep 15 18:38:12 2014, ron@savage.net.au wrote: Show quoted text
> Hi Andy > > A couple of things come to mind: > > o Capture::Tiny I see has issues with Dancer and FCGI: > https://github.com/dagolden/Capture-Tiny/issues > I did not read the detail - perhaps these have been fixed. > You should start there.
I wouldn't be surprised if the actual problem here is that you need to do https://metacpan.org/source/RKITOVER/Catalyst-Controller-WrapCGI-0.035/lib/Catalyst/Controller/WrapCGI.pm#L97 then https://metacpan.org/source/RKITOVER/Catalyst-Controller-WrapCGI-0.035/lib/Catalyst/Controller/WrapCGI.pm#L220 to make STDIN/STDOUT a sensible thing for Capture::Tiny to work with.
Subject: Re: [rt.cpan.org #98895] Exceptions running within Plack
Date: Wed, 27 Jan 2016 22:42:21 +0000
To: bug-GraphViz2 [...] rt.cpan.org
From: Andrew Beverley <andy [...] andybev.com>
Ron, mst, thanks for your replies on this issue. I never did quite get to the bottom of it, but it has now "fixed itself". Since upgrading to Debian Jessie, upgrading a few modules, and installing GraphViz2, I no longer have the problem. Unfortunately, I don't know which upgrade fixed it, but good to know that fix has been committed to a code path somewhere. Thanks, Andy
Thanx for the feedback. I'll close this as resolved, even if not quite explained!