Skip Menu |
 

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 120040
Status: resolved
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: OSCHWALD [...] cpan.org
skaarup [...] perl.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 2.2000
  • 2.2001
  • 2.2002
Fixed in: 2.2003



Subject: Moose-2.002 breaks Catalyst framework
Download (untitled) / with headers
text/plain 512b
The server script within Catalyst croaks when when the restart attribute (-r) is given: MyApp_server.pl -r it dies with: Can't use an undefined value as a HASH reference at /home/<username>/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/amd64-freebsd/Moose/Meta/Attribute.pm line 1073. Without "-r" I'm able to run the debug-server. Version 2.1807 is ok, but all 2.2xxx's are failing with the same error. Perl-5.24.1 FreeBSD 11.0 Task::Catalyst 4.02 Everything(tm) is at latest released level.
Download (untitled) / with headers
text/plain 778b
On 2017-01-30 08:11:32, skaarup@perl.org wrote: Show quoted text
> > The server script within Catalyst croaks when when the restart > attribute (-r) is given: > > MyApp_server.pl -r > > it dies with: > > Can't use an undefined value as a HASH reference at > /home/<username>/perl5/perlbrew/perls/perl- > 5.24.1/lib/site_perl/5.24.1/amd64-freebsd/Moose/Meta/Attribute.pm line > 1073. > > Without "-r" I'm able to run the debug-server. > > > Version 2.1807 is ok, but all 2.2xxx's are failing with the same > error. > > > Perl-5.24.1 > FreeBSD 11.0 > Task::Catalyst 4.02 > > Everything(tm) is at latest released level.
I have a fix for the dying in Moose, but there's another bug in File::ChangeNotify that will cause a warning from Moose. I'll have a new release for that out shortly.
Subject: "does" in attribute does not work as expected in 2.2002
Download (untitled) / with headers
text/plain 486b
The attached code worked as expected in 2.1806, but breaks with 2.2002 with the error: Can't use an undefined value as a HASH reference at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/Attribute.pm line 1073. Steps to reproduce: cpanm MaxMind::DB::Reader MaxMind::DB::Reader::XS Download http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz, untar, and put in the same path as the script (or adjust the script). Greg
Subject: test.pl
Download test.pl
text/x-perl 293b
package Test; use Moose; has mmdb_reader => ( is => 'ro', does => 'MaxMind::DB::Reader::Role::Reader', ); package main; use MaxMind::DB::Reader; use MaxMind::DB::Reader::XS; Test->new(mmdb_reader => MaxMind::DB::Reader->new( file => '/usr/local/share/GeoIP/GeoLite2-City.mmdb'));
This may be a dupe of #120040
Download (untitled) / with headers
text/plain 430b
This is the same bug as https://rt.cpan.org/Ticket/Display.html?id=120040 Basically, a does constraint on a Moo object inflates it to a Moose object, and then can cause some issues because of what appears to be a bug in Moo. There will be a new Moose release soon. An interim fix is to look for Moo class attributes defined as "is => 'rw'" with an additional "writer" defined. Change that to 'ro' and the problem should go away.
Fixed in 2.2003. I guess no one runs the trial releases :/
Subject: Re: [rt.cpan.org #120040] Resolved: Moose-2.002 breaks Catalyst framework
Date: Mon, 30 Jan 2017 19:45:07 +0000
To: bug-Moose [...] rt.cpan.org
From: Gregory Oschwald <oschwald [...] gmail.com>
With 2.2003, the error in my test case becomes "You are overwriting a accessor [sic].." (See below for the new stack trace.) If I am understanding correctly, this is now exposing a bug in Moo. Is there a Moo issue tracking the problem? ---- You are overwriting a accessor (_data_section_end) for the _data_section_end attribute with a new reader method for the _data_section_end attribute at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/Attribute.pm line 1094. Moose::Meta::Attribute::_process_accessors(Moose::Meta::Attribute=HASH(0x2bc7618), "reader", "_data_section_end", undef) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Class/MOP/Attribute.pm line 450 Class::MOP::Attribute::install_accessors(Moose::Meta::Attribute=HASH(0x2bc7618)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/Attribute.pm line 1014 Moose::Meta::Attribute::install_accessors(Moose::Meta::Attribute=HASH(0x2bc7618)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Class/MOP/Class.pm line 899 Class::MOP::Class::try {...} () called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 103 eval {...} called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 94 Try::Tiny::try(CODE(0x2b6ea68), Try::Tiny::Catch=REF(0x2bad068)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Class/MOP/Class.pm line 904 Class::MOP::Class::_post_add_attribute(Moose::Meta::Class=HASH(0x2b792a0), Moose::Meta::Attribute=HASH(0x2bc7618)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Class/MOP/Mixin/HasAttributes.pm line 39 Class::MOP::Mixin::HasAttributes::add_attribute(Moose::Meta::Class=HASH(0x2b792a0), Moose::Meta::Attribute=HASH(0x2bc7618)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/Class.pm line 583 Moose::Meta::Class::add_attribute(Moose::Meta::Class=HASH(0x2b792a0), "_data_section_end", "init_arg", undef, "is", "rw", "writer", "_set_data_section_end", ...) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Moo/HandleMoose.pm line 169 Moo::HandleMoose::inject_real_metaclass_for("MaxMind::DB::Reader::XS") called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Moo/HandleMoose/FakeMetaClass.pm line 23 Moo::HandleMoose::FakeMetaClass::can(Moo::HandleMoose::FakeMetaClass=HASH(0x216f1a8), "does_role") called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Util.pm line 76 Moose::Util::does_role(MaxMind::DB::Reader::XS=HASH(0x27d1520), "MaxMind::DB::Reader::Role::Reader") called at (eval 224) line 3 Eval::Closure::Sandbox_164::__ANON__(MaxMind::DB::Reader::XS=HASH(0x27d1520)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/TypeConstraint.pm line 161 Moose::Meta::TypeConstraint::check(Moose::Meta::TypeConstraint::Role=HASH(0x2769af0), MaxMind::DB::Reader::XS=HASH(0x27d1520)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/Attribute.pm line 1331 Moose::Meta::Attribute::verify_against_type_constraint(Moose::Meta::Attribute=HASH(0x2050850), MaxMind::DB::Reader::XS=HASH(0x27d1520), "instance", Test=HASH(0x129d4c0)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/Attribute.pm line 1318 Moose::Meta::Attribute::_coerce_and_verify(Moose::Meta::Attribute=HASH(0x2050850), MaxMind::DB::Reader::XS=HASH(0x27d1520), Test=HASH(0x129d4c0)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/Attribute.pm line 515 Moose::Meta::Attribute::initialize_instance_slot(Moose::Meta::Attribute=HASH(0x2050850), Moose::Meta::Instance=HASH(0x27b53f0), Test=HASH(0x129d4c0), HASH(0x2b58558)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Class/MOP/Class.pm line 526 Class::MOP::Class::_construct_instance(Moose::Meta::Class=HASH(0x201bed8), HASH(0x2b58558)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Class/MOP/Class.pm line 496 Class::MOP::Class::new_object(Moose::Meta::Class=HASH(0x201bed8), HASH(0x2b58558)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Meta/Class.pm line 273 Moose::Meta::Class::new_object(Moose::Meta::Class=HASH(0x201bed8), HASH(0x2b58558)) called at /home/greg/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Moose/Object.pm line 24 Moose::Object::new("Test", "mmdb_reader", MaxMind::DB::Reader::XS=HASH(0x27d1520)) called at test.pl line 15 On Mon, Jan 30, 2017 at 10:35 AM Karen Etheridge via RT < bug-Moose@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=120040 > > > According to our records, your request has been resolved. If you have any > further questions or concerns, please respond to this message. >
Download (untitled) / with headers
text/plain 733b
On 2017-01-30 13:46:00, oschwald@gmail.com wrote: Show quoted text
> With 2.2003, the error in my test case becomes "You are overwriting a > accessor [sic].." (See below for the new stack trace.) If I am > understanding correctly, this is now exposing a bug in Moo. Is there a > Moo > issue tracking the problem?
I don't think so. I'm not even 100% sure what the issue is, other than that the way Moo inflates to a Moose class somehow triggers this warning for some attributes. I'm proposing that we disable the warning in Moose until we can figure out what the Moo issue is, because as it stands it's really easy to trigger, and really hard to fix if it's happening because of some CPAN module you don't control being inflated into a Moose object.
Subject: Re: [rt.cpan.org #120040] Moose-2.002 breaks Catalyst framework
Date: Mon, 30 Jan 2017 20:22:50 +0000
To: bug-Moose [...] rt.cpan.org
From: Gregory Oschwald <oschwald [...] gmail.com>
Download (untitled) / with headers
text/plain 123b
Disabling the Moose warning until this is worked out makes sense to me. The current situation seems to be a bit of a mess.
Download (untitled) / with headers
text/plain 385b
On 2017-01-30 14:23:16, oschwald@gmail.com wrote: Show quoted text
> Disabling the Moose warning until this is worked out makes sense to me. The > current situation seems to be a bit of a mess.
This turned out to be a further very subtle bug in Moose, not Moo, although Moo was doing something slightly odd (that should have worked without a warning). We should have a new release out with a fix soon.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.