Rt-shredder madness

Hi,

I have been trying to run rt-shredder to clean up my database before
upgrading and an unable to get it to work. I have been following the
syntax either as presented by the ./rt-shredder --plugin help-Tickets as
well as what is documented in the 4.2.5 section of the website and
nothing seems to work.

As per the examples, here is the latest command I tried executing which
errors out.

./rt-shredder --plugin ‘Tickets=query,Status = “deleted” OR Status =
“rejected” ) LastUpdated < ‘2006-11-29 20:34:26’’

SQL dump file is ‘/opt/rt4/sbin/20140620T152023-0001.sql’
[25293] [Fri Jun 20 15:20:23 2014] [error]: Couldn’t parse query: Wrong
query, expecting a AGGREGATOR in ‘Status = “deleted” OR Status =
“rejected” >)<–here LastUpdated < 2006-11-29’ at
/opt/rt4/sbin/…/lib/RT/SQL.pm line 130.
(/opt/rt4/sbin/…/lib/RT/Tickets.pm:3030)
Couldn’t load plugin
Error: Bad query argument, error: Wrong query, expecting a AGGREGATOR in
‘Status = “deleted” OR Status = “rejected” >)<–here LastUpdated <
2006-11-29’ at /opt/rt4/sbin/…/lib/RT/SQL.pm line 130.

I have also tried other variations:

./rt-shredder --plugin ‘Tickets=query,LastUpdated = “2007-01-10 22:31:10”’

SQL dump file is ‘/opt/rt4/sbin/20140620T152132-0001.sql’
[25298] [Fri Jun 20 15:21:32 2014] [warning]: DBD::mysql::st execute
failed: Unknown column ‘main.IsMerged’ in ‘where clause’ at
/usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 589.
(/usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm:589)
[25298] [Fri Jun 20 15:21:32 2014] [warning]: RT::Handle=HASH(0x1190db8)
couldn’t execute the query ‘SELECT main.* FROM Tickets main WHERE
(main.IsMerged IS NULL) AND (main.Type = ‘ticket’) AND ( (
main.LastUpdated >= ‘2007-01-10 06:00:00’ AND main.LastUpdated <
‘2007-01-11 06:00:00’ ) ) ORDER BY main.id ASC LIMIT 10’ at
/usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 602.
DBIx::SearchBuilder::Handle::SimpleQuery(RT::Handle=HASH(0x1190db8),
“SELECT main.* FROM Tickets main WHERE (main.IsMerged IS NULL”…)
called at /usr/local/share/perl5/DBIx/SearchBuilder.pm line 239
DBIx::SearchBuilder::_DoSearch(RT::Tickets=HASH(0x591c288))
called at /opt/rt4/sbin/…/lib/RT/SearchBuilder.pm line 983
RT::SearchBuilder::_DoSearch(RT::Tickets=HASH(0x591c288))
called at /opt/rt4/sbin/…/lib/RT/Tickets.pm line 2377
RT::tickets::_DoSearch(RT::Tickets=HASH(0x591c288)) called at
/usr/local/share/perl5/DBIx/SearchBuilder.pm line 507
DBIx::SearchBuilder::Next(RT::Tickets=HASH(0x591c288)) called
at /opt/rt4/sbin/…/lib/RT/Tickets.pm line 2349
RT::tickets::Next(RT::Tickets=HASH(0x591c288)) called at
/opt/rt4/sbin/…/lib/RT/Shredder.pm line 354
RT::Shredder::CastObjectsToRecords(“RT::Shredder”, “Objects”,
RT::Tickets=HASH(0x591c288)) called at
/opt/rt4/sbin/…/lib/RT/Shredder.pm line 363
RT::Shredder::CastObjectsToRecords(“RT::Shredder”, “Objects”,
ARRAY(0x357c608)) called at ./rt-shredder line 268
main::process_plugins(RT::Shredder=HASH(0x10af448)) called at
./rt-shredder line 164 (/usr/local/share/perl5/Carp.pm:169)
Objects list is empty, try refine search options

The two errors I keep encountering are

Error: Bad query argument, error: Wrong query, expecting a AGGREGATOR …
or
Objects list is empty, try refine search options

Like I said, I have tried many variations.

Can anyone see what I am doing wrong?

Thanks,

Dave

I have been trying to run rt-shredder to clean up my database before
upgrading and an unable to get it to work. I have been following the syntax
either as presented by the ./rt-shredder --plugin help-Tickets as well as
what is documented in the 4.2.5 section of the website and nothing seems to
work.

One of your errors indicates this upgrade didn’t go swimmingly, are
you sure it completed?

As per the examples, here is the latest command I tried executing which
errors out.

./rt-shredder --plugin ‘Tickets=query,Status = “deleted” OR Status =
“rejected” ) LastUpdated < ‘2006-11-29 20:34:26’’

