Installation

Missing Table Error for Admin Course

Missing Table Error for Admin Course

by Harshal Patel -
Number of replies: 13

Hello,

I am new to WeBWorK system and the installation. I am working on installing version 2.17 on RHEL8 and primarily following the guides below:

I managed to start the apache server and can see the homepage at http://myurl/webwork2, where myurl is the address where I have hosted the server. I followed the steps to create the admin course but I do not see "Course Administration" listed at the top.

When I go to http://myurl/webwork2/admin, it shows the error below:

WeBWorK error

An error occured while processing your request.

For help, please send mail to this site's webmaster (xxx@ufv.ca) [removed email for security purpose], including all of the following information as well as what what you were doing when the error occured.

Error record identifier

27250b6f-0b12-5e58-bbdc-612afc8963c1::c126d324-be1d-11ed-9242-bbb3cbb709fd

Warning messages

Error messages

[missing table]

Call stack

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

  • in Exception::Class::Base::throw called at line 872 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
  • in WeBWorK::DB::Schema::NewSQL::Std::handle_error called at line 469 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
  • in WeBWorK::DB::Schema::NewSQL::Std::_get_fields_where_prepex called at line 437 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
  • in WeBWorK::DB::Schema::NewSQL::Std::get_fields_where called at line 497 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
  • in WeBWorK::DB::Schema::NewSQL::Std::get_records_where called at line 327 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
  • in WeBWorK::DB::__ANON__ called at line 262 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Login.pm
  • in WeBWorK::ContentGenerator::Login::body called at line 154 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
  • in WeBWorK::Template::template called at line 599 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::content called at line 218 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 371 of /opt/webwork/webwork2/lib/WeBWorK.pm

I have been playing around with changing permissions, checking module dependencies, nothing has worked so far. As per 2.16 RHEL8 installation manual, I have installed mySQL (not mariaDB) so I changed the driver to mySQL in site.conf. I have created the webwork database and webworkWrite user and gave permissions as per the installation manual.

Any suggestions would be greatly appreciated.

Thank you.

Harshal

Tags:
In reply to Harshal Patel

Re: Missing Table Error for Admin Course

by Danny Glin -
Based on what you're describing it sounds like the creation of the admin course didn't complete successfully. When you ran the "addcourse" command were there any error messages?

Does the /opt/webwork/courses/admin directory exist on your server?

Regarding the database driver, I believe that it is case sensitive, so make sure it is set to "mysql" (though if this were the problem I would expect a different error message). Note that the mysql driver for perl is not being actively maintained and has some limitations, so even if your backend database is mysql you may wish to use the MariaDB driver. As far as I know mysql and MariaDB have not diverged to a point where the driver will not be compatible.
In reply to Danny Glin

Re: Missing Table Error for Admin Course

by Harshal Patel -

Hi Danny,

Thank you for replying. When I ran the command below for the first time, it worked:

/opt/webwork/webwork2/bin/addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admin
When I run it now, it says "admin: course exists at /opt/webwork/webwork2/bin/addcourse line 252."

Yes, the /opt/webwork/courses/admin directory exists. I can see DATA, html, logs, scoring, and templates directories inside the admin directory. Admin directory is owned by apache user, it was owned by wwadmin user before but no luck.

Yes, the driver is set to "mysql" and when I changed it to MariaDB, I received the error below so I reverted it back to mysql driver.

Error messages

install_driver(MariaDB) failed: Can't locate DBD/MariaDB.pm in @INC (you may need to install the DBD::MariaDB module) (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 /etc/httpd) at (eval 759) line 3. Perhaps the DBD::MariaDB perl module hasn't been fully installed, or perhaps the capitalisation of 'MariaDB' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Mem, Proxy, Sponge, mysql. at /opt/webwork/webwork2/lib/WeBWorK/Utils/CourseManagement.pm line 93.

Thinking of uninstalling mysql and try with MariaDB. Error says "Missing Table" so I feel it has something to do with database only.

Harshal

In reply to Harshal Patel

Re: Missing Table Error for Admin Course

by Danny Glin -

When you run the addcourse script it is supposed to do two things: create the course directory structure, and create the necessary database tables.  Since the courses directory (and the appropriate subdirectories) are present it means that addcourse got at least part of the way through.

In the webwork database, check to see if there are a bunch of tables that start with 'admin_':

MariaDB [webwork]> show tables like 'admin_%';

+-------------------------------+

| Tables_in_webwork (admin_%)   |

+-------------------------------+

| admin_achievement             |

| admin_achievement_user        |

| admin_global_user_achievement |

| admin_key                     |

| admin_password                |

| admin_past_answer             |

