Closed Bug 233124 Opened 21 years ago Closed 20 years ago

Table 'namedqueries' was not locked with LOCK TABLES trying to update my watch list

Categories

(Bugzilla :: User Accounts, defect)

defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 240036

People

(Reporter: justdave, Assigned: myk)

References

Details

I went to userprefs.cgi, clicked the tab for Email Settings, added a name to my
watch list, and clicked submit.  Got the following error (which I can reproduce
at will:

Bugzilla has suffered an internal error. Please save this page and send it to
myk@mozilla.org with details of what you were doing at the time this message
appeared.

URL: http://bugzilla.mozilla.org/userprefs.cgi

Template->process() failed twice.
First error: undef error - DBD::mysql::st execute failed: Table 'namedqueries'
was not locked with LOCK TABLES [for statement `` SELECT name, query,
linkinfooter FROM namedqueries WHERE userid=? ORDER BY UPPER(name)'']) at
Bugzilla/User.pm line 156
Bugzilla::User::queries('Bugzilla::User=HASH(0x85b79ac)') called at
data/template/template/en/default/global/site-navigation.html.tmpl line 143 eval
{...} called at
data/template/template/en/default/global/site-navigation.html.tmpl line 143 eval
{...} called at
data/template/template/en/default/global/site-navigation.html.tmpl line 16
Template::Provider::__ANON__('Template::Context=HASH(0x8537d14)') called at
Template/Document.pm line 140 eval {...} called at Template/Document.pm line 138
Template::Document::process('Template::Document=HASH(0x86c761c)',
'Template::Context=HASH(0x8537d14)') called at Template/Context.pm line 343 eval
{...} called at Template/Context.pm line 320
Template::Context::process('Template::Context=HASH(0x8537d14)',
'global/site-navigation.html.tmpl') called at
data/template/template/en/default/global/header.html.tmpl line 57 eval {...}
called at data/template/template/en/default/global/header.html.tmpl line 16
Template::Provider::__ANON__('Template::Context=HASH(0x8537d14)') called at
Template/Document.pm line 140 eval {...} called at Template/Document.pm line 138
Template::Document::process('Template::Document=HASH(0x86b7608)',
'Template::Context=HASH(0x8537d14)') called at Template/Context.pm line 343 eval
{...} called at Template/Context.pm line 320
Template::Context::process('Template::Context=HASH(0x8537d14)',
'global/header.html.tmpl') called at
data/template/template/en/default/global/user-error.html.tmpl line 2097 eval
{...} called at data/template/template/en/default/global/user-error.html.tmpl
line 16 Template::Provider::__ANON__('Template::Context=HASH(0x8537d14)') called
at Template/Document.pm line 140 eval {...} called at Template/Document.pm line
138 Template::Document::process('Template::Document=HASH(0x8692c98)',
'Template::Context=HASH(0x8537d14)') called at Template/Context.pm line 343 eval
{...} called at Template/Context.pm line 320
Template::Context::process('Template::Context=HASH(0x8537d14)',
'Template::Document=HASH(0x8692c98)') called at Template/Service.pm line 97 eval
{...} called at Template/Service.pm line 94
Template::Service::process('Template::Service=HASH(0x8510e9c)',
'global/user-error.html.tmpl', 'HASH(0x861d93c)') called at Template.pm line 76
Template::process('Bugzilla::Template=HASH(0x8311dd4)',
'global/user-error.html.tmpl', 'HASH(0x861d93c)') called at Bugzilla/Error.pm
line 44 Bugzilla::Error::_throw_error('global/user-error.html.tmpl',
'invalid_username', 'HASH(0x861d93c)') called at Bugzilla/Error.pm line 51
Bugzilla::Error::ThrowUserError('invalid_username', 'HASH(0x861d93c)') called at
globals.pl line 803 main::DBNameToIdAndCheck('mattyt@tpg.com.au') called at
RelationSet.pm line 180
RelationSet::mergeFromString('RelationSet=HASH(0x860a6d0)',
'documentation@bugzilla.org,endico@mozilla.org,gerv@mozilla.org,j...') called at
RelationSet.pm line 55 RelationSet::new('RelationSet',
'documentation@bugzilla.org,endico@mozilla.org,gerv@mozilla.org,j...') called at
/opt/webtools/bugzilla/userprefs.cgi line 250 main::SaveEmail() called at
/opt/webtools/bugzilla/userprefs.cgi line 322
Second error: undef error - DBD::mysql::st execute failed: Table 'namedqueries'
was not locked with LOCK TABLES [for statement `` SELECT name, query,
linkinfooter FROM namedqueries WHERE userid=? ORDER BY UPPER(name)'']) at
Bugzilla/User.pm line 156
Bugzilla::User::queries('Bugzilla::User=HASH(0x85b79ac)') called at
data/template/template/en/default/global/site-navigation.html.tmpl line 143 eval
{...} called at
data/template/template/en/default/global/site-navigation.html.tmpl line 143 eval
{...} called at
data/template/template/en/default/global/site-navigation.html.tmpl line 16
Template::Provider::__ANON__('Template::Context=HASH(0x8537d14)') called at
Template/Document.pm line 140 eval {...} called at Template/Document.pm line 138
Template::Document::process('Template::Document=HASH(0x86c761c)',
'Template::Context=HASH(0x8537d14)') called at Template/Context.pm line 343 eval
{...} called at Template/Context.pm line 320
Template::Context::process('Template::Context=HASH(0x8537d14)',
'global/site-navigation.html.tmpl') called at
data/template/template/en/default/global/header.html.tmpl line 57 eval {...}
called at data/template/template/en/default/global/header.html.tmpl line 16
Template::Provider::__ANON__('Template::Context=HASH(0x8537d14)') called at
Template/Document.pm line 140 eval {...} called at Template/Document.pm line 138
Template::Document::process('Template::Document=HASH(0x86b7608)',
'Template::Context=HASH(0x8537d14)') called at Template/Context.pm line 343 eval
{...} called at Template/Context.pm line 320
Template::Context::process('Template::Context=HASH(0x8537d14)',
'global/header.html.tmpl') called at
data/template/template/en/default/global/code-error.html.tmpl line 942 eval
{...} called at data/template/template/en/default/global/code-error.html.tmpl
line 16 Template::Provider::__ANON__('Template::Context=HASH(0x8537d14)') called
at Template/Document.pm line 140 eval {...} called at Template/Document.pm line
138 Template::Document::process('Template::Document=HASH(0x870d31c)',
'Template::Context=HASH(0x8537d14)') called at Template/Context.pm line 343 eval
{...} called at Template/Context.pm line 320
Template::Context::process('Template::Context=HASH(0x8537d14)',
'Template::Document=HASH(0x870d31c)') called at Template/Service.pm line 97 eval
{...} called at Template/Service.pm line 94
Template::Service::process('Template::Service=HASH(0x8510e9c)',
'global/code-error.html.tmpl', 'HASH(0x869f398)') called at Template.pm line 76
Template::process('Bugzilla::Template=HASH(0x8311dd4)',
'global/code-error.html.tmpl', 'HASH(0x869f398)') called at Bugzilla/Error.pm
line 70 Bugzilla::Error::ThrowTemplateError('undef error - DBD::mysql::st
execute failed: Table \'namedqueries\' was not locked with LOCK TABLES [for
statement `` SELECT name, query, linkinfooter^J FROM namedqueries^J WHERE
userid=?^J ORDER BY UPPER(name)\'\']) at Bugzilla/User.pm line
156^J^IBugzilla::User::queries(\'Bugzilla::User=HASH(0x85b79ac)\') called at
data/template/template/en/default/global/site-navigation.html.tmpl line
143^J^Ieval {...} called at
data/template/template/en/default/global/site-navigation.html.tmpl line
143^J^Ieval {...} called at
data/template/template/en/default/global/site-navigation.html.tmpl line
16^J^ITemplate::Provider::__ANON__(\'Template::Context=HASH(0x8537d14)\') called
at Template/Document.pm line 140^J^Ieval {...} called at Template/Document.pm
line 138^J^ITemplate::Document::process(\'Template::Document=HASH(0x86c761c)\',
\'Template::Context=HASH(0x8537d14)\') called at Template/Context.pm line
343^J^Ieval {...} called at Template/Context.pm line
320^J^ITemplate::Context::process(\'Template::Context=HASH(0x8537d14)\',
\'global/site-navigation.html.tmpl\') called at
data/template/template/en/default/global/header.html.tmpl line 57^J^Ieval {...}
called at data/template/template/en/default/global/header.html.tmpl line
16^J^ITemplate::Provider::__ANON__(\'Template::Context=HASH(0x8537d14)\') called
at Template/Document.pm line 140^J^Ieval {...} called at Template/Document.pm
line 138^J^ITemplate::Document::process(\'Template::Document=HASH(0x86b7608)\',
\'Template::Context=HASH(0x8537d14)\') called at Template/Context.pm line
343^J^Ieval {...} called at Template/Context.pm line
320^J^ITemplate::Context::process(\'Template::Context=HASH(0x8537d14)\',
\'global/header.html.tmpl\') called at
data/template/template/en/default/global/user-error.html.tmpl line 2097^J^Ieval
{...} called at data/template/template/en/default/global/user-error.html.tmpl
line 16^J^ITemplate::Provider::__ANON__(\'Template::Context=HASH(0x8537d14)\')
called at Template/Document.pm line 140^J^Ieval {...} called at
Template/Document.pm line
138^J^ITemplate::Document::process(\'Template::Document=HASH(0x8692c98)\',
\'Template::Context=HASH(0x8537d14)\') called at Template/Context.pm line
343^J^Ieval {...} called at Template/Context.pm line
320^J^ITemplate::Context::process(\'Template::Context=HASH(0x8537d14)\',
\'Template::Document=HASH(0x8692c98)\') called at Template/Service.pm line
97^J^Ieval {...} called at Template/Service.pm line
94^J^ITemplate::Service::process(\'Template::Service=HASH(0x8510e9c)\',
\'global/user-error.html.tmpl\', \'HASH(0x861d93c)\') called at Template.pm line
76^J^ITemplate::process(\'Bugzilla::Template=HASH(0x8311dd4)\',
\'global/user-error.html.tmpl\', \'HASH(0x861d93c)\') called at
Bugzilla/Error.pm line
44^J^IBugzilla::Error::_throw_error(\'global/user-error.html.tmpl\',
\'invalid_username\', \'HASH(0x861d93c)\') called at Bugzilla/Error.pm line
51^J^IBugzilla::Error::ThrowUserError(\'invalid_username\', \'HASH(0x861d93c)\')
called at globals.pl line 803^J^Imain::DBNameToIdAndCheck(\'mattyt@tpg.com.au\')
called at RelationSet.pm line
180^J^IRelationSet::mergeFromString(\'RelationSet=HASH(0x860a6d0)\',
\'documentation@bugzilla.org,endico@mozilla.org,gerv@mozilla.org,j...\') called
at RelationSet.pm line 55^J^IRelationSet::new(\'RelationSet\',
\'documentation@bugzilla.org,endico@mozilla.org,gerv@mozilla.org,j...\') called
at /opt/webtools/bugzilla/userprefs.cgi line 250^J^Imain::SaveEmail() called at
/opt/webtools/bugzilla/userprefs.cgi line 322^J') called at Bugzilla/Error.pm
line 44 Bugzilla::Error::_throw_error('global/user-error.html.tmpl',
'invalid_username', 'HASH(0x861d93c)') called at Bugzilla/Error.pm line 51
Bugzilla::Error::ThrowUserError('invalid_username', 'HASH(0x861d93c)') called at
globals.pl line 803 main::DBNameToIdAndCheck('mattyt@tpg.com.au') called at
RelationSet.pm line 180
RelationSet::mergeFromString('RelationSet=HASH(0x860a6d0)',
'documentation@bugzilla.org,endico@mozilla.org,gerv@mozilla.org,j...') called at
RelationSet.pm line 55 RelationSet::new('RelationSet',
'documentation@bugzilla.org,endico@mozilla.org,gerv@mozilla.org,j...') called at
/opt/webtools/bugzilla/userprefs.cgi line 250 main::SaveEmail() called at
/opt/webtools/bugzilla/userprefs.cgi line 322
Looking closer at that error, I see "invalid username" buried in there. So
something went wrong with the error reporting...
The error goes away if I "lock tables namedqueries read, groups read, 
user_group_map read" in User.pm, method "queries" before performing the actual 
select.

I don't really know what to do with this knowledge, though. Is it safe to put 
the command there? Do I have to remove the lock afterwards? Are there cases 
where the tables must not be locked?
*** Bug 243845 has been marked as a duplicate of this bug. ***
*** Bug 244047 has been marked as a duplicate of this bug. ***
Dave: I'd say your suspicion about the error reporting is right. I can 
reproduce an equivalent error by entering non-numerical values for Hours 
Worked. Initiator is ThrowUserError('need_numeric_value') in this case.
Locking the tables as I suggested in comment 2 may fix the error reporting but 
breaks other stuff, most noticeably show_bug.cgi.

:-(
This appears to have gotten fixed already on a newer bug...

*** This bug has been marked as a duplicate of 240036 ***
No longer blocks: bmo-regressions-old
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.