Error in script

Hello,

I have written a script which takes values from a web page and uses the
CLI to submit a ticket. I get the follwoing error in the apacher error
log when i try to run it:

[Tue Jan 10 12:03:00 2006] [error] [client 131.231.82.229] Can’t locate
/opt/rt3/etc/RT_SiteConfig.pm in @INC (@INC contains: /opt/rt3/etc
/opt/rt3/lib /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3
/usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/5.8.6 .) at /opt/rt3/lib/RT.pm line 131., referer:
http://gilo/Ticket/Create.html?casetype=Problem&Queue=Helpdesk
[Tue Jan 10 12:03:00 2006] [error] [client 131.231.82.229] Premature end
of script headers: create.pl, referer:
http://gilo/Ticket/Create.html?casetype=Problem&Queue=Helpdesk

My questions are:

  1. How can I fix this error?
  2. What is calling RT_SiteConfig and why?

I have attached my script if it helps.

TIA,

Stewart
Stewart Tranter
Computing Services
Loughborough University

E: s.g.tranter@lboro.ac.uk
W: http://www.lboro.ac.uk/computing/
T: +44 (0) 1509 223719
F: +44 (0) 1509 223989

script.txt (2.86 KB)

At Tuesday 1/10/2006 09:07 AM, Stewart Tranter wrote:

Hello,

I have written a script which takes values from a web page and uses the
CLI to submit a ticket. I get the follwoing error in the apacher error
log when i try to run it:

[Tue Jan 10 12:03:00 2006] [error] [client 131.231.82.229] Can’t locate
/opt/rt3/etc/RT_SiteConfig.pm in @INC (@INC contains: /opt/rt3/etc
/opt/rt3/lib

My questions are:

  1. How can I fix this error?
  2. What is calling RT_SiteConfig and why?

I believe RT::LoadConfig(); reads the config file. Do you have read
permissions on the config files in /opt/rt3/etc?

Steve

Stephen Turner wrote:

At Tuesday 1/10/2006 09:07 AM, Stewart Tranter wrote:

Hello,

I have written a script which takes values from a web page and uses
the CLI to submit a ticket. I get the follwoing error in the apacher
error log when i try to run it:

[Tue Jan 10 12:03:00 2006] [error] [client 131.231.82.229] Can’t
locate /opt/rt3/etc/RT_SiteConfig.pm in @INC (@INC contains:
/opt/rt3/etc /opt/rt3/lib

My questions are:

  1. How can I fix this error?
  2. What is calling RT_SiteConfig and why?

I believe RT::LoadConfig(); reads the config file. Do you have read
permissions on the config files in /opt/rt3/etc?

hurrah, after an chmod a+x on RT_Config.pm and RT_SiteConfig.pm, I have
moved on to non-RT Specific messages :)) Thanks!

Stewart

Stewart Tranter wrote:

hurrah, after an chmod a+x on RT_Config.pm and RT_SiteConfig.pm, I have
moved on to non-RT Specific messages :)) Thanks!

Sadly back on to RT errors now. I now get:

[Tue Jan 10 15:23:37 2006] [error] [client 131.231.82.229] [Tue Jan 10
15:23:37 2006] [err]: Couldn’t load from the users database., referer:
http://gilo/Ticket/Create.html?casetype=Problem&Queue=Helpdesk
[Tue Jan 10 15:23:37 2006] [error] [client 131.231.82.229]
(/opt/rt3/lib/RT/CurrentUser.pm:146), referer:
http://gilo/Ticket/Create.html?casetype=Problem&Queue=Helpdesk

I have tried with root and with non-root users, but to no avail :frowning: Can
anyone help please?

TIA,

Stewart
Stewart Tranter
Computing Services
Loughborough University

E: s.g.tranter@lboro.ac.uk
W: IT Services | Loughborough University
T: +44 (0) 1509 223719
F: +44 (0) 1509 223989

At Tuesday 1/10/2006 10:24 AM, Stewart Tranter wrote:

Stewart Tranter wrote:

hurrah, after an chmod a+x on RT_Config.pm and RT_SiteConfig.pm, I have
moved on to non-RT Specific messages :)) Thanks!

Sadly back on to RT errors now. I now get:

[Tue Jan 10 15:23:37 2006] [error] [client 131.231.82.229] [Tue Jan 10
15:23:37 2006] [err]: Couldn’t load from the users database., referer:
http://gilo/Ticket/Create.html?casetype=Problem&Queue=Helpdesk
[Tue Jan 10 15:23:37 2006] [error] [client 131.231.82.229]
(/opt/rt3/lib/RT/CurrentUser.pm:146), referer:
http://gilo/Ticket/Create.html?casetype=Problem&Queue=Helpdesk

I have tried with root and with non-root users, but to no avail :frowning: Can
anyone help please?

For whichever RT user you want to be the ‘current’ user, you have to set
the Gecos field to the Unix login name you are using to run the script. For
example, if you are logged in to the machine as ‘root’ and you want the
current user to be the RT user ‘stewart’, you need to make sure stewart’s
Gecos field in RT is set to ‘root’.

Steve

Stephen Turner wrote:

For whichever RT user you want to be the ‘current’ user, you have to set
the Gecos field to the Unix login name you are using to run the script.
For example, if you are logged in to the machine as ‘root’ and you want
the current user to be the RT user ‘stewart’, you need to make sure
stewart’s Gecos field in RT is set to ‘root’.

Steve

Is this the “Unix login” field in the Users config page? I have set
this to “root”, but I’m still getting the same error.

TIA,

Stewart
Stewart Tranter
Computing Services
Loughborough University

E: s.g.tranter@lboro.ac.uk
W: IT Services | Loughborough University
T: +44 (0) 1509 223719
F: +44 (0) 1509 223989

At Tuesday 1/10/2006 11:19 AM, Stewart Tranter wrote:

Stephen Turner wrote:

For whichever RT user you want to be the ‘current’ user, you have to set
the Gecos field to the Unix login name you are using to run the script.
For example, if you are logged in to the machine as ‘root’ and you want
the current user to be the RT user ‘stewart’, you need to make sure
stewart’s Gecos field in RT is set to ‘root’.
Steve

Is this the “Unix login” field in the Users config page? I have set this
to “root”, but I’m still getting the same error.

Yes, that’s the field. If you’re running the script as root and still
getting the error, I’d suggest using the perl debugger to step through the
code in GetCurrentUser and see what’s going on.

Steve