Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Weird perl behaviour using Mouse between two different host-machines

by yulivee07 (Sexton)
on May 02, 2017 at 08:32 UTC ( [id://1189310]=perlquestion: print w/replies, xml ) Need Help??

yulivee07 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perlmonks, I have written a bunch of modules using mouse in our test environment and tested them accordingly without errors. Then I pushed them into production and got this error:
The method 'BUILDARGS' was not found in the inheritance hierarchy for +Utils::SyncDceBluegroup::PersonCache at /usr/local/site_perl/aix/aix- +thread-multi/Mouse/Meta/Class.pm line 322, <DATA> line 755. Mouse::Meta::Class::_install_modifier(Mouse::Meta::Class=HASH( +0x31287cc8), "around", "BUILDARGS", CODE(0x312aff38)) called at /usr/ +local/site_perl/aix/aix-thread-multi/Mouse/Meta/Class.pm line 394 Mouse::Meta::Class::add_around_method_modifier(Mouse::Meta::Cl +ass=HASH(0x31287cc8), "BUILDARGS", CODE(0x312aff38)) called at /usr/l +ocal/site_perl/aix/aix-thread-multi/Mouse.pm line 79 Mouse::around("BUILDARGS") called at /usr/local/site_perl/comm +on/Utils/SyncDceBluegroup/PersonCache.pm line 144 require Utils/SyncDceBluegroup/PersonCache.pm called at /usr/l +ocal/site_perl/common/Utils/SyncDceBluegroup/AIXUseridCache.pm line 9 require Utils/SyncDceBluegroup/AIXUseridCache.pm called at /us +r/local/site_perl/common/Utils/SyncDceBluegroup.pm line 10 require Utils/SyncDceBluegroup.pm called at ./SyncDceBluegroup +.t line 8 main::BEGIN() called at /usr/local/site_perl/common/Utils/Sync +DceBluegroup/PersonCache.pm line 0 eval {...} called at /usr/local/site_perl/common/Utils/SyncDce +Bluegroup/PersonCache.pm line 0 Compilation failed in require at /usr/local/site_perl/common/Utils/Syn +cDceBluegroup/AIXUseridCache.pm line 9, <DATA> line 755. Compilation failed in require at /usr/local/site_perl/common/Utils/Syn +cDceBluegroup.pm line 10, <DATA> line 755. Compilation failed in require at ./SyncDceBluegroup.t line 8, <DATA> l +ine 755. BEGIN failed--compilation aborted at ./SyncDceBluegroup.t line 8, <DAT +A> line 755. # Looks like your test exited with 255 before it could output anything +.
What completely baffles me is that I cannot see a difference between the test environment and production. We are working on AIX, but its the same level. It uses the same perl. It uses the same version of Mouse:
user@test:/common/admin/perltests/modules# oslevel -s 7200-01-01-1642 user@test:/common/admin/perltests/modules# perl -v This is perl 5, version 20, subversion 1 (v5.20.1) built for aix-threa +d-multi Copyright 1987-2014, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. user@test:/common/admin/perltests/modules# perl -MMouse -e 'print Mous +e->VERSION,"\n"' + v2.4.5 user@production:/common/admin/perltests/modules/Utils_SyncDceBluegroup +$ oslevel -s 7200-01-01-1642 user@production:/common/admin/perltests/modules/Utils_SyncDceBluegroup +$ perl -v This is perl 5, version 20, subversion 1 (v5.20.1) built for aix-threa +d-multi Copyright 1987-2014, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. user@production:/common/admin/perltests/modules/Utils_SyncDceBluegroup +$ perl -MMouse -e 'print Mouse->VERSION,"\n"' v2.4.5
What could go wrong that this error appears in production? The offending code looks like this:
around BUILDARGS => sub { my $orig = shift; my $class = shift; return $class->$orig( member_type => 'Utils::SyncDceBluegroup::Per +son' ); };
I am pretty shure I used the BUILDARGS correctly and I am not doing anything especially complicated here... Any Ideas? Kind regards, yulivee

Replies are listed 'Best First'.
Re: Weird perl behaviour using Mouse between two different host-machines
by Corion (Patriarch) on May 02, 2017 at 09:02 UTC

    Maybe the problem stems from some other module loaded further up in the module hierarchy?

    For debugging such things, I usually dump %INC together with the loaded module versions in the hope of finding what makes the difference:

    #!perl -T use strict; use warnings; use Test::More tests => 1; my $module; BEGIN { $module = "WWW::Mechanize::PhantomJS"; require_ok( $module ); } diag( sprintf "Testing %s %s, Perl %s", $module, $module->VERSION, $] +); for (sort grep /\.pm\z/, keys %INC) { s/\.pm\z//; s!/!::!g; eval { diag(join(' ', $_, $_->VERSION || '<unknown>')) }; }

    In your case of the program, maybe put the dumping part into an END block...

      Thanks for your advice - that really solved my problem! I noticed different versions in the parent-class PersonCache was inheriting from and that caused the problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1189310]
Approved by Eily
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (None)
    As of 2024-04-25 01:53 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found