Installation

Problems with WEBWORK after upgr to 2.4

Problems with WEBWORK after upgr to 2.4

by Jason Appah -
Number of replies: 8
alright, I started the upgrade from 2.3 to 2.4 with patches....

I ran wwdb_upgrade, and followed the upgrade instructions.

now I get the opening page but when I click on any of the courses I get this:

Error messages

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

Call stack

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

  • in Carp::croak called at line 258 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
  • in WeBWorK::DB::init_table called at line 219 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
  • in WeBWorK::DB::new called at line 286 of /opt/webwork/webwork2/lib/WeBWorK.pm

Request information

Method GET
URI /webwork2/admin/
HTTP Headers
Keep-Alive 300
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection keep-alive
Referer http://tangent.oit.edu/webwork2
Accept-Encoding gzip,deflate
Accept-Language en-us,en;q=0.5
Host tangent.oit.edu


also when I run check modules I get this:


Checking your $PATH for executables required by WeBWorK...
$PATH= /usr/local/bin
/usr/bin
/bin
/usr/games
/opt/webwork/webwork2/bin

mkdir found at /bin/mkdir
mv found at /bin/mv
mysql found at /usr/bin/mysql
tar found at /bin/tar
gzip found at /bin/gzip
latex found at /usr/bin/latex
pdflatex found at /usr/bin/pdflatex
dvipng found at /usr/bin/dvipng
** tth not found in $PATH
giftopnm found at /usr/bin/giftopnm
ppmtopgm found at /usr/bin/ppmtopgm
pnmtops found at /usr/bin/pnmtops
pnmtopng found at /usr/bin/pnmtopng
pngtopnm found at /usr/bin/pngtopnm

Checking your @INC for modules required by WeBWorK...
@INC= /etc/perl
/usr/local/lib/perl/5.8.8
/usr/local/share/perl/5.8.8
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
.

Benchmark found and loaded
Carp found and loaded
CGI found and loaded
Data::Dumper found and loaded
Data::UUID found and loaded
Date::Format found and loaded
Date::Parse found and loaded
DateTime found and loaded
DBD::mysql found and loaded
DBI found and loaded
Digest::MD5 found and loaded
Email::Address found and loaded
Errno found and loaded
Exception::Class found and loaded
File::Copy found and loaded
File::Find found and loaded
File::Path found and loaded
File::Spec found and loaded
File::stat found and loaded
File::Temp found and loaded
GD found and loaded
Getopt::Long found and loaded
Getopt::Std found and loaded
HTML::Entities found and loaded
HTML::Tagset found and loaded
IO::File found and loaded
Iterator found and loaded
Iterator::Util found and loaded
Mail::Sender found and loaded
MIME::Base64 found and loaded
Net::IP found and loaded
Net::LDAPS found and loaded
Net::SMTP found and loaded
Opcode found and loaded
PHP::Serialization found and loaded
Pod::Usage found and loaded
Safe found and loaded
** SOAP::Lite found, but failed to load: Weak references are not implemented in the version of perl at /usr/local/share/perl/5.8.8/SOAP/Lite.pm line 2447
BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/SOAP/Lite.pm line 2447.
Compilation failed in require at (eval 68) line 2.
BEGIN failed--compilation aborted at (eval 68) line 2.
Socket found and loaded
SQL::Abstract found and loaded
String::ShellQuote found and loaded
Text::Wrap found and loaded
Time::HiRes found and loaded
Time::Zone found and loaded
URI::Escape found and loaded
XML::Parser found and loaded
XML::Parser::EasyTree found and loaded
XML::Writer found and loaded
XMLRPC::Lite found and loaded
Apache2::Request found and loaded
Apache2::Cookie found and loaded
Apache2::ServerRec found and loaded
Apache2::ServerUtil found and loaded


I tried getting SOAP::Lite from CPAN but it wont install without the force command. I cant help but think that my DB access problems are because of the SOAP module not being loaded.

any help here would be hot!

thanks!

In reply to Jason Appah

Re: Problems with WEBWORK after upgr to 2.4

by Michael Gage -
Hi,

