Perl error with Shredder on users (RT 3.8.7)

Hello,

I’m using RT 3.8.7 on Ubuntu 10.04 AMD64.

When i’m trying to use the Shredder script (from RT web interface) on
enabled users, i’m getting this trange error :
Couldn’t wipeout object: Bizarre copy of ARRAY in aassign at
/usr/share/perl5/Devel/StackTrace.pm line 49.

Any idea ?

Regards,

Guillaume Hilt

I’m using Perl 5.10.1 by the way.

Guillaume HiltLe 03/04/2012 16:52, Guillaume Hilt a écrit :

Hello,

I’m using RT 3.8.7 on Ubuntu 10.04 AMD64.

When i’m trying to use the Shredder script (from RT web interface) on
enabled users, i’m getting this trange error :
Couldn’t wipeout object: Bizarre copy of ARRAY in aassign at
/usr/share/perl5/Devel/StackTrace.pm line 49.

Any idea ?

Regards,

Hello,

I’m using RT 3.8.7 on Ubuntu 10.04 AMD64.

When i’m trying to use the Shredder script (from RT web interface) on
enabled users, i’m getting this trange error :
Couldn’t wipeout object: Bizarre copy of ARRAY in aassign at
/usr/share/perl5/Devel/StackTrace.pm line 49.

Any idea ?

This is in most cases is a perl bug.

Regards,


Guillaume Hilt

Best regards, Ruslan.

Hello,

I’m using RT 3.8.7 on Ubuntu 10.04 AMD64.

When i’m trying to use the Shredder script (from RT web interface) on
enabled users, i’m getting this trange error :
Couldn’t wipeout object: Bizarre copy of ARRAY in aassign at
/usr/share/perl5/Devel/StackTrace.pm line 49.

Any idea ?

This is in most cases is a perl bug.

Regards,


Guillaume Hilt


Best regards, Ruslan.

In case anyone else stumbles onto this perl bug like I just did,
here’s some working code:

(Likely you’ll want to use a better method of selecting your user
objects than my lazy insert of id numbers into DATA)

#!/usr/bin/perl

use strict;
use warnings;

#use Data::Dumper;

use RT::Shredder ();
use RT::Shredder::Plugin ();

RT::Shredder::Init( force => 1 );

my $shredder = RT::Shredder->new();

my $plugin = RT::Shredder::Plugin->new;
my ( $plugin_status, $plugin_message ) = $plugin->LoadByString( ‘Users’ );

resolver code cribbed from RT::Shredder’s t/02users.t test file

my $resolver = sub {
my %args = (@_);
my $t = $args{‘TargetObject’};
my $resolver_uid = RT->SystemUser->id;
foreach my $method ( qw(Creator LastUpdatedBy) ) {
next unless $t->_Accessible( $method => ‘read’ );
$t->__Set( Field => $method, Value => $resolver_uid );
}
};

print “Iterating id list…\n”;

my $user = new RT::User(RT::SystemUser);

for ( ) {

chomp;

print "\nCurrent id: $_\n";

$user->Load($_);
next unless $user->id;

print "id $_ loaded...\n";

$shredder->PutResolver( BaseClass => 'RT::User', Code => $resolver );

print "Wiping...\n";
$shredder->Wipeout( Object => $user );

}

print “Program complete…\n”;

DATA
1757
1759
1761
1763
1765
1767

Andy Harrison
public key: 0x67518262