WeBWorK Main Forum

Problems accessing courses after upgrade to 2.4.1

Problems accessing courses after upgrade to 2.4.1

by Robin Cruz -
Number of replies: 4

I updated my system (RHE4) and upgraded to WeBWorK 2.4.1 and PG 2.4.0.  I followed the installation instructions for 2.4, including the instructions for updating mysql.  I had to install a few modules from CPAN to get httpd working, but I can now get to my school's WeBWorK courses page. (Thanks Arnie and Mike for the help on that part.) 

However, I cannot access any courses including admin.  Here is the error message I get:

error instantiating DB driver WeBWorK::DB::Driver::SQL for table problem_user: DBI connect('webwork','',...) failed: Access denied for user ''@'localhost' to database 'webwork' at /opt/webwork/webwork2/lib/WeBWorK/DB/Driver/SQL.pm line 65
at /opt/webwork/webwork2/lib/WeBWorK.pm line 286

I am trying to build new courses for this Fall term so I don't really need to access the old ones, but I think I need the admin course. 

Thanks -- rac

In reply to Robin Cruz

Re: Problems accessing courses after upgrade to 2.4.1

by Michael Gage -
Hi Robin,

This error message indicates that the connection between WeBWorK and the mysql database is not being made properly. In particular WeBWorK is trying to access the database using an empty user name (usually we use webworkWrite for the user name, somewhat for historical reasons when there was both webworkWrite and webworkRead -- now just one name is needed. )

Here is the relevant section from our global.conf file:
 ################################################################################
# Database options
################################################################################

# these variables are used by database.conf. we define them here so that editing
# database.conf isn't necessary.
# permissions settings for mySQL:
# GRANT SELECT ON webwork.* TO webworkRead@localhost IDENTIFIED BY 'passwordRO';
# GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, LOCK TABLES ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'your-mysql-password-here';

$database_dsn = "dbi:mysql:webwork";
$database_username = "webworkWrite";
$database_password = "your-mysql-password-here";
$database_debug = 0;

# Variables for sql_moodle database layout.
$moodle_dsn = "dbi:mysql:moodle";
$moodle_username = $database_username;
$moodle_password = $database_password;
$moodle_table_prefix = "mdl_";
$moodle17 = 0;

See http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/InstallationManualV2pt4#Configuring_the_database

An unrelated remark: make sure that you have upgraded your database using wwdb_upgrade as described in the manual above.

--Mike
In reply to Robin Cruz

Re: Problems accessing courses after upgrade to 2.4.1

by Robin Cruz -

I went through all of the steps to upgrade the database in the 2.4 Installation manual.  Two questions:

1)  Do I use "localhost" or the name of my server in the sql command?  (I've granted the privileges both ways.) Do I put quotes around the password? (I did.)

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, LOCK TABLES
ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'password';

2)  When I used the command to update the database, it apparently went through all my existing courses and for each one it said the update failed because of an extra field in the database.

Since I could not get into the existing classes, I decided to see what happened if I made a new class.  I used the addcourse command and did not get an error message.  The test course showed up on the WeBWorK course page, but when I tried to access it I got a few more error messages for missing modules.  I installed them and now when I try to get into the new class I get the following error message.  By the way, I checked the webwork database in mysql and there were no tables created for the test course.

--rac

Error messages

Base class package "SQL::Abstract" is empty.
(Perhaps you need to 'use' the module which defines that package first.)
at /opt/webwork/webwork2/lib/WeBWorK/DB/Utils/SQLAbstractIdentTrans.pm line 18
BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/DB/Utils/SQLAbstractIdentTrans.pm line 18.
Compilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 31.
BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 31.
Compilation failed in require at (eval 100) line 3.
...propagated at /usr/local/lib/perl5/5.8.8/base.pm line 85.
BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/NonVersioned.pm line 18.
Compilation failed in require at (eval 99) line 1.

Call stack

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

  • in WeBWorK::Utils::runtime_use called at line 211 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
  • in WeBWorK::DB::init_table called at line 200 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
  • in WeBWorK::DB::init_table called at line 169 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
  • in WeBWorK::DB::new called at line 286 of /opt/webwork/webwork2/lib/WeBWorK.pm
In reply to Robin Cruz

Re: Problems accessing courses after upgrade to 2.4.1

by Gavin LaRose -
Hi Robin,

1) As long as mySQL is running on the same server as your apache/WeBWorK install, "localhost" should work fine. Depending on how your mySQL is configured, the server's name may or may not work (I have my mySQL daemons configured to only answer requests from localhost). I believe you will want to quote the password.

2) Have you installed the SQL::Abstract Perl module? The error you noted in the second message appears to me to suggest that it's missing.

Gavin
In reply to Gavin LaRose

Re: Problems accessing courses after upgrade to 2.4.1

by Robin Cruz -

Thanks, Gavin and Mike.

I had to install a few more modules in addition to the one Gavin mentioned and now the old courses are accessable again, and it seems to be OK at creating new ones.

When I upgraded to 2.4.1 I did not check through the required Perl modules list in the Installation manuel -- I assumed since I had done that for 2.3 last year the ones I had would still be OK.

Thanks again --rac