SQL dump file is ‘/opt/rt4/sbin/20140620T152023-0001.sql’
[25293] [Fri Jun 20 15:20:23 2014] [error]: Couldn’t parse query: Wrong
query, expecting a AGGREGATOR in 'Status = “deleted” OR Status = “rejected”

)<–here LastUpdated < 2006-11-29’ at /opt/rt4/sbin/…/lib/RT/SQL.pm line

You have a closing paren, but no opening paren. This is invalid, it’s
showing you the closing ) that lacks an opening (

I have also tried other variations:

./rt-shredder --plugin ‘Tickets=query,LastUpdated = “2007-01-10 22:31:10”’

SQL dump file is ‘/opt/rt4/sbin/20140620T152132-0001.sql’
[25298] [Fri Jun 20 15:21:32 2014] [warning]: DBD::mysql::st execute failed:
Unknown column ‘main.IsMerged’ in ‘where clause’ at

Tickets.IsMerged is a new column in RT 4.2, are you sure your upgrade
completed?

-kevin

Thanks for the information Kevin,

Yes, the upgrade completed with no problems. I had RT 4.2.5 running with
the default configs and default rt4 database. Long story short, I have
been having problems getting the database upgrade to complete so I was
attempting to trim the database before attempting to run the upgrade
script again.

The database I am attempting to run the RT 4.2.5 version of rt-shredder
is actually a renamed copy of my rt3 database before attempting to run
the database upgrade script, so it makes sense that a column would be
missing, etc.

I had begun to suspect that was the case but it was after 1:30 AM so I
wasn’t motivated to run the 3.8.1 version of shredder against my rt3
database first.

I will try to trim my rt3 database using that version of rt-shredder
before importing into rt4 and if that doesn’t work, I will report back.

Thankfully this is a test server so if I break something it’s not critical.

Thanks,

DaveOn 6/20/2014 10:32 AM, Kevin Falcone wrote:

On Fri, Jun 20, 2014 at 10:26:38AM -0500, Lists wrote:

I have been trying to run rt-shredder to clean up my database before
upgrading and an unable to get it to work. I have been following the syntax
either as presented by the ./rt-shredder --plugin help-Tickets as well as
what is documented in the 4.2.5 section of the website and nothing seems to
work.
One of your errors indicates this upgrade didn’t go swimmingly, are
you sure it completed?

As per the examples, here is the latest command I tried executing which
errors out.

./rt-shredder --plugin ‘Tickets=query,Status = “deleted” OR Status =
“rejected” ) LastUpdated < ‘2006-11-29 20:34:26’’

SQL dump file is ‘/opt/rt4/sbin/20140620T152023-0001.sql’
[25293] [Fri Jun 20 15:20:23 2014] [error]: Couldn’t parse query: Wrong
query, expecting a AGGREGATOR in 'Status = “deleted” OR Status = “rejected”

)<–here LastUpdated < 2006-11-29’ at /opt/rt4/sbin/…/lib/RT/SQL.pm line
You have a closing paren, but no opening paren. This is invalid, it’s
showing you the closing ) that lacks an opening (

I have also tried other variations:

./rt-shredder --plugin ‘Tickets=query,LastUpdated = “2007-01-10 22:31:10”’

SQL dump file is ‘/opt/rt4/sbin/20140620T152132-0001.sql’
[25298] [Fri Jun 20 15:21:32 2014] [warning]: DBD::mysql::st execute failed:
Unknown column ‘main.IsMerged’ in ‘where clause’ at
Tickets.IsMerged is a new column in RT 4.2, are you sure your upgrade
completed?

-kevin