Getting [missing table] after install

Getting [missing table] after install

by Ben Rush -
Number of replies: 5
Greetings - 

I have installed Webwork twice now. Once it went flawlessly (I created a virtual specifically for Webwork); the second time I tried to install it on a pre-existing Ubuntu 14.04 box of mine ... but it failed this time. 

Whenever I go to the main page, click "Course Administration", I'm then shown the following error: 

Error messages

[missing table]

Call stack

The information below can help locate the source of the problem.

  • in Exception::Class::Base::throw called at line 818 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/
  • in WeBWorK::DB::Schema::NewSQL::Std::handle_error called at line 413 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/
  • in WeBWorK::DB::Schema::NewSQL::Std::_get_fields_where_prepex called at line 381 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/
  • in WeBWorK::DB::Schema::NewSQL::Std::get_fields_where called at line 481 of /opt/webwork/webwork2/lib/WeBWorK/
  • in WeBWorK::DB::listUsers called at line 252 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/
  • in WeBWorK::ContentGenerator::Login::body called at line 155 of /opt/webwork/webwork2/lib/WeBWorK/
  • in WeBWorK::Template::template called at line 532 of /opt/webwork/webwork2/lib/WeBWorK/
  • in WeBWorK::ContentGenerator::content called at line 202 of /opt/webwork/webwork2/lib/WeBWorK/
  • in WeBWorK::ContentGenerator::go called at line 380 of /opt/webwork/webwork2/lib/

I am assuming this is the result of some failed MySQL setup, but I am not sure. I have created the database, the user, and setup the permisions the same as I did on the virtual (which works, if you recall). The only difference was that on my second Ubuntu box the wwadmin user account was added as a user (but given admin privs), not as the root account on the machine (even though it appears webworkAdmin is the user who does the writing). 

I'm an experienced developer, but unfortunately my Perl knowledge is pretty limited (so I'm not sure how to debug this). The MySQL logs and Apache logs haven't revealed too much (perhaps I'm looking in the wrong place. 

Any thoughts? Thanks in advance for your help. 

P.S. it's worth noting there are no tables in the database for webwork at this point. 
In reply to Ben Rush

Re: Getting [missing table] after install

by Michael Gage -
Perhaps you did not create the admin "course" from the commandline?  You need to get the admin_* tables into the webwork database before you can properly create new courses from the web. 

A configuration error in connecting to the database could throw errors like this as well.  The errors aren't all that informative --- roughly I'd say what is going on is that when you enter (or perhaps submit) the login page WW is trying to get the list of Users and fails because it can't find the admin_user database table.

Hope this helps.

Take care,


In reply to Michael Gage

Re: Getting [missing table] after install

by Ben Rush -
Hello Mike, thanks for your response. 

Yes, I have created the admin course. I just did the following from the command line again (for the sake of completeness): 

root@brush:~# newgrp wwdata
root@brush:~# umask 2
root@brush:~# cd /opt/webwork/courses
root@brush:/opt/webwork/courses# /opt/webwork/webwork2/bin/addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admi                                                   n
addcourse:  WeBWorK root directory set to /opt/webwork/webwork2
addcourse:  WeBWorK server is starting
addcourse:  WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config
addcourse:  The following locations and urls are set in webwork2/conf/site.conf
addcourse:  PG root directory set to /opt/webwork/pg
addcourse:  WeBWorK server userID is www-data
addcourse:  WeBWorK server groupID is wwdata
addcourse:  The webwork url on this site is
admin: course exists at /opt/webwork/webwork2/bin/addcourse line 293.

...this is probably the 3rd or 4th time I've tried it over the past couple days all to no avail. It's worth noting after I do this there's still NO tables in the database. 

Is there any place I can hook into in the code to see what's going on? Is the output of the command I ran not correct and I missed an error? 

Any help would be appreciated. Thanks again. 
In reply to Ben Rush

Re: Getting [missing table] after install

by Michael Gage -

I’ll bet you have an inconsistent state — the script is finding the admin directory  courses/admin

and then assuming the course is already constructed.  So it doesn’t build the database.

(also in what you typed professors=admi should probably be professors=admin )

The heavy lifting is done in /opt/webwork/github_mg2/webwork2/lib/WeBWorK/Utils/

in the subroutine addCourse()  

Your error message is coming from line 184 of that file.

( -e $courseDir is perlish for does this file exist?)

You can use  

warn  “message of some kind”;

to get error output.  — The error will appear in the apache error log, and sometimes in the HTML output

depending on where you are.

Hope this helps.

Take care,


In reply to Michael Gage

Re: Getting [missing table] after install

by Danny Glin -
If there's nothing of value in the (half-created) admin course, it might be more efficient to just delete the admin course directory (/opt/webwork/courses/admin by default) and then run addcourse again and see if it succeeds.

In reply to Danny Glin

Re: Getting [missing table] after install

by Ben Rush -
Thanks! That did it. Strange how this happened. 

That saved me from having to claw my way through a bunch of Perl script. 

Cheers all.