Problem with "Steal" ticket in RT 3.4.0

I posted this to rt-users last night. Any thoughs? TIA…

I’ve taken a base 3.4.0 install, configured my Groups, Qs, users etc. All
views and creation privs are configured and appear to work well.

I then (*not using the RT API), ripped a bunch of existing "Project like"
data into RT. Everything so far has worked like a charm. The old projects
became tickets, and line items became transactions/attachments – custom
fields populated, all appears well. Tickets maintained their associateion
with users from the old database to RT, and got mapped into appropriate
Queues.

Now, when I try to “steal” a ticket - from anyone - as anyone, I get a
system error (See Bellow). If I create a NEW ticket though, steal works.

It should be noted, that I have successfully performed similar "imports"
into past versions of RT (3.0, 3.2). I thought I had a clean sweep, and
again, everything except for the steal feature works as expected.

Here’s the URI:
/Ticket/Display.html?Action=Steal&id=811

Here’s the Request output:

System error

error: Can’t call method “Delete” on an undefined value at
/opt/rt3/lib/RT/Ticket_Overlay.pm line 2964.

context: …
2960:
2961: # Delete the owner in the owner group, then add a new one
2962: # TODO: is this safe? it’s not how we really want the API to work
2963: # for most things, but it’s fast.
2964: my ( $del_id, $del_msg ) =
$self->OwnerGroup->MembersObj->First->Delete();
2965: unless ($del_id) {
2966: $RT::Handle->Rollback();
2967: return ( 0, $self->loc("Could not change owner. ") . $del_msg );
2968: }

code stack: /opt/rt3/lib/RT/Ticket_Overlay.pm:2964
/opt/rt3/lib/RT/Ticket_Overlay.pm:3062
/opt/rt3/local/html/Ticket/Display.html:122
/opt/rt3/share/html/autohandler:215

Here’s the Raw Error:

Can’t call method “Delete” on an undefined value at
/opt/rt3/lib/RT/Ticket_Overlay.pm line 2964.

