Scrip errors

Hmm. On a pristine database:
(
make dropdb
make initialize-database
/opt/rt3/sbin/rt-setup-database --action insert --datafile
etc/upgrade/2.1.71
)
I get errors, quoted below.

A different test using just one scrip which I created didn’t trigger
these, so I wonder if there is something funky going on with the default
scrips or the way there are installed.

[Fri Feb 21 13:40:51 2003] [error]: Scrip 1 died. - Can’t locate object method “CurrentUser” via package “RT::ScripAction” at /opt/rt3/lib/RT/ScripAction_Overlay.pm line 170.

Stack:
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:170]
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:147]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:333]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:169]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:3643]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2268]
[/opt/rt3/lib/RT/Interface/Web.pm:363]
[/opt/rt3/share/html/Ticket/Display.html:101]
[/opt/rt3/share/html/Ticket/Update.html:189]
[/opt/rt3/share/html/autohandler:162]
(/opt/rt3/lib/RT/Scrip_Overlay.pm:360)
[Fri Feb 21 13:40:51 2003] [error]: Scrip 4 died. - Can’t locate object method “LoadById” via package “RT::ScripAction” at /opt/rt3/lib/RT/ScripAction_Overlay.pm line 109.

Stack:
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:108]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:243]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:333]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:169]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:3643]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2268]
[/opt/rt3/lib/RT/Interface/Web.pm:363]
[/opt/rt3/share/html/Ticket/Display.html:101]
[/opt/rt3/share/html/Ticket/Update.html:189]
[/opt/rt3/share/html/autohandler:162]
(/opt/rt3/lib/RT/Scrip_Overlay.pm:360)
[Fri Feb 21 13:40:51 2003] [error]: Scrip 5 died. - Can’t locate object method “LoadById” via package “RT::ScripAction” at /opt/rt3/lib/RT/ScripAction_Overlay.pm line 109.

Stack:
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:108]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:243]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:333]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:169]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:3643]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2268]
[/opt/rt3/lib/RT/Interface/Web.pm:363]
[/opt/rt3/share/html/Ticket/Display.html:101]
[/opt/rt3/share/html/Ticket/Update.html:189]
[/opt/rt3/share/html/autohandler:162]
(/opt/rt3/lib/RT/Scrip_Overlay.pm:360)
[Fri Feb 21 13:40:51 2003] [error]: Scrip 6 died. - Can’t locate object method “LoadById” via package “RT::ScripAction” at /opt/rt3/lib/RT/ScripAction_Overlay.pm line 109.

Stack:
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:108]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:243]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:333]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:169]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:3643]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2268]
[/opt/rt3/lib/RT/Interface/Web.pm:363]
[/opt/rt3/share/html/Ticket/Display.html:101]
[/opt/rt3/share/html/Ticket/Update.html:189]
[/opt/rt3/share/html/autohandler:162]
(/opt/rt3/lib/RT/Scrip_Overlay.pm:360)

etc

I’ve also managed to trigger a Mason error just trying to view the scrips.
What’s going on?

Thanks.

John

Hmm. On a pristine database:
(
make dropdb
make initialize-database
/opt/rt3/sbin/rt-setup-database --action insert --datafile
etc/upgrade/2.1.71
)

So. You’re setting up the database, populating it and then trying to
upgrade it from an older version, which it’s not?

http://www.bestpractical.com/rt – Trouble Ticketing. Free.

Hi
I seem to be having a problem with a scrip
Im now using rt-3.0.4 and exim as MTA

