Installation

CVS upgrade problem

CVS upgrade problem

by Richard Bayne -
Number of replies: 6
Here we go again. Does anything have to be done to an existing database after a cvs upgrade? I used the following commands to upgrade
cvs -q update -dP -r rel-2-4-patches
cvs -q update -dP -r rel-2-4-patches

When trying to go to one of the courses used this past semester, I got the following error message on logging in:

WeBWorK error

An error occured while processing your request. For help, please send mail to this site's webmaster (root@localhost), including all of the following information as well as what what you were doing when the error occured.

Thu May 07 23:02:04 2009
Warning messages

Error messages

Can't locate object method "listSetVersions" via package "WeBWorK::DB" at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/ProblemSets.pm line 185.

Call stack

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

* in WeBWorK::ContentGenerator::ProblemSets::body called at line 152 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
* in WeBWorK::Template::template called at line 480 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
* in WeBWorK::ContentGenerator::content called at line 188 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
* in WeBWorK::ContentGenerator::go called at line 338 of /opt/webwork/webwork2/lib/WeBWorK.pm

Request information
Method POST
URI /webwork2/MATH-156bayne/
HTTP Headers
Keep-Alive 300
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
User-Agent Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20
Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Connection keep-alive
Referer http://butcher.math.howard.edu/webwork2/MATH-156bayne/
Content-Length 31
Accept-Encoding gzip,deflate
Content-Type application/x-www-form-urlencoded
Cookie __utma=140697899.519061767.1182582171.1240929829.1240983212.104; __utmz=140697899.1240983212.104.43.utmccn=(referral)|utmcsr=coas.howard.edu|utmcct=/mathematics/faculty.html|utmcmd=referral
Accept-Language en-us,en;q=0.5
Host butcher.math.howard.edu
---------
On logging into another course, I at least was able to get into the course and into a problem set, but on trying to access a particular problem, I got the following error message:

WeBWorK error

An error occured while processing your request. For help, please send mail to this site's webmaster (root@localhost), including all of the following information as well as what what you were doing when the error occured.

Thu May 07 23:43:18 2009

Warning messages

Error messages

"before" is not exported by the WeBWorK::Utils module
"after" is not exported by the WeBWorK::Utils module
"between" is not exported by the WeBWorK::Utils module
Can't continue after import errors at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 36
BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 37.
Compilation failed in require at (eval 1792) line 1.

Call stack

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

  • in WeBWorK::Utils::runtime_use called at line 329 of /opt/webwork/webwork2/lib/WeBWorK.pm

Request information

Method GET
URI /webwork2/MATH-012bayne/01Sequences/2/
HTTP Headers
Keep-Alive 300
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
User-Agent Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20
Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Connection keep-alive
Referer http://butcher.math.howard.edu/webwork2/MATH-012bayne/01Sequences/?effectiveUser=bayne&displayMode=jsMath&user=bayne&key=88mnjrqQU8l5euWwWwztsSxwIGOWeTOB
Accept-Encoding gzip,deflate
Cookie __utma=140697899.519061767.1182582171.1240929829.1240983212.104; __utmz=140697899.1240983212.104.43.utmccn=(referral)|utmcsr=coas.howard.edu|utmcct=/mathematics/faculty.html|utmcmd=referral; jsMath=font%3Asymbol%2Cwarn%3A0
Accept-Language en-us,en;q=0.5
Host butcher.math.howard.edu

Any advice or suggestion will be appreciated. Thank you.

Bayne
In reply to Richard Bayne

Re: CVS upgrade problem

by Gavin LaRose -
Hi Richard,

Both of these errors suggest to me a mismatch between different parts of the WeBWorK code.
The error 'Can't locate object method "listSetVersions"...', in particular, suggests that there's some mismatch between the version of the Database module that you're seeing and that which is expected. I'd try restarting the apache process, and double check the format of your database.conf file to be sure that you're not using an out of date version.

