[rt-users] Ticket Errors

Mathew Snyder theillien at yahoo.com
Fri Feb 9 01:11:41 EST 2007


The results of each query are attached as .txt files.


Ruslan Zakirov wrote:
> I'm terribly sorry bu here is more correct queries:
> 
> SELECT p.id, p.PrincipalType, txn.id txn_id, txn.Field, txn.NewValue,
> txn.ReferenceType, txn.NewReference, t.id tid FROM Tickets t JOIN
> Transactions txn ON txn.Type = 'AddWatcher' AND txn.ObjectType =
> 'RT::Ticket' AND txn.ObjectId = t.id LEFT JOIN Principals p ON p.id =
> txn.NewValue WHERE p.id IS NULL AND t.id = XXX;
> 
> and
> 
> SELECT p.id, p.PrincipalType, txn.id txn_id, txn.Field, txn.NewValue,
> txn.ReferenceType, txn.NewReference, txn.ObjectId tid FROM
> Transactions txn LEFT JOIN Principals p ON p.id = txn.NewValue WHERE
> txn.Type = 'AddWatcher' AND txn.ObjectType = 'RT::Ticket' AND p.id IS
> NULL;
> 
> 
> On 2/9/07, Ruslan Zakirov <ruslan.zakirov at gmail.com> wrote:
>> On 2/9/07, Mathew Snyder <theillien at yahoo.com> wrote:
>> > It would appear I removed someone that was added as a CC:
>> >
>> > +--------+-----------+---------------+--------------+-------+
>> > | Name   | Field     | ReferenceType | NewReference | tid   |
>> > +--------+-----------+---------------+--------------+-------+
>> > | NULL   | Cc        | NULL          |         NULL | 55767 |
>> > | rbates | Requestor | NULL          |         NULL | 55767 |
>> > +--------+-----------+---------------+--------------+-------+
>> >
>> > Is it possible to correct this?
>> Yes, sure.
>> This means that you've deleted a user who was added as Cc watcher to
>> ticket 55767. As well this means a bug exists in shredder and I've
>> fixed it and released shredder 0.05.
>>
>> The following query is more informative:
>> SELECT u.Name, txn.id txn_id, txn.Field, txn.NewValue, txn.ReferenceType,
>> txn.NewReference, t.id tid FROM Tickets t JOIN Transactions txn ON
>> txn.Type = 'AddWatcher' AND txn.ObjectType = 'RT::Ticket' AND
>> txn.ObjectId = t.id LEFT JOIN Users u ON u.id = txn.NewValue WHERE
>> u.id IS NULL AND t.id = XXXXX;
>>
>> This query selects only transactions with problems. txn_id column in
>> the result will show you problematic Transactions and NewValue column
>> will show you ids of the users that don't exist anymore.
>>
>> You can safely delete this transactions using the following query:
>> DELETE FROM Transactions WHERE id IN (xxx, xxx, xxx,...);
>>
>> Also, you can select all such transactions from your DB:
>> SELECT u.Name, txn.id txn_id, txn.Field, txn.NewValue, txn.ReferenceType,
>> txn.NewReference, t.id tid FROM Tickets t JOIN Transactions txn ON
>> txn.Type = 'AddWatcher' AND txn.ObjectType = 'RT::Ticket' AND
>> txn.ObjectId = t.id LEFT JOIN Users u ON u.id = txn.NewValue WHERE
>> u.id IS NULL;
>>
>> If amount of the transactions is too big then I could help you write
>> down a delete query that will delete all this txns.
>>
>>
>>
>> >
>> > Ruslan Zakirov wrote:
>> > > Please, run the following SQL query:
>> > > SELECT u.Name, txn.Field, txn.ReferenceType, txn.NewReference, t.id
>> > > tid FROM Tickets t JOIN Transactions txn ON txn.Type = 'AddWatcher'
>> > > AND txn.ObjectType = 'RT::Ticket' AND txn.ObjectId = t.id LEFT JOIN
>> > > Users u ON u.id = txn.NewValue WHERE t.id = XXXXX;
>> > >
>> > > Where XXXX id of the ticket. Then send me results.
>> > >
>> > >
>> > > On 2/7/07, Mathew Snyder <theillien at yahoo.com> wrote:
>> > >> I'd like to add to this.  I've looked at the database and found that
>> > >> there are
>> > >> 63 transactions attached to this ticket.  There are also no
>> > >> transactions for
>> > >> which there isn't a user.  I've looked up the names on each user
>> id in
>> > >> the
>> > >> transactions table and found that they correspond to someone that
>> > >> would likely
>> > >> have had a part in the ticket.
>> > >>
>> > >> There are as many user id entries as there are transactions.  What I
>> > >> mean is,
>> > >> there are multiple entries for some ids but all transactions have a
>> > >> user id
>> > >> attached to it.  This tells me that the transactions aren't
>> corrupted
>> > >> by a
>> > >> missing user that possibly got Shredded out of the database.
>> > >>
>> > >> As I've said before, this isn't the first time we've seen this so
>> I'm
>> > >> beginning
>> > >> to think this is a bug of some sort.
>> > >>
>> > >> The full error follows.
>> > >>
>> > >> error:          Can't call method "Name" on an undefined value at
>> > >> /usr/local/rt-3.6.1//lib/RT/Transaction_Overlay.pm line 690.
>> > >> context:
>> > >> ...
>> > >> 686:    AddWatcher => sub {
>> > >> 687:    my $self = shift;
>> > >> 688:    my $principal = RT::Principal->new($self->CurrentUser);
>> > >> 689:    $principal->Load($self->NewValue);
>> > >> 690:    return $self->loc( "[_1] [_2] added", $self->Field,
>> > >> $principal->Object->Name);
>> > >> 691:    },
>> > >> 692:    DelWatcher => sub {
>> > >> 693:    my $self = shift;
>> > >> 694:    my $principal = RT::Principal->new($self->CurrentUser);
>> > >> ...
>> > >> code stack:    
>> /usr/local/rt-3.6.1/lib/RT/Transaction_Overlay.pm:690
>> > >> /usr/local/rt-3.6.1/lib/RT/Transaction_Overlay.pm:602
>> > >> /usr/local/rt-3.6.1/share/html/Ticket/Elements/ShowTransaction:54
>> > >> /usr/local/rt-3.6.1/share/html/Ticket/Elements/ShowHistory:102
>> > >> /usr/local/rt-3.6.1/share/html/Ticket/Display.html:63
>> > >> /usr/local/rt-3.6.1/share/html/autohandler:279
>> > >>
>> > >>
>> > >>
>> > >> raw error
>> > >> Can't call method "Name" on an undefined value at
>> > >> /usr/local/rt-3.6.1//lib/RT/Transaction_Overlay.pm line 690.
>> > >>
>> > >>
>> > >> Trace begun at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Exceptions.pm line 129
>> > >> HTML::Mason::Exceptions::rethrow_exception('Can\'t call method
>> "Name"
>> > >> on an
>> > >> undefined value at
>> /usr/local/rt-3.6.1//lib/RT/Transaction_Overlay.pm
>> > >> line
>> > >> 690.^J') called at /usr/local/rt-3.6.1/lib/RT/Transaction_Overlay.pm
>> > >> line 690
>> > >> RT::Transaction::__ANON__('RT::Transaction=HASH(0xc706568)')
>> called at
>> > >> /usr/local/rt-3.6.1/lib/RT/Transaction_Overlay.pm line 602
>> > >> RT::Transaction::BriefDescription('RT::Transaction=HASH(0xc706568)')
>> > >> called at
>> > >> /usr/local/rt-3.6.1/share/html/Ticket/Elements/ShowTransaction
>> line 54
>> > >> HTML::Mason::Commands::__ANON__('Attachments',
>> > >> 'RT::Attachments=HASH(0xc99b5f0)', 'Ticket',
>> > >> 'RT::Ticket=HASH(0xc54ce28)',
>> > >> 'AttachmentContent', 'RT::Attachments=HASH(0xc98d840)',
>> 'ShowHeaders',
>> > >> undef,
>> > >> 'Collapsed', undef, 'Tickets', undef, 'AttachPath',
>> '/Ticket/Attachment',
>> > >> 'UpdatePath', '/Ticket/Update.html', 'Ticket',
>> > >> 'RT::Ticket=HASH(0xc54ce28)',
>> > >> 'Transaction', 'RT::Transaction=HASH(0xc706568)', 'ShowHeaders',
>> undef,
>> > >> 'Collapsed', undef, 'RowNum', 23, 'ShowTitleBarCommands', 1,
>> > >> 'Attachments',
>> > >> 'ARRAY(0xc59f11c)', 'AttachmentContent', 'HASH(0xc6a31d4)',
>> > >> 'LastTransaction',
>> > >> 0) called at
>> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Component.pm
>> > >> line 135
>> > >>
>> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xbf6c9a0)',
>>
>> > >>
>> > >> 'Attachments', 'RT::Attachments=HASH(0xc99b5f0)', 'Ticket',
>> > >> 'RT::Ticket=HASH(0xc54ce28)', 'AttachmentContent',
>> > >> 'RT::Attachments=HASH(0xc98d840)', 'ShowHeaders', undef,
>> 'Collapsed',
>> > >> undef,
>> > >> 'Tickets', undef, 'AttachPath', '/Ticket/Attachment', 'UpdatePath',
>> > >> '/Ticket/Update.html', 'Ticket', 'RT::Ticket=HASH(0xc54ce28)',
>> > >> 'Transaction',
>> > >> 'RT::Transaction=HASH(0xc706568)', 'ShowHeaders', undef,
>> 'Collapsed',
>> > >> undef,
>> > >> 'RowNum', 23, 'ShowTitleBarCommands', 1, 'Attachments',
>> > >> 'ARRAY(0xc59f11c)',
>> > >> 'AttachmentContent', 'HASH(0xc6a31d4)', 'LastTransaction', 0)
>> called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm line 1251
>> > >> eval {...} at /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm
>> > >> line 1245
>> > >> HTML::Mason::Request::comp(undef, undef, 'Attachments',
>> > >> 'RT::Attachments=HASH(0xc99b5f0)', 'Ticket',
>> > >> 'RT::Ticket=HASH(0xc54ce28)',
>> > >> 'AttachmentContent', 'RT::Attachments=HASH(0xc98d840)',
>> 'ShowHeaders',
>> > >> undef,
>> > >> 'Collapsed', undef, 'Tickets', undef, 'AttachPath',
>> '/Ticket/Attachment',
>> > >> 'UpdatePath', '/Ticket/Update.html', 'Ticket',
>> > >> 'RT::Ticket=HASH(0xc54ce28)',
>> > >> 'Transaction', 'RT::Transaction=HASH(0xc706568)', 'ShowHeaders',
>> undef,
>> > >> 'Collapsed', undef, 'RowNum', 23, 'ShowTitleBarCommands', 1,
>> > >> 'Attachments',
>> > >> 'ARRAY(0xc59f11c)', 'AttachmentContent', 'HASH(0xc6a31d4)',
>> > >> 'LastTransaction',
>> > >> 0) called at
>> > >> /usr/local/rt-3.6.1/share/html/Ticket/Elements/ShowHistory line 102
>> > >> HTML::Mason::Commands::__ANON__('Ticket',
>> 'RT::Ticket=HASH(0xc54ce28)',
>> > >> 'Tickets', undef, 'Collapsed', undef, 'ShowHeaders', undef,
>> > >> 'Attachments',
>> > >> 'RT::Attachments=HASH(0xc99b5f0)', 'AttachmentContent',
>> > >> 'RT::Attachments=HASH(0xc98d840)') called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Component.pm line 135
>> > >>
>> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xbf63114)',
>>
>> > >>
>> > >> 'Ticket', 'RT::Ticket=HASH(0xc54ce28)', 'Tickets', undef,
>> 'Collapsed',
>> > >> undef,
>> > >> 'ShowHeaders', undef, 'Attachments',
>> 'RT::Attachments=HASH(0xc99b5f0)',
>> > >> 'AttachmentContent', 'RT::Attachments=HASH(0xc98d840)') called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm line 1251
>> > >> eval {...} at /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm
>> > >> line 1245
>> > >> HTML::Mason::Request::comp(undef, undef, 'Ticket',
>> > >> 'RT::Ticket=HASH(0xc54ce28)',
>> > >> 'Tickets', undef, 'Collapsed', undef, 'ShowHeaders', undef,
>> > >> 'Attachments',
>> > >> 'RT::Attachments=HASH(0xc99b5f0)', 'AttachmentContent',
>> > >> 'RT::Attachments=HASH(0xc98d840)') called at
>> > >> /usr/local/rt-3.6.1/share/html/Ticket/Display.html line 63
>> > >> HTML::Mason::Commands::__ANON__('id', 55767, 'id', 55767) called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Component.pm line 135
>> > >>
>> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xbbdd85c)',
>>
>> > >>
>> > >> 'id', 55767, 'id', 55767) called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm line 1251
>> > >> eval {...} at /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm
>> > >> line 1245
>> > >> HTML::Mason::Request::comp(undef, undef, 'id', 55767, 'id', 55767)
>> > >> called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm line 914
>> > >>
>> HTML::Mason::Request::call_next('HTML::Mason::Request::ApacheHandler=HASH(0xc99be60)',
>>
>> > >>
>> > >> 'id', 55767) called at /usr/local/rt-3.6.1/share/html/autohandler
>> line
>> > >> 279
>> > >> HTML::Mason::Commands::__ANON__('id', 55767) called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Component.pm line 135
>> > >>
>> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xbb4ad10)',
>>
>> > >>
>> > >> 'id', 55767) called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm
>> > >> line 1246
>> > >> eval {...} at /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm
>> > >> line 1245
>> > >> HTML::Mason::Request::comp(undef, undef, undef, 'id', 55767)
>> called at
>> > >> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm line 459
>> > >> eval {...} at /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm
>> > >> line 459
>> > >> eval {...} at /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/Request.pm
>> > >> line 411
>> > >>
>> HTML::Mason::Request::exec('HTML::Mason::Request::ApacheHandler=HASH(0xc99be60)')
>>
>> > >>
>> > >> called at
>> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/ApacheHandler.pm
>> > >> line 168
>> > >>
>> HTML::Mason::Request::ApacheHandler::exec('HTML::Mason::Request::ApacheHandler=HASH(0xc99be60)')
>>
>> > >>
>> > >> called at
>> /usr/lib/perl5/vendor_perl/5.8.7/HTML/Mason/ApacheHandler.pm
>> > >> line 826
>> > >>
>> HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0xb0c1e5c)',
>>
>> > >>
>> > >> 'Apache2::RequestRec=SCALAR(0xc98d78c)') called at
>> > >> /usr/local/rt-3.6.1/bin/webmux.pl line 123
>> > >> eval {...} at /usr/local/rt-3.6.1/bin/webmux.pl line 123
>> > >> RT::Mason::handler('Apache2::RequestRec=SCALAR(0xc98d78c)')
>> called at
>> > >> -e line 0
>> > >> eval {...} at -e line 0
>> > >>
>> > >> If we don't protect the freedom of speech, how will we know who the
>> > >> assholes are?
>> > >> http://theillien.blogspot.com
>> > >>
>> > >>
>> > >> Mathew Snyder wrote:
>> > >> > I think I've asked about this before and I'm fairly certain I
>> > >> already know the
>> > >> > answer.  However, I'm not certain it should be happening.
>> > >> >
>> > >> > We keep getting the error "Can't call method "Name" on an
>> undefined
>> > >> value..."
>> > >> > If I recall correctly this is a result of eliminating via
>> Shredder a
>> > >> user which
>> > >> > was at one point attatched to a ticket.  The only problem with
>> this
>> > >> is that the
>> > >> > only users I remove are those that are created when we receive
>> spam.
>> > >> >
>> > >> > So is this the only explanation?  More and more of these tickets
>> > >> keep appearing
>> > >> > but I can't figure out how all of these users are disappearing.
>> > >> >
>> > >> > Thanks
>> > >> > Mathew
>> > >> > _______________________________________________
>> > >> > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>> > >> >
>> > >> > Community help: http://wiki.bestpractical.com
>> > >> > Commercial support: sales at bestpractical.com
>> > >> >
>> > >> >
>> > >> > Discover RT's hidden secrets with RT Essentials from O'Reilly
>> Media.
>> > >> > Buy a copy at http://rtbook.bestpractical.com
>> > >> >
>> > >> _______________________________________________
>> > >> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>> > >>
>> > >> Community help: http://wiki.bestpractical.com
>> > >> Commercial support: sales at bestpractical.com
>> > >>
>> > >>
>> > >> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>> > >> Buy a copy at http://rtbook.bestpractical.com
>> > >>
>> > >
>> > >
>> >
>>
>>
>> -- 
>> Best regards, Ruslan.
>>
> 
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: first.txt
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20070209/027e51c6/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: second.txt
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20070209/027e51c6/attachment-0001.txt>


More information about the rt-users mailing list