The missing tth and Soap::Lite modules aren't causing the difficulty
with connecting to the database. (tth is not much used any more -- it's only required if you want to use the "formatted" text mode for displaying images).

SOAP::lite is used mainly if you are using the webservice aspects of webwork.
I'm not sure what the problem is there, but there is a www.soaplite.com site which may have information.

Your error message indicates that webwork is having trouble connecting to the mysql database -- here are
some ideas for troubleshooting -- many of them can be
checked by using mysql to access the database directly from the command line (see "man mysql" and see www.mysql.org for many details on how the mysql database works).

1. Is the mysql database daemon running?
2. Is the database password listed in global.conf the same as the password
for the webwork database? (Try to login directly using the mysql command)
3. Is the webworkWrite name (also in global.conf) the one needed to connect
to the webwork database?

Those are the three most likely causes of the failure of webwork to connect to the mysql database.

Hope this helps.

-- Mike
In reply to Michael Gage

Re: Problems with WEBWORK after upgr to 2.4

by Jason Appah -
Mike,

thanks for your response, I have logged into the database using the mysql command with the webworkWrite username and password listed in global.conf

mysqld shows as running in top as well as mysqld_safe.

this was an upgrade so I assumed that just doing a cvs upgrade wouldnt change the rest of the permissions for debian an/or mysql....

I'm not sure I understand question number three, do I need to re-assert webworkWrite as a database user for the Webwork database?
In reply to Jason Appah

Re: Problems with WEBWORK after upgr to 2.4

by Michael Gage -
being able to connect from the command line using webworkWrite and it's password in global.conf is a good start. It means the password is correct and the database is running. You shouldn't have to reassert webworkWrite as the database user.

On the other hand your error message above shows that webwork is trying to
connect as www-data. Is that what you set your $database_username to in global.conf? Can you connect from the commandline as www-data?

None of the config files are changed by the update but changes are made in

webwork.apache-config.dist, global.conf.dist and database.conf.dist

You will need to transfer any updates to these files manually to
webwork.apache-config, global.conf and database.conf respectively. It's possible that you missed one of these changes or made one change too many and overrode a local difference in name or address.

Searching this forum with the word "instantiating" will bring up several more posts with this error message. While it always indicates a failure to connect to the database, the reason for the failure can vary widely. Hopefully the previous experiences will give you some ideas for trouble shooting. Let us know what the problem was once you find it.

-- Mike


In reply to Michael Gage

Re: Problems with WEBWORK after upgr to 2.4

by Jason Appah -
################################################################################
# Database options
################################################################################

# these variables are used by database.conf. we define them here so that editing
# database.conf isn't necessary.
$database_dsn = "dbi:mysql:webwork";
$database_username = "webworkWrite";
$database_password = "***";
$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;

# Several database are defined in the file conf/database.conf and stored in the
# hash %dbLayouts.
include "conf/database.conf";

# Select the default database layout. This can be overridden in the course.conf
# file of a particular course. The only database layout supported in WW 2.1.4
# and up is "sql_single".
$dbLayoutName = "sql_single";

# This sets the symbol "dbLayout" as an alias for the selected database layout.
*dbLayout = $dbLayouts{$dbLayoutName};

In reply to Jason Appah

Re: Problems with WEBWORK after upgr to 2.4

by Michael Gage -
This part of global.conf looks normal to me. Are you still getting the error that www-data@localhost is trying to connect to mysql? As usual make sure that you restart the apache server (and perhaps the mysql server?) to make sure that the configuration files are being read. One needs to find where the database_username is being changed to "www-data".
In reply to Michael Gage

Re: Problems with WEBWORK after upgr to 2.4

by Jason Appah -
agreed but I think that its less of an assignment problem and more of a loss of the proper credentials its almost like it doesnt have any credentials so its just using www-data.

do you have any hints on where that change might occur?

I have rebooted, and restarted msql, apache2 and so forth to no avail
In reply to Jason Appah

Re: Problems with WEBWORK after upgr to 2.4

by Davide Cervone -
Try looking in webwork2/conf/database.conf to make sure that the %sqlParams has is properly set. In particular, check that it is using the values of $database_username and $database_password rather than some other hard-coded values.

The layout of that hash has changed significantly from version 2.3 to 2.4, and so if you haven't copied database.conf.dist to database.conf, you probably will have problems. The only things in database.conf that will need editing would be the mysql and mysqldump values; everything else is set in global.conf now.

If you haven't updated database.conf, then the fields used by the database layer of WeBWorK would probably get blank fields for the user and password, and that might account for the use of www-dataas the user (provided that is the userID under which the apache server is running).

Davide
In reply to Jason Appah

Re: Problems with WEBWORK after upgr to 2.4

by Michael Gage -
ok. The one other piece of standard advice (in addition to restarting
the server often while troubleshooting) is to keep an eye on the
apache server error log --it sometimes contains useful error messages which are not printed to the screen.

I think you need to go into the file at:

/opt/webwork/webwork2/lib/WeBWorK/DB/Driver/SQL.pm

and try to check the the database user name is well defined.
(The line where the call is made to the database is in the
error message above.)

If you enter something like

warn "the database user name is ",$params->{username};

this message will be printed to the error log.

If the username is wrong here, we'll need to chase the error
upstream:

One thing to double check is the contents of database.conf
in particular the section defining "problem_user"

--Mike