If that doesn't work, a quick double check that there isn't something grieviously amiss might be to see that the listSetVersions routine is where it should be; on the WeBWorK server,
# grep "listSetVersions" /opt/www/webwork2/lib/WeBWorK/DB.pm
(correct the path as need be) should return about four lines, including the line
sub listSetVersions {

Gavin
In reply to Gavin LaRose

Re: CVS upgrade problem

by Richard Bayne -
Gavin,
Thanks for the response.
1. After restarting apache, I can now no longer log in to any course, but instead get the error message indicated below, which tells me to look in the error log for more information, but the error message there is relatively incomprehensible to me, but does include the phrase
Can't locate Exception/Class.pm in @INC

2. When I look for the listSetVersions using the grep command indicated, I get "no such file" since I do not have a directory /opt/www/, but instead have the indicated file at
/opt/webwork/webwork2/lib/WeBWorK/DB.pm, where the grep command does return about 4 lines, one of which is
sub listSetVersions{

Richard

The error message returned when trying to log in to a course is:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

In reply to Richard Bayne

Re: CVS upgrade problem

by Gavin LaRose -
Hi Richard,

If you look for the Perl module Exception::Class.pm do you find it? For example, by running
perl -e 'use Exception::Class;"
? I notice that I have it installed on our servers; I'm wondering if it got added to the required Perl modules between your last upgrade and this one.

The output from the grep sounds right, which is good.

Gavin
In reply to Richard Bayne

Re: CVS upgrade problem

by Richard Bayne -
Gavin,
I guess my problem is that I do not know from what entity the server is getting the login name "apache". As I said, I replaced the$database_username and $database_password in the config file and got no change in my error message. It seems to me that the server sees someone trying to access it from the web as "apache".
How is it doing this?
Richard
again, the error message when trying to access any course is:

error instantiating DB driver WeBWorK::DB::Driver::SQL for table problem_user: DBI connect('webwork','',...) failed:
Access denied for user 'apache'@'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
In reply to Richard Bayne

Re: CVS upgrade problem

by Gavin LaRose -
Hi Richard,

I think that when WeBWorK doesn't get a username/password correctly from the configuration files, it just tries the user under which the httpd process is running, which will be apache. So the fact that it's trying that makes me think that it's not getting the correct value.

Check in the database.conf file that you have the entries "username" and "password" in the %sqlParams hash. If both of those are correctly defined, try adding the keys "usernameRW" and "passwordRW" (with the values $database_username and $database_password). (You might want to try also adding "usernameRO" and "passwordRO".) I don't think these should be used anywhere in the database module at this point, but if not it won't hurt to try them.

Gavin
In reply to Gavin LaRose

Re: CVS upgrade problem

by Danny Glin -
Just a general comment here. When upgrading to a new version of webwork it's worth checking to see what has changed in global.conf, as new things seem to be added or changed with every new version.
I think the easiest way to do this is to run the command
cvs diff -r rel-2-4-patches global.conf.dist
in your webwork conf directory before you upgrade. This will tell you what has changed in the configuration file between the version you are running and the current version. You can then manually update your global.conf to add or change anything that is different. The other alternative is to start with a fresh copy of global.conf taken from the most recent version of global.conf.dist, (i.e. copy global.conf.dist to global.conf after you upgrade) and then customize it for your needs whenever you upgrade.
In fact, it would be really nice if there were a tool similar to wwdb_upgrade which would update global.conf to make sure it is compatible with the current version of webwork (i.e. something which tracks which settings in global.conf were changed/added in each version of Webwork), since it is tedious to have to fix the configuration file each time you upgrade.
Gavin is correct that Webwork is not getting the correct value for the username and password. You can see this in the error message. The syntax is DBI::Connect($database,$username,$password) . Since the second argument in your error message is '', it means that Webwork is sending a blank username, so it defaults to the username running the process, which is usually apache. You can also tell that it is not sending a password since it says "using password: NO". Adding the %sqlParams hash as Gavin suggests should fix this.