Rt4.0: anonymous hash error on apache startup

Hello everyone,

We’ve recently upgraded to 4.0.0 and whenever we start up our apache (using mod_perl), we get the following errors:

Starting httpd: Odd number of elements in anonymous hash at /opt/rt4/sbin/…/lib/RT/Config.pm line 861.
Use of uninitialized value in anonymous hash ({}) at /opt/rt4/sbin/…/lib/RT/Config.pm line 861.
Odd number of elements in hash assignment at /opt/rt4/sbin/…/lib/RT/Config.pm line 862.
Use of uninitialized value in list assignment at /opt/rt4/sbin/…/lib/RT/Config.pm line 862.

This seems to reference this subroutine in /opt/rt4//lib/RT/Config.pm

sub Set {
my ( $self, $name ) = ( shift, shift );

my $old = $OPTIONS{$name};
my $type = $META{$name}->{'Type'} || 'SCALAR';
if ( $type eq 'ARRAY' ) {
    $OPTIONS{$name} = [@_];
    { no warnings 'once'; no strict 'refs'; @{"RT::$name"} = (@_); }
} elsif ( $type eq 'HASH' ) {
    $OPTIONS{$name} = {@_};
    { no warnings 'once'; no strict 'refs'; %{"RT::$name"} = (@_); }
} else {
    $OPTIONS{$name} = shift;
    {no warnings 'once'; no strict 'refs'; ${"RT::$name"} = $OPTIONS{$name}; }
}
$META{$name}->{'Type'} = $type;
return $self->_ReturnValue( $old, $type );

}

Apache starts up fine, and RT seems to be working, but this is concerning to us. Any suggestions or insight into what might be the issue?

Thanks,

Dan Rohan

Hello,

Problem is in your config file. Somewhere you set a hash option
(key-value pairs), but misses key or value and number of elements in
assignment is odd.On Sat, May 28, 2011 at 2:15 PM, Daniel G. Rohan d-rohan@northwestern.edu wrote:

Hello everyone,

We’ve recently upgraded to 4.0.0 and whenever we start up our apache (using mod_perl), we get the following errors:

Starting httpd: Odd number of elements in anonymous hash at /opt/rt4/sbin/…/lib/RT/Config.pm line 861.
Use of uninitialized value in anonymous hash ({}) at /opt/rt4/sbin/…/lib/RT/Config.pm line 861.
Odd number of elements in hash assignment at /opt/rt4/sbin/…/lib/RT/Config.pm line 862.
Use of uninitialized value in list assignment at /opt/rt4/sbin/…/lib/RT/Config.pm line 862.

This seems to reference this subroutine in /opt/rt4//lib/RT/Config.pm

sub Set {
my ( $self, $name ) = ( shift, shift );

my $old = $OPTIONS{$name};
my $type = $META{$name}->{‘Type’} || ‘SCALAR’;
if ( $type eq ‘ARRAY’ ) {
$OPTIONS{$name} = [@];
{ no warnings ‘once’; no strict ‘refs’; @{“RT::$name”} = (@
); }
} elsif ( $type eq ‘HASH’ ) {
$OPTIONS{$name} = {@};
{ no warnings ‘once’; no strict ‘refs’; %{“RT::$name”} = (@
); }
} else {
$OPTIONS{$name} = shift;
{no warnings ‘once’; no strict ‘refs’; ${“RT::$name”} = $OPTIONS{$name}; }
}
$META{$name}->{‘Type’} = $type;
return $self->_ReturnValue( $old, $type );
}

Apache starts up fine, and RT seems to be working, but this is concerning to us. Any suggestions or insight into what might be the issue?

Thanks,

Dan Rohan

Best regards, Ruslan.

Ruslan Zakirov wrote, On 5/28/11 1:46 PM:

Hello,

Problem is in your config file. Somewhere you set a hash option
(key-value pairs), but misses key or value and number of elements in
assignment is odd.

A very likely cause of this is the ChartFont setting. It changed from a
scalar in RT3 to a hash in RT4, so the config ‘Set’ command for RT3 will
generate that specific error.> On Sat, May 28, 2011 at 2:15 PM, Daniel G. Rohan d-rohan@northwestern.edu wrote:

Hello everyone,

We’ve recently upgraded to 4.0.0 and whenever we start up our apache (using mod_perl), we get the following errors:

Starting httpd: Odd number of elements in anonymous hash at /opt/rt4/sbin/…/lib/RT/Config.pm line 861.
Use of uninitialized value in anonymous hash ({}) at /opt/rt4/sbin/…/lib/RT/Config.pm line 861.
Odd number of elements in hash assignment at /opt/rt4/sbin/…/lib/RT/Config.pm line 862.
Use of uninitialized value in list assignment at /opt/rt4/sbin/…/lib/RT/Config.pm line 862.

This seems to reference this subroutine in /opt/rt4//lib/RT/Config.pm

