Mailing List Archive

Bizarro image error
Hi everybody,

I'm trying to preview a story, and getting an error message that's
baffling.

The story previews cleanly with no media. When I attach an image,
Bricolage gives this:


System error
error: Can't call method "get_parent" on an undefined value
at /home/bret/bricolage/comp/errors/500.mc line 64, <GEN1> line 3051.
context:
...
60:
61: % if ($prev && $is_burner_error) {
62: % my $element = $fault->element;
63: % my @elements = ($element);
64: % while (my $parent = $elements[0]->get_parent) {
65: % unshift @elements, $parent;
66: % }
67: <p>Location of the error:<br/>
68: <% shift(@elements)->get_name %> -> <% join(' -> ', map
{ $_->get_name . '[' . ($_->get_place + 1) . ']' } @elements) %></p>
...
code stack: /home/bret/bricolage/comp/errors/500.mc:64
/home/bret/bricolage/comp/autohandler:7


Similar stories with identical element structures work fine. So does
this story with a different image, so probably the image itself is
confusing Image::Info or Imager.

But this image looks fine in any other image app I try. And the error
message Bricolage wants to show me is getting sidetracked on its way to
the UI.

Anybody have an idea here?


Thanks so much,

Bret



--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret@pectopah.com
www.pectopah.com
Re: Bizarro image error [ In reply to ]
On Mar 5, 2012, at 2:51 PM, Bret Dawson wrote:

> I'm trying to preview a story, and getting an error message that's
> baffling.
>
> The story previews cleanly with no media. When I attach an image,
> Bricolage gives this:
>
>
> System error
> error: Can't call method "get_parent" on an undefined value
> at /home/bret/bricolage/comp/errors/500.mc line 64, <GEN1> line 3051.

Oy. The 500.mc component has its own error. Comment out that whole block to see your original error.

> Similar stories with identical element structures work fine. So does
> this story with a different image, so probably the image itself is
> confusing Image::Info or Imager.

Right, that’s what I'm thinking: corrupt image.

> But this image looks fine in any other image app I try. And the error
> message Bricolage wants to show me is getting sidetracked on its way to
> the UI.

See if you can convince Bricolage to give you the proper error. It might actually be in the Apache error log, now that I think of it.

David
Re: Bizarro image error [ In reply to ]
Hi everybody,

I had a look in the Apache error log, and the answer was there. The
image was fine after all, but one of the auto-created thumbnails must
have got stuck, because it was still checked out, and that was the
error.

Lesson: if an image is behaving as if it's corrupt, but Bricolage is
happily showing you its thumbnails, look out for any new images
generated in your templates.

(I was getting the error when attempting a preview, and 500.mc wasn't
showing me the details.)

David, do you think it would it be a good idea to permanently comment
out that block in 500.mc?

Thanks so much,

Bret

P.S. Here's the stack, for Google's sake:

[Mon Mar 5 20:23:23 2012] [error] [client xxx.xxx.xxx.xxx] Cannot
publish media "/bob/2012/03/05/big_bob_185.jpg" because it is checked
out. Your best bet is to pass `published_version => 1` when looking up
documents to pass to publish_another()
[/home/bret/bricolage/lib/Bric/Util/Burner.pm:1507]
[/home/bret/bricolage/data/burn/comp/oc_1/small_image.mc:43]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Component.pm:135]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:1284]
[/home/bret/bricolage/lib/Bric/Util/Burner/Mason.pm:745]
[/home/bret/bricolage/lib/Bric/Util/Burner/Mason.pm:484]
[/home/bret/bricolage/data/burn/comp/oc_1026/util/render_main_column.mc:6]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Component.pm:135]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:1284]
[/home/bret/bricolage/data/burn/comp/oc_1/alert.mc:13]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Component.pm:135]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:1284]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:943]
[/home/bret/bricolage/lib/Bric/Util/Burner/Mason.pm:550]
[/home/bret/bricolage/data/burn/comp/oc_1/autohandler:55]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Component.pm:135]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:1279]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:473]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Interp.pm:342]
[/home/bret/bricolage/lib/Bric/Util/Burner/Mason.pm:261]
[/home/bret/bricolage/lib/Bric/Util/Burner.pm:1601]
[/home/bret/bricolage/lib/Bric/Util/Burner.pm:1022]
[/home/bret/bricolage/lib/Bric/App/Callback/Publish.pm:117]
[/home/bret/bricolage/comp/workflow/profile/preview/dhandler:32]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Component.pm:135]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:1284]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:943]
[/home/bret/bricolage/comp/autohandler:7]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Component.pm:135]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:1279]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/Request.pm:473]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/ApacheHandler.pm:168]
[/usr/lib/perl5/vendor_perl/5.8.4/HTML/Mason/ApacheHandler.pm:825]
[/home/bret/bricolage/lib/Bric/App/Handler.pm:308]
[PerlHandler subroutine `Bric::App::Handler':1]





On Mon, 2012-03-05 at 16:35 -0800, David E. Wheeler wrote:
> On Mar 5, 2012, at 2:51 PM, Bret Dawson wrote:
>
> > I'm trying to preview a story, and getting an error message that's
> > baffling.
> >
> > The story previews cleanly with no media. When I attach an image,
> > Bricolage gives this:
> >
> >
> > System error
> > error: Can't call method "get_parent" on an undefined value
> > at /home/bret/bricolage/comp/errors/500.mc line 64, <GEN1> line 3051.
>
> Oy. The 500.mc component has its own error. Comment out that whole block to see your original error.
>
> > Similar stories with identical element structures work fine. So does
> > this story with a different image, so probably the image itself is
> > confusing Image::Info or Imager.
>
> Right, that’s what I'm thinking: corrupt image.
>
> > But this image looks fine in any other image app I try. And the error
> > message Bricolage wants to show me is getting sidetracked on its way to
> > the UI.
>
> See if you can convince Bricolage to give you the proper error. It might actually be in the Apache error log, now that I think of it.
>
> David
>
>
>

--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret@pectopah.com
www.pectopah.com
Re: Bizarro image error [ In reply to ]
On Mar 9, 2012, at 1:28 PM, Bret Dawson wrote:

> David, do you think it would it be a good idea to permanently comment
> out that block in 500.mc?

I dunno. What does it do? It at least ought to be modified to handle the case where the variable is undefined.

D