[Rt-devel] Very tricky double CreateTickets bug in RT3.0.12

Ruediger Riediger ruediger.riediger at sun.com
Fri Apr 22 13:11:36 EDT 2005


Hello RT developers,

it seems that RT3 has trouble creating links for tickets when
"CreateTickets" Action is called twice.

E.g.

Ticket created in "Virus Report"
-> on Create, CreateTickets
   Ticket created in queue "Infection", Members = TOP
   -> on Create, fill CustomField
   -> on CustomField = XXX, CreateTickets
      Ticket created in "Enforcement", MemberOf = TOP

Now, whats happening is that the ticket in "Virus Report" is created,
causing a parent to be created in "Infection", causing a child in
"Enforcement" when a certain condition is met.

If CustomField != XXX, this works and stops as expected.

Ticket 1 in "Virus Report", Ticket 2 in "Infection", 1 being child to 2.

If CustomField = XXX, the second CreateTickets script fails with 'Can't
call method "can" on an undefined value at
/opt/rt3/lib/RT/Action/CreateTickets.pm'

I have: Ticket 1 in "Virus Report", Ticket 2 in "Infection", Ticket 3 in
"Enforcement", 3 being child to 2, but 1 NOT being child to 2.

Apparently, the creation of the "Members" link for ticket 2 is
postponed, but after the second "CreateTickets" run, the required
information is lost. Error occurs here:

        $RT::Logger->debug("Assigned $template_id with $id");
        $T::Tickets{$template_id}->SetOriginObj($self->TicketObj)
-->            if $T::Tickets{$template_id}->can('SetOriginObj');


Is there any fix/way around this?

Logs are attached, here is a relevant extract of the CreateTickets
templates:

for "Virus report" queue:

===Create-Ticket: Infection
Subject: {$Tickets{'TOP'}->Subject}
Queue: Infections
Members: TOP
Content:
{$Tickets{'TOP'}->Transactions->First->Message->First->Content}
ENDOFCONTENT


for "Infection" queue:

===Create-Ticket: Inform
{
    use vars qw/$msg $user $admin/;  # define global vars for this template

    # $msg, $user, $admin are done

    return '';
}Subject: {$Tickets{'TOP'}->Subject}
Date: {$date}
Queue: Enforcements
MemberOf: TOP
{( $user ? "Requestor: ". $user : "Cc: ". $admin )}
Content:
{( $msg )}
ENDOFCONTENT


Best regards,

	Ruediger Riediger

