#1816 modd doesn't grant - can't lock templates

Other
closed-rejected
nobody
5
2002-04-24
2002-04-22
Chris Hostetter
No

on Apr 4th, i installed slash using the HEAD of cvs
(the most recent release had some discussion search
bugs that i could see had allready been fixed in cvs)

after adjusting a lot of variables in order to make it
very easy for people to earn mod points, people still
weren't getting any, so i took a look at the moderatord
log and found this...

Mon Apr 22 20:18:01 2002 Starting moderatord with pid
31049
Mon Apr 22 20:18:01 2002 --------------- BEGIN
MODERATORD EXECUTION ---------------
Mon Apr 22 20:18:01 2002 NC: 2
Mon Apr 22 20:18:01 2002 2 comments becomes 20 tokens.
So the total token pool=20t
First 29 accounts available.
Eligible: 5 / Start at 0 end at 4 / First score is 1.
Incremented token-count on 2 users.
DBD::mysql::db selectall_arrayref failed: Table
'templates' was not locked with LOCK TABLES at
/usr/local/lib/perl/5.6.1/Slash/DB/Utility.pm line 406.
Error in
library:Slash::DB::MySQL:/usr/local/lib/perl/5.6.1/Slash/DB/MySQL.pm:4588:SELECT
tpid,name,page,section FROM templates
Which was called
by:Slash::DB::MySQL:/usr/local/lib/perl/5.6.1/Slash/DB/MySQL.pm:4625:SELECT
tpid,name,page,section FROM templates
Error in
library:Slash::Display:/usr/local/lib/perl/5.6.1/Slash/Display.pm:204:Failed
template lookup on 'data;misc[misc];default[default]',
callers: Slash line 1071, Slash::DB::Static::MySQL line
586, main line 130
Which was called
by:Slash:/usr/local/lib/perl/5.6.1/Slash.pm:1071:Failed
template lookup on 'data;misc[misc];default[default]',
callers: Slash line 1071, Slash::DB::Static::MySQL line
586, main line 130
DBD::mysql::db selectall_arrayref failed: Table
'templates' was not locked with LOCK TABLES at
/usr/local/lib/perl/5.6.1/Slash/DB/Utility.pm line 406.
Error in
library:Slash::DB::MySQL:/usr/local/lib/perl/5.6.1/Slash/DB/MySQL.pm:4588:SELECT
tpid,name,page,section FROM templates
Which was called
by:Slash::DB::MySQL:/usr/local/lib/perl/5.6.1/Slash/DB/MySQL.pm:4625:SELECT
tpid,name,page,section FROM templates
Error in
library:Slash::Display::Provider:/usr/local/lib/perl/5.6.1/Slash/Display/Provider.pm:81:Failed
template lookup on 'data;misc[misc];default[default]',
callers: Slash::Display line 229, Slash line 1071,
Slash::DB::Static::MySQL line 586
Which was called
by:Template::Context:/usr/local/lib/perl/5.6.1/Template/Context.pm:129:Failed
template lookup on 'data;misc[misc];default[default]',
callers: Slash::Display line 229, Slash line 1071,
Slash::DB::Static::MySQL line 586
DBD::mysql::st execute failed: Table 'templates' was
not locked with LOCK TABLES at
/usr/local/lib/perl/5.6.1/Slash/DB/Utility.pm line 349.
Error in
library:Slash::DB::MySQL:/usr/local/lib/perl/5.6.1/Slash/DB/MySQL.pm:5222:SELECT
template FROM templates WHERE tpid=NULL
Which was called
by:Slash::DB::MySQL:/usr/local/lib/perl/5.6.1/Slash/DB/MySQL.pm:5113:SELECT
template FROM templates WHERE tpid=NULL
Mon Apr 22 20:18:01 2002
Mon Apr 22 20:18:01 2002 ---------------- END
MODERATORD EXECUTION ----------------
Mon Apr 22 20:18:01 2002 Exiting moderatord (exit) with
pid 31049

I did a little digging and found this in the method
tokens2points of Slash::DB::Static::MySQL...

# For some reason, the underlying calls to setUser
will not work
# without the extra locks on users_acl or users_param.
$self->sqlTransactionStart('LOCK TABLES
users READ,
users_acl READ,
users_info WRITE,
users_comments WRITE,
users_param READ,
users_prefs WRITE'
);

Now i don't understand the details, but that implies
that all tables must be locked prior to being used.
The problem seems to be a few lines lower in
tokens2points...

push @log, Slash::getData(
($rtbl) ? 'moderatord_tokennotgrantmsg' :
'moderatord_tokengrantmsg',
{ uid => $uid }
);

... getData calls slashDisplay, which calls
getTemplateByName, ...etc.. untill finnally the
something tries to read from the templates table.

I don't really understand all of what's happening there
-- but i'm guessing the templates table needs locked as
well.

(i did a quick check of the HEAD as of today, and I
didn't notice any changes since Apr 4th that would fix
this -- but like i said, i'm not even sure i understand
the cause of the problem)

Discussion

  • Chris Nandor
    Chris Nandor
    2002-04-22

    Logged In: YES
    user_id=3660

    You cannot use HEAD of CVS to just install over the previous
    release (2.2.x). There are many schema changes.

     
  • Logged In: YES
    user_id=256068

    sorry, to clarify: i didn't install over a previous version
    of slash (i tried that, and discovered how painfully
    impossible that was) I started from scratch, with no slash
    database, or code -- i followed the standard Install doc,
    but i did it from a src directory created useing cvs
    checkout instead of a tar.gz release.

     
  • Logged In: YES
    user_id=256068

    FYI, i tried adding a READ lock to the templates table and
    that seems to have fixed hte problem 9still not sure why
    it's even using the templates table)

    slash:/usr/local/lib/perl/5.6.1/Slash/DB/Static# grep "\$Id"
    MySQL.pm.orig
    # $Id: MySQL.pm,v 1.25 2002/03/12 20:23:44 pudge Exp $
    slash:/usr/local/lib/perl/5.6.1/Slash/DB/Static# diff
    MySQL.pm.orig MySQL.pm
    573a574
    > templates READ,

     
    • summary: modd doesn't grant - can't lock template --> modd doesn't grant - can't lock templates
     
  • Rob Malda
    Rob Malda
    2002-04-24

    • status: open --> closed-rejected