Tags:
create new tag
view all tags

SID-01952: Admin login fails with uninitialized at PreferencePlugin.pm

Status: Unanswered Unanswered TWiki version: 6.0.0 Perl version: perl 5, version 18, subversion 2 (v5.18.2) built for x86_64
Category: PreferencesPlugin Server OS: Ubuntu 14.04 Last update: 11 years ago

When I click on a user from the TwikiUsers section on /do/view/Main/WebHome "Use of uninitialized value in lc at /var/www/twiki/lib/TWiki/Plugins/PreferencesPlugin.pm line 120."

I just did the installation using Twiki 6.0 on Ubuntu 14.04.

After some investigation, I noticed that the $query->param is equal to 0.

The $query is set by TWiki::Func::getCgiQuery() so I believe that this is not being set properly.

There are no errors in the apache error log, access log or the twiki log.

There are no config errors or warnings on the do/configure page. I can login from the configure page.

-- Chris Radyk - 2014-07-26

Discussion and Answer

Additionally, the dump of the query returned from

my $query = TWiki::Func::getCgiQuery();

is

query = $VAR1 = bless( {
                 'uploads' => {},
                 'remote_address' => '192.168.1.131',
                 'remote_user' => undef,
                 'cookies' => {
                                'TWIKISID' => bless( {
                                                       'name' => 'TWIKISID',
                                                       'value' => [
                                                                    '3836f16990625d3e6d1efce7ad13b979'
                                                                  ],
                                                       'path' => '/'
                                                     }, 'CGI::Cookie' )
                              },
                 'headers' => {
                                'user-agent' => [
                                                  'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0'
                                                ],
                                'connection' => [
                                                  'keep-alive'
                                                ],
                                'accept' => [
                                              'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
                                            ],
                                'host' => [
                                            '192.168.1.77'
                                          ],
                                'accept-language' => [
                                                       'en-US,en;q=0.5'
                                                     ],
                                'accept-encoding' => [
                                                       'gzip, deflate'
                                                     ],
                                'cookie' => [
                                              'TWIKISID=3836f16990625d3e6d1efce7ad13b979'
                                            ],
                                'referer' => [
                                               'http://192.168.1.77/do/save/Main/ChrisRadyk'
                                             ]
                              },
                 'uri' => '/do/view/Main/ChrisRadyk',
                 'request_method' => 'GET',
                 'secure' => 0,
                 'param_list' => [],
                 'path_info' => '/Main/ChrisRadyk',
                 'param' => {},
                 'action' => 'view',
                 'server_port' => undef
               }, 'TWiki::Request' );
As you can see 'param' is not being set so therefore the line on 120 fails because it is trying to access the unitialized value. my $action = lc $query->param( 'prefsaction' );

Any ideas on the correct way to resolve this? Why would I be seeing this when no one else is?

Thanks

-- Chris Radyk - 2014-07-27

Your diagnosis is correct, and it has been fixed after TWiki 6.0.0 came out: http://develop.twiki.org/~twiki4/cgi-bin/view/Bugs/Item7504.

Unfortunately I can not reproduce the behaviour you are seeing, not even after setting the configuration variable WarningsAreErrors. The "uninitialized value" is only a warning, so it should not prevent TWiki from processing the page. Strange.

You could either install the current PreferencesPlugin, or apply the one-line-fix manually, or we'd need to figure out why your installation gives this error message, but apparently without actually dying (if a request dies, it leaves a trace in the error log). The current line 120 reads:

my $action = lc( $query->param( 'prefsaction' ) || '' );

-- Harald Jörg - 2014-07-27

So, I figured out why it was an issue. I had forgot that I enabled the flags

$ENV{TWIKI_ASSERTS} = 1; $ENV{TWIKI_MONITOR} = 1;

in LocalLib.cfg. That explains why I was seeing the warning.

Thanks for you reply.

-- Chris Radyk - 2014-07-28

-- Chris Radyk - 2014-07-28

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Unanswered
Title Admin login fails with uninitialized at PreferencePlugin.pm
SupportCategory PreferencesPlugin
TWiki version 6.0.0
Server OS Ubuntu 14.04
Web server Apache/2.4.7 (Ubuntu)
Perl version perl 5, version 18, subversion 2 (v5.18.2) built for x86_64
Browser & version Firefox 31.0 or Chrome
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2014-07-28 - ChrisRadyk
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.