sub Set {
my ( $self, $name ) = ( shift, shift );

my $old = $OPTIONS{$name};
my $type = $META{$name}->{'Type'} || 'SCALAR';
if ( $type eq 'ARRAY' ) {
    $OPTIONS{$name} = [@_];
    { no warnings 'once'; no strict 'refs'; @{"RT::$name"} = (@_); }
} elsif ( $type eq 'HASH' ) {
    $OPTIONS{$name} = {@_};
    { no warnings 'once'; no strict 'refs'; %{"RT::$name"} = (@_); }
} else {
    $OPTIONS{$name} = shift;
    {no warnings 'once'; no strict 'refs'; ${"RT::$name"} = $OPTIONS{$name}; }
}
$META{$name}->{'Type'} = $type;
return $self->_ReturnValue( $old, $type );

}

Apache starts up fine, and RT seems to be working, but this is concerning to us. Any suggestions or insight into what might be the issue?

Thanks,

Dan Rohan

Ruslan Zakirov wrote, On 5/28/11 1:46 PM:

Hello,

Problem is in your config file. Somewhere you set a hash option
(key-value pairs), but misses key or value and number of elements in
assignment is odd.

A very likely cause of this is the ChartFont setting. It changed from a
scalar in RT3 to a hash in RT4, so the config ‘Set’ command for RT3 will
generate that specific error.

Thank you Ruslan and Bill. Bill, you were right on the money-- as soon as I commented out that setting (it was undefined anyway), the error disappeared.

Much appreciation.

Dan Rohan

Ruslan Zakirov wrote, On 5/28/11 1:46 PM:

Hello,

Problem is in your config file. Somewhere you set a hash option
(key-value pairs), but misses key or value and number of elements in
assignment is odd.

A very likely cause of this is the ChartFont setting. It changed from a
scalar in RT3 to a hash in RT4, so the config ‘Set’ command for RT3 will
generate that specific error.

Thank you Ruslan and Bill. Bill, you were right on the money-- as soon as I commented out that setting (it was undefined anyway), the error disappeared.

You probably have copy of default settings from some version of
RT_Config.pm in RT_SiteConfig.pm then. It’s bad practice that leads to
such problems. Review your site config and leave only those that
differs from defaults.

Much appreciation.

Dan Rohan

Best regards, Ruslan.

Ruslan Zakirov wrote, On 5/28/11 1:46 PM:

Hello,

Problem is in your config file. Somewhere you set a hash option
(key-value pairs), but misses key or value and number of elements in
assignment is odd.

A very likely cause of this is the ChartFont setting. It changed
from a scalar in RT3 to a hash in RT4, so the config ‘Set’ command
for RT3 will generate that specific error.

This actually changed between 3.8.7 and 3.8.8
There are notes about it in docs/UPGRADING-3.8

As Ruslan notes later in the thread, if you aren’t customizing the
setting, you really shouldn’t copy settings from RT_Config.pm to
RT_SiteConfig.pm. You especially shouldn’t just copy everything over.

-kevin> >On Sat, May 28, 2011 at 2:15 PM, Daniel G. Rohan d-rohan@northwestern.edu wrote:

Hello everyone,

We’ve recently upgraded to 4.0.0 and whenever we start up our apache (using mod_perl), we get the following errors:

Starting httpd: Odd number of elements in anonymous hash at /opt/rt4/sbin/…/lib/RT/Config.pm line 861.
Use of uninitialized value in anonymous hash ({}) at /opt/rt4/sbin/…/lib/RT/Config.pm line 861.
Odd number of elements in hash assignment at /opt/rt4/sbin/…/lib/RT/Config.pm line 862.
Use of uninitialized value in list assignment at /opt/rt4/sbin/…/lib/RT/Config.pm line 862.

This seems to reference this subroutine in /opt/rt4//lib/RT/Config.pm

sub Set {
my ( $self, $name ) = ( shift, shift );

my $old = $OPTIONS{$name};
my $type = $META{$name}->{‘Type’} || ‘SCALAR’;
if ( $type eq ‘ARRAY’ ) {
$OPTIONS{$name} = [@];
{ no warnings ‘once’; no strict ‘refs’; @{“RT::$name”} = (@
); }
} elsif ( $type eq ‘HASH’ ) {
$OPTIONS{$name} = {@};
{ no warnings ‘once’; no strict ‘refs’; %{“RT::$name”} = (@
); }
} else {
$OPTIONS{$name} = shift;
{no warnings ‘once’; no strict ‘refs’; ${“RT::$name”} = $OPTIONS{$name}; }
}
$META{$name}->{‘Type’} = $type;
return $self->_ReturnValue( $old, $type );
}

Apache starts up fine, and RT seems to be working, but this is concerning to us. Any suggestions or insight into what might be the issue?

Thanks,

Dan Rohan