-- 
Dr. Ruediger Riediger                              Sun Microsystems GmbH
NSG - SunCERT                                             Komturstr. 18a
mailto:Ruediger.Riediger at Sun.com                          D-12099 Berlin
------------------------------------------------------------------------
NOTICE:  This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
------------------------------------------------------------------------
PGP 2048RSA/0x2C5020E9          964C E189 0FF0 8882  2BAB 65E2 6912 1FF2
------------------------------------------------------------------------
-------------- next part --------------
Apr 22 16:20:24 unknown RT: Guessed encoding: ascii\n
Apr 22 16:20:24 unknown last message repeated 1 time
Apr 22 16:20:24 unknown RT: Converting 'ascii' to 'utf-8' for text/plain - W32/Mytob.gen at MM on [123.123.123.123]\n\n
Apr 22 16:20:24 unknown RT: <rt-3.0.12-1797-27201.1.27062233010093 at sun.com> #1797/27201 - Scrip 3  (/opt/rt3/lib/RT/Action/SendEmail.pm:92)\n
Apr 22 16:20:24 unknown RT: <rt-3.0.12-1797-27201.1.27062233010093 at sun.com> sent To: archive at localhost Cc:  Bcc:  (/opt/rt3/lib/RT/Action/SendEmail.pm:302)\n
Apr 22 16:20:26 unknown RT: FindInfection: 123.123.123.123 - Fri, 22 Apr 2005 13:52:49 UTC(1114177969)\n
Apr 22 16:20:26 unknown RT: Workflow: processing Infection of RT::Ticket=HASH(0x1b10b5c)\n
Apr 22 16:20:26 unknown RT: Workflow: evaluating\n{\n   ... lots of working code here ...
Apr 22 16:20:26 unknown RT: Workflow: yielding\nSubject: W32/Mytob.gen at MM on [123.123.123.123]\nQueue: Infections\nMembers: TOP\nContent:\n ... lots of working stuff here ... \nENDOFCONTENT\n\n
Apr 22 16:20:27 unknown RT: <rt-3.0.12-1798-27208.8.28972045614357 at sun.com> #1798/27208 - Scrip 3  (/opt/rt3/lib/RT/Action/SendEmail.pm:92)\n
Apr 22 16:20:27 unknown RT: <rt-3.0.12-1798-27208.8.28972045614357 at sun.com> sent To: archive at localhost Cc:  Bcc:  (/opt/rt3/lib/RT/Action/SendEmail.pm:302)\n
Apr 22 16:20:28 unknown RT: Workflow: processing Inform of RT::Ticket=HASH(0x1b07a78)\n
Apr 22 16:20:28 unknown RT: Workflow: evaluating\n{\n    ... lots of working code here ...
Apr 22 16:20:52 unknown RT: Workflow: yielding\nSubject: W32/Mytob.gen at MM on [123.123.123.123]\nQueue: Enforcements \nMemberOf: TOP\nContent:\n ... lots of stuff here ...
Apr 22 16:20:52 unknown RT: <rt-3.0.12-1799-27212.0.449530016162356 at sun.com> #1799/27212 - Scrip 3  (/opt/rt3/lib/RT/Action/SendEmail.pm:92)\n
Apr 22 16:20:52 unknown RT: <rt-3.0.12-1799-27212.0.449530016162356 at sun.com> sent To: archive at localhost Cc:  Bcc:  (/opt/rt3/lib/RT/Action/SendEmail.pm:302)\n
Apr 22 16:20:53 unknown RT: <rt-3.0.12-1799-27212.5.34126626670407 at sun.com> #1799/27212 - Scrip 41 NotifyOnLaunch (/opt/rt3/lib/RT/Action/SendEmail.pm:92)\n
Apr 22 16:20:53 unknown RT: <rt-3.0.12-1799-27212.5.34126626670407 at sun.com> sent To:  Cc: XxXxX Bcc:  (/opt/rt3/lib/RT/Action/SendEmail.pm:302)\n
Apr 22 16:20:54 unknown RT: Ticket 1799 created in queue 'Enforcements' by RT_System (/opt/rt3/lib/RT/Ticket_Overlay.pm:642)\n
Apr 22 16:20:54 unknown RT: Assigned Inform with 1799\n
Apr 22 16:20:54 unknown RT: Handling links for 1799\n
Apr 22 16:20:54 unknown RT: Building MemberOf link for TOP: 1798\n
Apr 22 16:20:54 unknown RT: Handling postponed actions for RT::Ticket=HASH(0x1cb3f1c)\n
Apr 22 16:20:54 unknown RT: Ticket 1798 created in queue 'Infections' by RT_System (/opt/rt3/lib/RT/Ticket_Overlay.pm:642)\n
Apr 22 16:20:54 unknown RT: Assigned Infection with 1798\n
Apr 22 16:20:54 unknown RT: Scrip 92 died. - Can't call method "can" on an undefined value at /opt/rt3/lib/RT/Action/CreateTickets.pm line 471.\n\nStack:\n  [/opt/rt3/lib/RT/Action/CreateTickets.pm:471]\n  [/opt/rt3/lib/RT/ScripAction_Overlay.pm:207]\n  [/opt/rt3/lib/RT/Scrip_Overlay.pm:417]\n  [/opt/rt3/lib/RT/Scrip_Overlay.pm:352]\n  [/opt/rt3/lib/RT/Scrips_Overlay.pm:196]\n  [/opt/rt3/lib/RT/Transaction_Overlay.pm:118]\n  [/opt/rt3/lib/RT/Ticket_Overlay.pm:3815]\n  [/opt/rt3/lib/RT/Ticket_Overlay.pm:3958]\n  [/opt/rt3/lib/RT/Ticket_Overlay.pm:3328]\n  [/opt/rt3/local/lib/RT/Action/FindInfection.pm:95]\n  [/opt/rt3/lib/RT/ScripAction_Overlay.pm:207]\n  [/opt/rt3/lib/RT/Scrip_Overlay.pm:417]\n  [/opt/rt3/lib/RT/Scrip_Overlay.pm:352]\n  [/opt/rt3/lib/RT/Scrips_Overlay.pm:196]\n  [/opt/rt3/lib/RT/Transaction_Overlay.pm:118]\n  [/opt/rt3/lib/RT/Ticket_Overlay.pm:3815]\n  [/opt/rt3/lib/RT/Ticket_Overlay.pm:631]\n  [/opt/rt3/local/lib/RT/Interface/Email_Local.pm:306]\n  [/opt/rt3/local/html/REST/1.0/NoAuth/mail-gateway:34]\n (/opt/rt3/lib/RT/Scrip_Overla
Apr 22 16:20:55 unknown RT: Ticket 1797 created in queue 'Virus Reports' by rr120170 (/opt/rt3/lib/RT/Ticket_Overlay.pm:642)\n


More information about the Rt-devel mailing list