Skip Menu |

This queue is for tickets about the MooseX-Storage CPAN distribution.

Report information
The Basics
Id: 104106
Status: resolved
Priority: 0/
Queue: MooseX-Storage

People
Owner: Nobody in particular
Requestors: todd.bruner [...] gmail.com
Cc:
AdminCc:

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



Subject: Confess message
Date: Wed, 29 Apr 2015 15:32:21 -0600
To: bug-MooseX-Storage [...] rt.cpan.org
From: Todd Bruner <todd.bruner [...] gmail.com>
I'm using David Golden's Meerkat to create objects and store them in a MongoDB. My code works without complaint on my development system. The MooseX::Storage version is 0.48 and Meerkat is 0.10 on my dev box. On my production box, (MooseX::Storage 0.49 and Meerkat 0.10) I get the following message when I execute this code: Package MyApp::Collection::Foo; use Moose 2; extends 'Meerkat::Collection'; sub create_obj { my $self = shift; my $href = shift; return $self->create($href); } 1; Object (1) does not have a &pack method, cannot collapse at /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 207. ...stack trace omitted... The object is created, so this isn't critical, but the confess stack trace is annoying. What do I need to do differently in 0.49 to quiet this confess? thanks, Todd ------------------------------ todd.bruner@gmail.com
On 2015-04-29 14:32:49, toddbruner wrote: Show quoted text
> I'm using David Golden's Meerkat to create objects and store them in a > MongoDB. > My code works without complaint on my development system. The > MooseX::Storage version is 0.48 and Meerkat is 0.10 on my dev box. > On my production box, (MooseX::Storage 0.49 and Meerkat 0.10) I get the > following message when I execute this code:
Show quoted text
> Object (1) does not have a &pack method, cannot collapse at > /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 207. > ...stack trace omitted... > > The object is created, so this isn't critical, but the confess stack trace > is annoying. What do I need to do differently in 0.49 to quiet this > confess?
I'm not sure what Meerkat is doing with its serializers, but the bit of code that you're hitting (the collapse handler at line 207) should only be getting called for blessed objects. However, the $obj being printed in the error message doesn't look like it's blessed. Can you try editing MooseX::Storage::Engine to include a Data::Dumper of the $obj in the confess message? And being able to see the full stack trace (that you omitted above) would be quite helpful here too.
Subject: Re: [rt.cpan.org #104106] Confess message
Date: Thu, 30 Apr 2015 10:18:46 -0600
To: bug-moosex-storage <bug-MooseX-Storage [...] rt.cpan.org>
From: Todd Bruner <todd.bruner [...] gmail.com>
Karen: Thank you for looking into this and creating this PM. Here's the dump of the object as requested and the full stack trace. MyApp::Collection::System is a subclass of Meerkat::Collection. Let me know if you have any questions or I can perform an additional tests. Todd Object (1) does not have a &pack method, cannot collapse$VAR1 = bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ); at /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 208. MooseX::Storage::Engine::__ANON__(JSON::PP::Boolean=SCALAR(0x4ff0f68), HASH(0x4d047e8)) called at /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 280 MooseX::Storage::Engine::__ANON__(HASH(0x647a530), HASH(0x4d047e8)) called at /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 249 MooseX::Storage::Engine::__ANON__(ARRAY(0x660f9a0), HASH(0x4d047e8)) called at /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 91 MooseX::Storage::Engine::collapse_attribute_value(MooseX::Storage::Engine=HASH(0x685fca0), Moose::Meta::Class::__ANON__::SERIAL::5=HASH(0x6772df8), HASH(0x4d047e8)) called at /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 61 MooseX::Storage::Engine::collapse_attribute(MooseX::Storage::Engine=HASH(0x685fca0), Moose::Meta::Class::__ANON__::SERIAL::5=HASH(0x6772df8), HASH(0x4d047e8)) called at /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 144 MooseX::Storage::Engine::map_attributes(MooseX::Storage::Engine=HASH(0x685fca0), "collapse_attribute", HASH(0x4d047e8)) called at /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 38 MooseX::Storage::Engine::collapse_object(MooseX::Storage::Engine=HASH(0x685fca0)) called at /usr/local/share/perl/5.18.2/MooseX/Storage/Basic.pm line 12 MooseX::Storage::Basic::pack(MyApp::Model::System=HASH(0x685fda8)) called at /usr/local/share/perl/5.18.2/Meerkat/Collection.pm line 327 Meerkat::Collection::_save(MyApp::Collection::System=HASH(0x666e898), MyApp::Model::System=HASH(0x685fda8)) called at ../lib/MyApp/Collection/System.pm line 18 MyApp::Collection::System::__ANON__(MyApp::Collection::System=HASH(0x666e898), HASH(0x63b1be8)) called at /usr/local/lib/perl/5.18.2/Moose/Meta/Method/Overridden.pm line 38 MyApp::Collection::System::create(MyApp::Collection::System=HASH(0x666e898), HASH(0x63b1be8)) called at ../lib/MyApp/Collection/System.pm line 58 MyApp::Collection::System::create_from_hopper(MyApp::Collection::System=HASH(0x666e898), HASH(0x6669078)) called at ../lib/MyApp/Controller/Hopper.pm line 195 MyApp::Controller::Hopper::update_system(MyApp::Controller::Hopper=HASH(0x1683158), 231058, HASH(0x6669078)) called at ../lib/MyApp/Controller/Hopper.pm line 145 MyApp::Controller::Hopper::run(MyApp::Controller::Hopper=HASH(0x1683158), HASH(0x1683278)) called at ./get_foo_updates.pl line 10 ------------------------------ todd.bruner@gmail.com On Wed, Apr 29, 2015 at 6:00 PM, Karen Etheridge via RT < bug-MooseX-Storage@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=104106 > > > On 2015-04-29 14:32:49, toddbruner wrote:
> > I'm using David Golden's Meerkat to create objects and store them in a > > MongoDB. > > My code works without complaint on my development system. The > > MooseX::Storage version is 0.48 and Meerkat is 0.10 on my dev box. > > On my production box, (MooseX::Storage 0.49 and Meerkat 0.10) I get the > > following message when I execute this code:
>
> > Object (1) does not have a &pack method, cannot collapse at > > /usr/local/share/perl/5.18.2/MooseX/Storage/Engine.pm line 207. > > ...stack trace omitted... > > > > The object is created, so this isn't critical, but the confess stack
> trace
> > is annoying. What do I need to do differently in 0.49 to quiet this > > confess?
> > I'm not sure what Meerkat is doing with its serializers, but the bit of > code that you're hitting (the collapse handler at line 207) should only be > getting called for blessed objects. However, the $obj being printed in the > error message doesn't look like it's blessed. > > Can you try editing MooseX::Storage::Engine to include a Data::Dumper of > the $obj in the confess message? > And being able to see the full stack trace (that you omitted above) would > be quite helpful here too. > >
On 2015-04-30 09:19:30, toddbruner wrote: Show quoted text
> Karen: > > Thank you for looking into this and creating this PM. Here's the dump > of > the object as requested and the full stack trace. > > MyApp::Collection::System is a subclass of Meerkat::Collection. Let > me > know if you have any questions or I can perform an additional tests.
Without knowing the details of how you constructed your Meerkat::Collection object, I cannot reproduce this to run under either 0.48 or 0.49. However, this error is critically important: Show quoted text
> Object (1) does not have a &pack method, cannot collapse$VAR1 = bless( > do{\(my $o = 1)}, 'JSON::PP::Boolean' );
It shows that MooseX::Storage doesn't know how to serialize/deserialize JSON::PP::Boolean objects - because it hasn't been instructed how. While constructing a test case to see how arrayrefs of JSON::PP::Booleans are handled, I found a bug in the 0.49 changes, but I don't think that this fix will directly help you (as the problem is only in new deep expansion code that was added in 0.49.) Can you send me the Moose type definition of the object you are attempting to serialize, ideally simplified down to just a few attributes?
On 2015-05-04 16:48:39, ETHER wrote: Show quoted text
> On 2015-04-30 09:19:30, toddbruner wrote:
> > Karen: > > > > Thank you for looking into this and creating this PM. Here's the > > dump > > of > > the object as requested and the full stack trace. > > > > MyApp::Collection::System is a subclass of Meerkat::Collection. Let > > me > > know if you have any questions or I can perform an additional tests.
> > Without knowing the details of how you constructed your > Meerkat::Collection > object, I cannot reproduce this to run under either 0.48 or 0.49. > > However, this error is critically important: >
> > Object (1) does not have a &pack method, cannot collapse$VAR1 = > > bless( > > do{\(my $o = 1)}, 'JSON::PP::Boolean' );
> > It shows that MooseX::Storage doesn't know how to > serialize/deserialize > JSON::PP::Boolean objects - because it hasn't been instructed how.
You can instruct the engine to pack/unpack these objects thusly: I suspect that previously (in version 0.48) you were simply getting the numified form of the JSON booleans (i.e. 1 or 0) after packing->unpacking, so you still had a lossy translation, but this didn't break your application. I've reverted the deep pack/unpack changes in the new 0.50 release, so you should be back to where you were before in 0.48. However any reproduction cases that you can provide will still be helpful, as we do want to re-introduce the deep packing/unpacking feature later on, when we can be sure it works properly.
Subject: Re: [rt.cpan.org #104106] collapse handler being called for a non-object
Date: Tue, 5 May 2015 15:42:35 -0600
To: bug-moosex-storage <bug-MooseX-Storage [...] rt.cpan.org>
From: Todd Bruner <todd.bruner [...] gmail.com>
I think that you are correct. The app was building an href from a the result of a JSON webservice. Upon dumping the href I can see that some of the values are JSON::Boolean::false. Interestingly enough, I really don't care about those key/values and wasn't using them. The lossy-ness was not noticed, but welcome! :-) I've been trying to create a mini-example to recreate the problem without much success. I'm going to keep trying and will send you the example if I can reproduce. I won't update to 0.5 until I can reproduce. As for my application, I will explicitly remove those key/value pairs in the future. Thank you again for looking into this and for creating this module. Todd ------------------------------ todd.bruner@gmail.com On Tue, May 5, 2015 at 2:13 PM, Karen Etheridge via RT < bug-MooseX-Storage@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=104106 > > > On 2015-05-04 16:48:39, ETHER wrote:
> > On 2015-04-30 09:19:30, toddbruner wrote:
> > > Karen: > > > > > > Thank you for looking into this and creating this PM. Here's the > > > dump > > > of > > > the object as requested and the full stack trace. > > > > > > MyApp::Collection::System is a subclass of Meerkat::Collection. Let > > > me > > > know if you have any questions or I can perform an additional tests.
> > > > Without knowing the details of how you constructed your > > Meerkat::Collection > > object, I cannot reproduce this to run under either 0.48 or 0.49. > > > > However, this error is critically important: > >
> > > Object (1) does not have a &pack method, cannot collapse$VAR1 = > > > bless( > > > do{\(my $o = 1)}, 'JSON::PP::Boolean' );
> > > > It shows that MooseX::Storage doesn't know how to > > serialize/deserialize > > JSON::PP::Boolean objects - because it hasn't been instructed how.
> > You can instruct the engine to pack/unpack these objects thusly: > > I suspect that previously (in version 0.48) you were simply getting the > numified form of the JSON booleans (i.e. 1 or 0) after packing->unpacking, > so you still had a lossy translation, but this didn't break your > application. > > I've reverted the deep pack/unpack changes in the new 0.50 release, so you > should be back to where you were before in 0.48. However any reproduction > cases that you can provide will still be helpful, as we do want to > re-introduce the deep packing/unpacking feature later on, when we can be > sure it works properly. > >
For anyone else who is reading this ticket - it is my understanding that 0.50 fixes all outstanding issues noted here. Please advise immediately if this is not the case - it is NOT my intention to be shipping broken software.
Please re-open if there is still an issue.