| admin_permission              |

| admin_problem                 |

| admin_problem_user            |

| admin_set                     |

| admin_set_locations           |

| admin_set_locations_user      |

| admin_set_user                |

| admin_setting                 |

| admin_user                    |

+-------------------------------+


If you don't see any of these tables, then the next thing I recommend is to delete the admin course directory (and all of its contents), and then try running the 'addcourse' script again.

I believe that the MariaDB driver for perl is not packaged in RHEL, so if you want to use it you should install it using cpanm.  This is likely not related to the issue you are currently experiencing, so for now the mysql driver will be good enough.

In reply to Danny Glin

Re: Missing Table Error for Admin Course

by Harshal Patel -
Hi Danny,

You're right! There were no tables. I deleted the admin directory and re-created it. I can see course administration and the admin course. I also changed the database host from localhost to our on-prem mySQL server. It's working.

Thank you so much for your assistance, this was a great help.

Now that webwork is running, when I try to check Latex packages using
/opt/webwork/webwork2/bin/check_latex
it gives the error below:
! LaTeX Error: File `amsart.cls' not found.

I tried a couple of steps found in support forums but they did not work. Would you know how can this be fixed?

Thanks again,
Harshal
In reply to Harshal Patel

Re: Missing Table Error for Admin Course

by Harshal Patel -
Hi Danny,

We can continue the converstation here regarding amsart.cls not found. When I run the whatprovides command, it shows this:

texlive-amscls-7:20180414-25.el8.noarch : AMS document classes for LaTeX
Repo : rhel-8-for-x86_64-appstream-rpms
Matched from:
Filename : /usr/share/texlive/texmf-dist/tex/latex/amscls/amsart.cls

How do I go about installing this?

Also, when I log in as admin to webwork and try to create a course, it does not create one and do not give an error either. It creates the associated user but not the course itself.

On the server, when I go to /opt/webwork/courses, I can see the courses. They're not visible on the Webwork website side. It seems like a permission issue. These courses are owned by apache. Admin course is owned by wwadmin (who is added to the apache group).

Thanks,
Harshal
In reply to Harshal Patel

Re: Missing Table Error for Admin Course

by Danny Glin -

It's bad form to pick up questions from another thread.  It makes it very hard for anyone else who experiences the same problem to find answers.

Reading the courses not showing up, do you mean that you don't see them on https://webwork.yourschool.edu/webwork2/?  It would be surprising if that was a permissions issue, since the apache user is the one that creates the course folder in /opt/webwork/courses, and is also the one that lists the contents of that folder in order to build the list of courses on the server.

If you go directly to https://webwork.yourschool.edu/webwork2/[coursename] (where [coursename] is the name of the course you created) what do you see?


In reply to Danny Glin

Re: Missing Table Error for Admin Course

by Harshal Patel -
Hi Danny,

I apologize. I have asked my question about amscls package in the original thread.

Regarding the courses issue, when I go to https://webwork.yourschool.edu/webwork2/[coursename], it shows me the login page and I can login as admin. So they're not visible on the main page but are being created.
In reply to Harshal Patel

Re: Missing Table Error for Admin Course

by Danny Glin -
Here are a couple of things to check:
  1. Make sure that there is not a file called "hide_directory" in the course directory.  This would cause the course to be deliberately hidden in the listing.
  2. Make sure that you have $database_host, $database_port and $database_name set in site.conf.  If you upgraded from a previous version of WeBWorK these may be missing, which has the potential to break the course listing.
In reply to Danny Glin

Re: Missing Table Error for Admin Course

by Harshal Patel -

Hi Danny,

Thank you for replying.

  1. I checked the course directory for all the courses in "/opt/webwork/courses" and there was no "hide_directory" file.
  2. Yes I have the details added in site.conf. $database_port value is kept as the default, 3306. We are using an on-prem database server at University so I have mentioned that in the $database_host and $database_name fields.
I will change the value of $database_host to localhost and create a webwork database locally to test if that makes a difference.

Harshal
In reply to Danny Glin

Re: Missing Table Error for Admin Course

by Harshal Patel -
Hi Danny,

I still cannot see the courses at the homepage. Any suggestions you can provide will be helpful?

Thank you!
Harshal
In reply to Harshal Patel

Re: Missing Table Error for Admin Course

by Peter Staab -

It seems like this thread has gotten away from the original question.  Can you submit a new post in the installation with you current issue?

In reply to Danny Glin

Re: Missing Table Error for Admin Course

by Harshal Patel -
Hi Danny,

Did you get a chance to look at my reply here and in the amscls package thread? I would appreciate if you can provide any input.

Thanks,
Harshal