Trace begun at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Exceptions.pm
line 131
HTML::Mason::Exceptions::rethrow_exception(‘Can’t call method “Delete” on
an undefined value at /opt/rt3/lib/RT/Ticket_Overlay.pm line 2964.^J’)
called at /opt/rt3/lib/RT/Ticket_Overlay.pm line 2964
RT::ticket::SetOwner(‘RT::Ticket=HASH(0xb2dbaa8)’, 22, ‘Steal’) called at
/opt/rt3/lib/RT/Ticket_Overlay.pm line 3062
RT::ticket::Steal(‘RT::Ticket=HASH(0xb2dbaa8)’) called at
/opt/rt3/local/html/Ticket/Display.html line 122
HTML::Mason::Commands::ANON(‘Action’, ‘Steal’, ‘id’, 811, ‘Action’,
‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Component.pm line 136
HTML::Mason::Component::run(‘HTML::Mason::Component::FileBased=HASH(0xb0a94cc)’,
‘Action’, ‘Steal’, ‘id’, 811, ‘Action’, ‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 1074
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line
1068 HTML::Mason::Request::comp(undef, undef, ‘Action’, ‘Steal’, ‘id’,
811, ‘Action’, ‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 760
HTML::Mason::Request::call_next(‘HTML::Mason::Request::ApacheHandler=HASH(0xb2db39c)’,
‘Action’, ‘Steal’, ‘id’, 811) called at /opt/rt3/share/html/autohandler
line 215
HTML::Mason::Commands::ANON(‘Action’, ‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Component.pm line 136
HTML::Mason::Component::run(‘HTML::Mason::Component::FileBased=HASH(0xaf6afcc)’,
‘Action’, ‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 1069
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line
1068 HTML::Mason::Request::comp(undef, undef, undef, ‘Action’, ‘Steal’,
‘id’, 811) called at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm
line 338
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line
338 eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm
line 297
HTML::Mason::Request::exec(‘HTML::Mason::Request::ApacheHandler=HASH(0xb2db39c)’)
called at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/ApacheHandler.pm line
134
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/ApacheHandler.pm
line 134
HTML::Mason::Request::ApacheHandler::exec(‘HTML::Mason::Request::ApacheHandler=HASH(0xb2db39c)’)
called at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/ApacheHandler.pm line
827
HTML::Mason::ApacheHandler::handle_request(‘HTML::Mason::ApacheHandler=HASH(0xa83790c)’,
‘Apache::RequestRec=SCALAR(0xa8ddf68)’) called at /opt/rt3/bin/webmux.pl
line 132
eval {…} at /opt/rt3/bin/webmux.pl line 132
RT::Mason::handler(‘Apache::RequestRec=SCALAR(0xa8ddf68)’) called at -e
line 0
eval {…} at -e line 0

And, finally output from my rt.log:

[Wed Feb 9 04:57:38 2005] [warning]: DBD::mysql::st execute failed: You
have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near ‘))’ at line 1
at /usr/lib/perl5/site_perl/5.8.3/DBIx/SearchBuilder/Handle.pm line 480.
(/opt/rt3/lib/RT.pm:277)
[Wed Feb 9 04:57:38 2005] [warning]: RT::Handle=HASH(0xacb5c8c) couldn’t
execute the query 'SELECT main.* FROM GroupMembers main WHERE
((main.GroupId = )) ’ at
/usr/lib/perl5/site_perl/5.8.3/DBIx/SearchBuilder/Handle.pm line 494.
(/opt/rt3/lib/RT.pm:277)
[Wed Feb 9 04:57:38 2005] [crit]: Transaction not committed. Usually
indicates a software fault.Data loss may have occurred
(/opt/rt3/lib/RT/Interface/Web/Handler.pm:193)

I must have missed something important during the import. Any insight? My
import code is fairly clean - should be easy to read, and I’de be happy to
share if that would help.

Thanks,

-mike

I then (*not using the RT API), ripped a bunch of existing "Project like"
data into RT. Everything so far has worked like a charm.

How did you “rip” this data into RT? Not using RT’s API is going to hurt
you pretty badly, especially if you don’t get the role groups exactly
right.

I then (*not using the RT API), ripped a bunch of existing "Project like"
data into RT. Everything so far has worked like a charm.

How did you “rip” this data into RT? Not using RT’s API is going to hurt
you pretty badly, especially if you don’t get the role groups exactly
right.

Err. Role groups? I don’t think I touched role groups.

I imported the data with a perl script that gathers and massages my
would-be RT data, builds data structures to reflect the
Ticket/Transaction/Attachment/Customfield/Object model and database
scheme in RT, and pumps the data structures into RT via DBIx::Abstract.

I associated Tickets and Transactions with RT users by finding the Users
id from RT3.Users based on existing user associations in the original
projects database (for projects, and transaction items). Putting the
Tickets into the appropriate Queues involved building a hash that
allowed me to switch QueueID based on the user association for each
Ticket/Transactional item during my row loops.

I’m sure it would behoove me to use the RT API. Apparently I’m one of
those “the hard-way” first type of people. I have every intention of
learning the RT API, again, it seemed faster/easier (until this) to
do the ‘backend’ work myself.

I feel like I’m *very close, but missed the role/groups part during
Ticket creation.

Would you care to see the script? I’ll send it to you, or the list
whatever you prefer. In the meantime, I’ll look into role groups.

Thanks,

-mike

I feel like I’m *very close, but missed the role/groups part during
Ticket creation.

Would you care to see the script? I’ll send it to you, or the list
whatever you prefer. In the meantime, I’ll look into role groups.

I’d actually really rather that you not send that script anywhere that
someone else might see it and think that they should use it. Walking
around the API to mess with RT’s database is going to hurt you in
non-obvious ways.

I’ve taken a base 3.4.0 install, configured my Groups, Qs, users etc. All
views and creation privs are configured and appear to work well.

I then (*not using the RT API), ripped a bunch of existing "Project like"
data into RT. Everything so far has worked like a charm. The old projects
became tickets, and line items became transactions/attachments – custom
fields populated, all appears well. Tickets maintained their associateion
with users from the old database to RT, and got mapped into appropriate
Queues.

Now, when I try to “steal” a ticket - from anyone - as anyone, I get a
system error (See Bellow). If I create a NEW ticket though, steal works.

It should be noted, that I have successfully similar “imports” into past
versions of RT (3.0, 3.2). I thought I had a clean sweep, and again,
everything except for the steal feature works as expected.

Here’s the URI:
/Ticket/Display.html?Action=Steal&id=811

Here’s the Request output:

System error

error: Can’t call method “Delete” on an undefined value at
/opt/rt3/lib/RT/Ticket_Overlay.pm line 2964.

context: …
2960:
2961: # Delete the owner in the owner group, then add a new one
2962: # TODO: is this safe? it’s not how we really want the API to work
2963: # for most things, but it’s fast.
2964: my ( $del_id, $del_msg ) =
$self->OwnerGroup->MembersObj->First->Delete();
2965: unless ($del_id) {
2966: $RT::Handle->Rollback();
2967: return ( 0, $self->loc("Could not change owner. ") . $del_msg );
2968: }

code stack: /opt/rt3/lib/RT/Ticket_Overlay.pm:2964
/opt/rt3/lib/RT/Ticket_Overlay.pm:3062
/opt/rt3/local/html/Ticket/Display.html:122
/opt/rt3/share/html/autohandler:215

Here’s the Raw Error:

Can’t call method “Delete” on an undefined value at
/opt/rt3/lib/RT/Ticket_Overlay.pm line 2964.

Trace begun at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Exceptions.pm
line 131
HTML::Mason::Exceptions::rethrow_exception(‘Can’t call method “Delete” on
an undefined value at /opt/rt3/lib/RT/Ticket_Overlay.pm line 2964.^J’)
called at /opt/rt3/lib/RT/Ticket_Overlay.pm line 2964
RT::ticket::SetOwner(‘RT::Ticket=HASH(0xb2dbaa8)’, 22, ‘Steal’) called at
/opt/rt3/lib/RT/Ticket_Overlay.pm line 3062
RT::ticket::Steal(‘RT::Ticket=HASH(0xb2dbaa8)’) called at
/opt/rt3/local/html/Ticket/Display.html line 122
HTML::Mason::Commands::ANON(‘Action’, ‘Steal’, ‘id’, 811, ‘Action’,
‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Component.pm line 136
HTML::Mason::Component::run(‘HTML::Mason::Component::FileBased=HASH(0xb0a94cc)’,
‘Action’, ‘Steal’, ‘id’, 811, ‘Action’, ‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 1074
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 1068
HTML::Mason::Request::comp(undef, undef, ‘Action’, ‘Steal’, ‘id’, 811,
‘Action’, ‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 760
HTML::Mason::Request::call_next(‘HTML::Mason::Request::ApacheHandler=HASH(0xb2db39c)’,
‘Action’, ‘Steal’, ‘id’, 811) called at /opt/rt3/share/html/autohandler
line 215
HTML::Mason::Commands::ANON(‘Action’, ‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Component.pm line 136
HTML::Mason::Component::run(‘HTML::Mason::Component::FileBased=HASH(0xaf6afcc)’,
‘Action’, ‘Steal’, ‘id’, 811) called at
/usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 1069
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 1068
HTML::Mason::Request::comp(undef, undef, undef, ‘Action’, ‘Steal’, ‘id’,
811) called at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line
338
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 338
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/Request.pm line 297
HTML::Mason::Request::exec(‘HTML::Mason::Request::ApacheHandler=HASH(0xb2db39c)’)
called at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/ApacheHandler.pm line
134
eval {…} at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/ApacheHandler.pm
line 134
HTML::Mason::Request::ApacheHandler::exec(‘HTML::Mason::Request::ApacheHandler=HASH(0xb2db39c)’)
called at /usr/lib/perl5/site_perl/5.8.3/HTML/Mason/ApacheHandler.pm line
827
HTML::Mason::ApacheHandler::handle_request(‘HTML::Mason::ApacheHandler=HASH(0xa83790c)’,
‘Apache::RequestRec=SCALAR(0xa8ddf68)’) called at /opt/rt3/bin/webmux.pl
line 132
eval {…} at /opt/rt3/bin/webmux.pl line 132
RT::Mason::handler(‘Apache::RequestRec=SCALAR(0xa8ddf68)’) called at -e
line 0
eval {…} at -e line 0

And, finally output from my rt.log:

[Wed Feb 9 04:57:38 2005] [warning]: DBD::mysql::st execute failed: You
have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near ‘))’ at line 1
at /usr/lib/perl5/site_perl/5.8.3/DBIx/SearchBuilder/Handle.pm line 480.
(/opt/rt3/lib/RT.pm:277)
[Wed Feb 9 04:57:38 2005] [warning]: RT::Handle=HASH(0xacb5c8c) couldn’t
execute the query 'SELECT main.* FROM GroupMembers main WHERE
((main.GroupId = )) ’ at
/usr/lib/perl5/site_perl/5.8.3/DBIx/SearchBuilder/Handle.pm line 494.
(/opt/rt3/lib/RT.pm:277)
[Wed Feb 9 04:57:38 2005] [crit]: Transaction not committed. Usually
indicates a software fault.Data loss may have occurred
(/opt/rt3/lib/RT/Interface/Web/Handler.pm:193)

I must have missed something important during my import. Any insight?
My import code is fairly clean - should be easy to read, and I’de be happy
to share if that would help.

Thanks,

-mike