On Mon, 24 May 2010 15:41:11 -0700 Buddy Burden <barefootco...@gmail.com> wrote:
> Guys, > > We're seeing a weird error from Class::MOP::load_class. It doesn't > happen all the time, and when I run simple tests I don't see the > error. Hopefully someone can see something I'm missing in this stack > trace: > > Couldn't load class (Company::CompanyBusinessModel) because: Can't > locate 0.pm in @INC (@INC contains: /home/buddy/proj/rent. > com/lib /usr/local/lib/perl5/5.8.9/i686-linux > /usr/local/lib/perl5/5.8.9 > /usr/local/lib/perl5/site_perl/5.8.9/i686-linux /usr > /local/lib/perl5/site_perl/5.8.9 > /usr/local/lib/perl5/vendor_perl/5.8.9/i686-linux > /usr/local/lib/perl5/vendor_perl/5.8.9 /us > r/local/lib/perl5/vendor_perl /usr/local/lib/perl5/site_perl). at > /usr/local/lib/perl5/vendor_perl/5.8.9/i686-linux/Class/MOP > .pm line 116 > Class::MOP::load_first_existing_class(0) called at > /usr/local/lib/perl5/vendor_perl/5.8.9/i686-linux/Class/MOP.pm lin > e 121 > Class::MOP::load_class(0) called at > /usr/local/lib/perl5/vendor_perl/5.8.9/MooseX/Declare/Syntax/KeywordHandling.pm > l > ine 68 > > MooseX::Declare::Syntax::KeywordHandling::parse_declaration('MooseX::Declare::Syntax::Keyword::Class=HASH(0xc8c264c)' > , '/home/buddy/proj/rent.com/lib/Company/CompanyBusinessModel.pm', > 'HASH(0xc8ae634)', 'class', 0) called at /usr/local/lib/pe > rl5/vendor_perl/5.8.9/MooseX/Declare/Syntax/KeywordHandling.pm line 40 > MooseX::Declare::Syntax::KeywordHandling::__ANON__('class', 0) > called at /usr/local/lib/perl5/vendor_perl/5.8.9/i686- > linux/Devel/Declare.pm line 279 > Devel::Declare::linestr_callback('const', 'class', 0) called > at /home/buddy/proj/rent.com/lib/Company/CompanyBusiness > Model.pm line 16 > require Company/CompanyBusinessModel.pm called at > /usr/local/lib/perl5/vendor_perl/5.8.9/i686-linux/Class/MOP.pm line > 101 > Class::MOP::__ANON__() called at > /usr/local/lib/perl5/vendor_perl/5.8.9/Try/Tiny.pm line 74 > eval {...} called at > /usr/local/lib/perl5/vendor_perl/5.8.9/Try/Tiny.pm line 67 > Try::Tiny::try('CODE(0xc91ad0c)', > 'Try::Tiny::Catch=REF(0xc91b174)') called at > /usr/local/lib/perl5/vendor_perl/5.8.9/i686-linux/Class/MOP.pm line > 110 > Class::MOP::load_first_existing_class('Company::CompanyBusinessModel') > called > at /usr/local/lib/perl5/vendor_perl/5.8.9/i686-linux/Class/MOP.pm > line 121 Class::MOP::load_class('Company::CompanyBusinessModel') > called at /home/buddy/proj/rent.com/lib/Company/Moose.pm line 59 > Company::Moose::load_class('Company::CompanyBusinessModel') > called at /home/buddy/proj/rent.com/lib/Company/Company.pm line 2444 > Company::Company::business_model('Company::Company=HASH(0xc8c2820)') > called at /home/buddy/proj/rent.com/lib/Company/BillingPeriod.pm line > 513 > > The stack trace goes on (and on) for a while, but I think that's all > the interesting parts. We can see that my method is calling my copy > of load_class (that's the one in Company::Moose), which all it does is > untaint its arg (assuming it looks safe, of course), then call > Class::MOP::load_class with it. And we can see that the argument is > making it that far. Then we see some fiddling with Try::Tiny and an > eval and then the argument is still there when it does the actual > require. But then it does something via > Devel::Declare::linestr_callback and the name of the class has somehow > become '0'. So I can't figure out what's going on here. > > Does anyone have any light they can shed? Or at least some ideas of > where and what I should do for further debugging? > > TIA guys! > > > -- Buddy > Can we see some code please? -- Nicholas Perez XMPP/Email: n...@nickandperla.net http://search.cpan.org/~nperez/ http://github.com/nperez