Jul 16 10:48:38 db1 RT: rt-3.0.4RC2-9228-15555.9.96541914179979@telecom1.com
#9228/15555 - Scrip 3
(/export/www/rt3.telecom1.com//lib/RT/Action/SendEmail.pm:92)
Jul 16 10:48:39 db1 RT: rt-3.0.4RC2-9228-15555.9.96541914179979@telecom1.com
sent To: Cc: Bcc: will@telecom1.xxx
(/export/www/rt3.telecom1.com//lib/RT/Action/SendEmail.pm:302)
Jul 16 10:48:39 db1 RT: error: couldn’t parse head; error near: This
message has been automatically generated in response to the creation of a
trouble ticket regarding: ^I"", a summary of which appears below.
(/export/www/rt3.telecom1.com//lib/RT/Template_Overlay.pm:345)
Jul 16 10:48:39 db1 RT: RT::Scrip=HASH(0x91dd8d0): Couldn’t prepare Autoreply
To Requestors (/export/www/rt3.telecom1.com//lib/RT/Scrip_Overlay.pm:338)
Jul 16 10:48:39 db1 RT: Ticket 9228 created in queue ‘WL_eidos’ by
christian@phdi.uk
(/export/www/rt3.telecom1.com//lib/RT/Ticket_Overlay.pm:626)

I have disabled the global scrip to send autoreply to requestors as we dont
want this for every queue. It is enabled for specific individual queues
though.

Could anybody shed some light as to what is going on please?
In the apache logs:
[Wed Jul 16 10:42:31 2003] [notice] FastCGI: process manager initialized (pid
28114)
[Wed Jul 16 10:42:31 2003] [warn] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" started (pid 28120)
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: [Wed Jul 16
09:48:39 2003] [error]: error: couldn’t parse head; error near:
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: This message has
been automatically generated in response to the
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: creation of a
trouble ticket regarding:
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: “”,
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: a summary of
which appears below.
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr:
(/export/www/rt3.telecom1.com//lib/RT/Template_Overlay.pm:345)

Regards,

Brent /"
\ /
Linux Registered X ASCII Ribbon Campaign
User #309941 / \ Against HTML Mail

RT’s outgoing email templates try to understand what the user is doing.

If the first line of the template has a : on it, it assumes it is a
message header, as well as any line until it sees two newlines in a row.
If the first line doesn’t contain a :, it treats it as the message body
from the start. Either hit return a couple times at the top of the
template, or remove that colon.On Wed, Jul 16, 2003 at 11:11:27AM +0100, Brent Geach wrote:

Hi
I seem to be having a problem with a scrip
Im now using rt-3.0.4 and exim as MTA

Jul 16 10:48:38 db1 RT: rt-3.0.4RC2-9228-15555.9.96541914179979@telecom1.com
#9228/15555 - Scrip 3
(/export/www/rt3.telecom1.com//lib/RT/Action/SendEmail.pm:92)
Jul 16 10:48:39 db1 RT: rt-3.0.4RC2-9228-15555.9.96541914179979@telecom1.com
sent To: Cc: Bcc: will@telecom1.xxx
(/export/www/rt3.telecom1.com//lib/RT/Action/SendEmail.pm:302)
Jul 16 10:48:39 db1 RT: error: couldn’t parse head; error near: This
message has been automatically generated in response to the creation of a
trouble ticket regarding: ^I"", a summary of which appears below.
(/export/www/rt3.telecom1.com//lib/RT/Template_Overlay.pm:345)
Jul 16 10:48:39 db1 RT: RT::Scrip=HASH(0x91dd8d0): Couldn’t prepare Autoreply
To Requestors (/export/www/rt3.telecom1.com//lib/RT/Scrip_Overlay.pm:338)
Jul 16 10:48:39 db1 RT: Ticket 9228 created in queue ‘WL_eidos’ by
christian@phdi.uk
(/export/www/rt3.telecom1.com//lib/RT/Ticket_Overlay.pm:626)

I have disabled the global scrip to send autoreply to requestors as we dont
want this for every queue. It is enabled for specific individual queues
though.

Could anybody shed some light as to what is going on please?
In the apache logs:
[Wed Jul 16 10:42:31 2003] [notice] FastCGI: process manager initialized (pid
28114)
[Wed Jul 16 10:42:31 2003] [warn] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" started (pid 28120)
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: [Wed Jul 16
09:48:39 2003] [error]: error: couldn’t parse head; error near:
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: This message has
been automatically generated in response to the
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: creation of a
trouble ticket regarding:
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: “”,
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr: a summary of
which appears below.
[Wed Jul 16 10:48:39 2003] [error] [client 10.0.0.97] FastCGI: server
"/export/www/rt3.telecom1.com/bin/mason_handler.fcgi" stderr:
(/export/www/rt3.telecom1.com//lib/RT/Template_Overlay.pm:345)


Regards,

Brent /"
\ /
Linux Registered X ASCII Ribbon Campaign
User #309941 / \ Against HTML Mail


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

http://www.bestpractical.com/rt – Trouble Ticketing. Free.

if i have written a custom scrip, and there is an error in the code
somewhere, where can i get information for debugging?

Andrew Xenides
Web Developer
EscapeNet
465 South Road
Keswick SA 5035
T: (08) 8292 5200
F: (08) 8292 5299
E: andrew@staff.esc.net.au
W: http://www.esc.net.au

Andrew Xenides wrote:

if i have written a custom scrip, and there is an error in the code
somewhere, where can i get information for debugging?
http://wiki.bestpractical.com/index.cgi?Debug

Please, allways Cc to the list.

Andrew Xenides wrote:

Ok, nothing in the logs. Basically what I want for the ticket to be taken by
anyone that does something to a ticket that is currently owned by nobody. I
have put this script under global.

This is my conditions

On Transaction User Defined with template Blank

This is my Custom action preparation code:
my $ticket = $self->TicketObj;
if ($ticket->Owner ne “Nobody”) {
Owner method returns user’s ID!
You should use:
return unless $ticket->Owner == $RT::Nobody->Id;

return undef;

}
my $trans = $self->TransactionObj;
if (!$trans->CurrentUserHasRight(“TakeTicket”)) {
this can be
return unless $ticket->CurrentUserHasRight(“TakeTicket”);

return undef;

}
$self->{‘newowner’} = $trans->Creator;
I don’t remeber could you save this or not.
IMHO you don’t get any advantages from saving and can avoid it to be
[backward|forward]compatible.

return 1;

This is the Custom action cleanup code:
$self->TicketObj->SetOwner($self->{‘newowner’});
my $ticket = $self->TicketObj;
my ($status, $msg) = $ticket->SetOwner( $self->Transaction->Creator );
unless( $status ) {
$RT::Logger->error( “Couldn’t set owner: $msg” );
return 0;
}
return 1;

return 1;

This is the log when a reply is made to a job

[snip]

Regards, Ruslan.

}
$self->{‘newowner’} = $trans->Creator;
I don’t remeber could you save this or not.
IMHO you don’t get any advantages from saving and can avoid it to be
[backward|forward]compatible.

So your saying I can get rid of this completely?

Andrew Xenides wrote:

}
$self->{‘newowner’} = $trans->Creator;

I don’t remeber could you save this or not.
IMHO you don’t get any advantages from saving and can avoid it to be
[backward|forward]compatible.

So your saying I can get rid of this completely?
Yes, I’ve sent you scrip action that doesn’t use this.

Ok, I think we are getting somewhere, I have an error now :stuck_out_tongue:

[Fri May 6 08:16:48 2005] [debug]: About to commit scrips for transaction
#18830 (/opt/rt3/lib/RT/Transaction_Overlay.pm:167)
[Fri May 6 08:16:48 2005] [error]: Scrip 15 Commit failed: Can’t locate
object method “Transaction” via package “RT::Action::UserDefined” at (eval
472) line 2.

Stack:
[(eval 472):2]
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:228]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:506]
[/opt/rt3/lib/RT/Scrips_Overlay.pm:191]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:168]
[/opt/rt3/lib/RT/Record.pm:1373]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:3439]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:3176]
[/opt/rt3/lib/RT/Record.pm:873]
[/opt/rt3/lib/RT/Interface/Web.pm:934]
[/opt/rt3/lib/RT/Interface/Web.pm:1048]
[/opt/rt3/share/html/Ticket/Display.html:141]
[/opt/rt3/share/html/Ticket/Update.html:211]
[/opt/rt3/share/html/autohandler:215]
(/opt/rt3/lib/RT/Action/UserDefined.pm:81)

Scrip is:

my $ticket = $self->TicketObj;
return unless $ticket->Owner == $RT::Nobody->Id;
my $trans = $self->TransactionObj;
return unless $ticket->CurrentUserHasRight(“TakeTicket”);
return 1;

Clean up code:

my $ticket = $self->TicketObj;
my ($status, $msg) = $ticket->SetOwner( $self->Transaction->Creator );
unless( $status ) {
$RT::Logger->error( “Couldn’t set owner: $msg” );
return 0;
}
return 1;

Andrew Xenides
Web Developer
EscapeNet
465 South Road
Keswick SA 5035
T: (08) 8292 5200
F: (08) 8292 5299
E: andrew@staff.esc.net.au
W: http://www.esc.net.au

Andrew Xenides wrote:
[snip]
FYI major RT global variables($RT::Nobody as example) are described in
http://wiki.bestpractical.com/index.cgi?GlobalObjects

Oops.

Andrew Xenides wrote:

Ok, I think we are getting somewhere, I have an error now :stuck_out_tongue:

[Fri May 6 08:16:48 2005] [debug]: About to commit scrips for transaction
#18830 (/opt/rt3/lib/RT/Transaction_Overlay.pm:167)
[Fri May 6 08:16:48 2005] [error]: Scrip 15 Commit failed: Can’t locate
object method “Transaction” via package “RT::Action::UserDefined” at (eval
472) line 2.

[snip]

Scrip is:

my $ticket = $self->TicketObj;
return unless $ticket->Owner == $RT::Nobody->Id;
my $trans = $self->TransactionObj;
return unless $ticket->CurrentUserHasRight(“TakeTicket”);
return 1;

Clean up code:

my $ticket = $self->TicketObj;
my ($status, $msg) = $ticket->SetOwner( $self->Transaction->Creator );
my ($status, $msg) = $ticket->SetOwner( $self->TransactionObj->Creator );