Installation

Webwork errors

Webwork errors

by Kim Boone -
Number of replies: 23
Yesterday morning I applied ubuntu updates and it appears this has broken webwork on our system. I have very limited knowledge of ubuntu/linux. I did build the system that we have but that was 2 1/2 years ago and it's been running great the whole time with a few minor issues.

Here are the errors we are seeing:

* Error in Translator.pm::process_answers: Answer AnSwEr3: |2.81|
* Can't locate object method "get" via package "APR::Table" at [WW]/lib/Apache/WeBWorK.pm line 74
Died within AnswerEvaluator::evaluate called at line 1 of (eval 1321)
* Error in Translator.pm::process_answers: Answer AnSwEr3:
* Answer evaluators must return a hash or an AnswerHash type, not type || at /opt/webwork/pg/lib/WeBWorK/PG/Translator.pm line 1175
* Use of uninitialized value in numeric ge (>=) at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 249.
* Use of uninitialized value in pattern match (m//) at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 250.
* Use of uninitialized value in numeric ge (>=) at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 250.
* Use of uninitialized value in numeric ge (>=) at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 251.
* Use of uninitialized value in numeric gt (>) at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 251.
* Use of uninitialized value in numeric gt (>) at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 254.

I really don't know how to troubleshoot this or fix this problem. I do think it was caused by an update to apache.

Our system:
Ubuntu 8.04
Apache 2.2

Any help anyone could provide to help us get our system back on line would me very much appreciated.

Thanks,
Kim Boone
Linn Benton Community College
Albany, OR

In reply to Kim Boone

Re: Webwork errors

by Sarunas Burdulis -
We are seeing the same since Apache was restarted after mod-php5 update. Perl was updated on May 4 (http://www.ubuntu.com/usn/usn-1129-1/), but that didn't affect WW until Apache reload.

Can't locate object method "get" via package "APR::Table" at [WW]/lib/Apache/WeBWorK.pm line 74

I can only add that error occurs only for students, or professor/admin acting as a student. It does not occur when viewing the problem with professor privileges.

Ubuntu 10.04.2
Apache 2.2.14
Perl 5.10.1
libapache2-mod-perl2 2.0.4

Sarunas Burdulis
Dartmouth College
Hanover, NH

In reply to Sarunas Burdulis

Re: Webwork errors

by Sarunas Burdulis -
Not a good solution, but reverting Ubuntu Perl updates of May 4, "fixes" the error.

/var/log/history.log for 10.04.2 LTS:
Start-Date: 2011-05-04 08:06:11
Upgrade: perl (5.10.1-8ubuntu2, 5.10.1-8ubuntu2.1), perl-base (5.10.1-8ubuntu2, 5.10.1-8ubuntu2.1), perl-modules (5.10.1-8ubuntu2, 5.10.1-8ubuntu2.1), libperl5.10 (5.10.1-8ubuntu2, 5.10.1-8ubuntu2.1)
End-Date: 2011-05-04 08:06:16

Revert updates:
apt-get --reinstall install perl=5.10.1-8ubuntu2 perl-base=5.10.1-8ubuntu2 perl-modules=5.10.1-8ubuntu2 libperl5.10=5.10.1-8ubuntu2

In reply to Sarunas Burdulis

Re: Webwork errors

by Kim Boone -
We are running ubuntu 8.04. Can I use the command to revert updates that you posted? I'm guessing not but thought I would ask. Sorry not being too good with ubuntu.

Another question is: I have already built a new server using the live dvd and all is running well. What would I need to do to get the database and problem files from the old server onto the new server?

Thanks,
kim

In reply to Kim Boone

Re: Webwork errors

by Sarunas Burdulis -
<We are running ubuntu 8.04. Can I use the command to revert updates that you posted? I'm guessing not but thought I would ask.>

Your package version numbers may differ. You can find what was updated, old and new version numbers in /var/log/apt/history.log(s).

In reply to Sarunas Burdulis

Re: Webwork errors

by Kim Boone -
I can't seem to find the history log in either /var/log/history.log or /var/log/apt/history.log.

I was able to find the version info in another file but I run the apt-get command I get an error

E: Version '5.8.8-12ubuntu0.4' for 'perl' was not found

I'm completely lost with figuring out how to undo this update that broke everything.

I have built a new server which would work fine if I could get our database imported into to but I'm not having much luck with that either.

Thanks for your help,
Kim Boone

In reply to Kim Boone

Re: Webwork errors

by Sarunas Burdulis -
One way to find out other available version numbers for a given package is by, for example:

apt-cache policy perl



In reply to Kim Boone

Re: Webwork errors

by Michael Gage -
Hi Kim,

Were you able to use mysqldump to dump your database? I can probably help with that. I'm a little less sure what I help with about backing out of the ubuntu update.

I'll be on the irc chat tonight if you want real time help.

see http://webwork.maa.org/wiki/IRC for info.
Use
http://webchat.freenode.net/?channels=#webwork
if you don't want to set up your own client.

Jason Aubrey and I have tried to hang out on the channel as much as we can to build critical mass. For those with an IRC client the node is

irc.freenode.net and the chat room is #webwork

-- MIke

In reply to Kim Boone

Re: Webwork errors

by Malcolm Harper -
For the record in case anyone else runs into this error. We are running WeBWorK on Ubuntu 8.04, Apache 2.2 and had the same error that Kim reports starting last night. Through the help of this thread, I traced the problem to a Perl update loaded May 9, but only activated with an Apache restart for log rotation last night at 9:30.

I tried to revert the Perl update as suggested by Sarunas but got the same
E: Version '5.8.8-12ubuntu0.4' for 'perl' was not found
error from apt-get. I was unable to find 5.8.8-12ubuntu0.4 for perl in the usual repositories and don't know enough to search for unusual repositories.

The solution I found eventually was to revert the packages using dpkg and the .deb files from the apt-get archive. Specifically I ran:
  • sudo dpkg -i /var/cache/apt/archives/perl-modules_5.8.8-12ubuntu0.4_all.deb
  • sudo dpkg -i /var/cache/apt/archives/perl_5.8.8-12ubuntu0.4_amd64.deb
  • sudo dpkg -i /var/cache/apt/archives/perl-base_5.8.8-12ubuntu0.4_amd64.deb
  • sudo dpkg -i /var/cache/apt/archives/libperl5.8_5.8.8-12ubuntu0.4_amd64.deb
  • sudo dpkg -i /var/cache/apt/archives/perl_5.8.8-12ubuntu0.4_amd64.deb
  • sudo dpkg -i /var/cache/apt/archives/perl-doc_5.8.8-12ubuntu0.4_all.deb
I found the names of the packages needed for the revert from /var/log/apt/term.log and I also used the installation order I found there. I reverted perl twice since the first time dpkg reported that it couldn't configure perl properly since there was an incorrect version of perl-base installed.

This is not an ideal fix, but should work for us for now. I was planning to do a fresh install of WeBWorK on a fresh server soon anyway.

Malcolm Harper
Champlain College
Saint-Lambert, QC
In reply to Kim Boone

Re: Webwork errors

by Michael Gage -
You can transfer data from your old server to the new one using tar and mysqldump facilities. Here is a short thread giving an overview of the procedure:

http://webwork.maa.org/moodle/mod/forum/discuss.php?d=577


The mysql and mysqldump references (in addition to the man pages on your unix installation) are at

http://dev.mysql.com/doc/refman/5.5/en/

Hope this helps.

In reply to Sarunas Burdulis

Re: Webwork errors

by Arnold Pizer -
Hi,

I'm not sure if this is useful information, but Googling 5.10.1-8ubuntu2.1 leads one to https://launchpad.net/ubuntu/+source/perl/5.10.1-8ubuntu2.1

Which gives:

Changelog
perl (5.10.1-8ubuntu2.1) lucid-security; urgency=low

* SECURITY UPDATE: multiple intended restriction bypasses in Safe.pm
- debian/patches/debian/CVE-2010-1168.diff: update Safe.pm to version
2.29 to fix multiple issues.
- CVE-2010-1168
- CVE-2010-1447
* SECURITY UPDATE: multiple issues in CGI.pm: hardcoded MIME boundary,
and CRLF injections.
- debian/patches/fixes/cgi-multiline-header.diff: fix issues with
patch obtained from (5.10.1-17).
- CVE-2010-2716
- CVE-2010-4410
- CVE-2010-4411
* SECURITY UPDATE: taint protection bypass via missing taint attributes
- debian/patches/fixes/CVE-2011-1487.diff: put taint logic at the end
of pp_* functions.
- CVE-2011-1487
-- Marc Deslauriers Thu, 21 Apr 2011 13:22:49 -0400
In reply to Kim Boone

Re: Webwork errors

by Arnold Pizer -
Hi Kim,

One possibility is you are having problems with Safe.pm. That's pretty much the only problem I recall people recently having when doing OS upgrades. See e.g http://webwork.maa.org/moodle/mod/forum/discuss.php?d=2292 and also do a search for Safe (or Safe.pm) on the forums. Basically there was a bug in several recent released versions of Safe.pm. The latest version I believe has fixed the bug but there may still be other incapatibilities with WeBWorK. However, most OS distributions do not use the latest version of Safe.pm.

Try the command

$ perl -MSafe -e 'print "$Safe::VERSION\n"'

(I haven't tested this) to print out the version of Safe on your system and then compare that to known good versions mentioned on the forum.

Note that the current version of WeBWorK used a renamed copy of an older good version of Safe.pm which is in the WeBWorK distribution.

Arnie
In reply to Arnold Pizer

Re: Webwork errors

by Sarunas Burdulis -
There was no WWSafe.pm in our WW install from SVN. Downloaded WW tarball from Sourceforge, which includes Safe.pm v2.16 as WWSafe.pm. Put it in webwork2/lib/, edited Translator.pm to use WWSafe instead of Safe, restarted Apache, but the problem still persists...

In reply to Sarunas Burdulis

Re: Webwork errors

by Arnold Pizer -
Hi all,

I just set up a new system with Ubuntu 10.04.2 LTS and all updates including the updates 5.10.1-8ubuntu2.1, etc which caused the WeBWorK errors mentioned above.

I then installed the current version of WeBWorK 2.4.9 from trunk.  WeBWorK runs fine without any errors.

The only change that I can think of that would effect things with the new version of WeBWorK is that it uses WWSafe.pm, which is v2.16 of Safe.pm, not the installed Safe.pm which is v2.29.  If this is in fact why the current version runs fine, I don't know why Sarunas' test didn't work.

Arnie
In reply to Arnold Pizer

Re: Webwork errors

by Sarunas Burdulis -
Our test system wwtemp does not produce these errors as well. It's an Ubuntu 10.04.2 with stock sources.list, all updates and fresh WW install from SVN trunk. It uses WWSafe as distributed.

wwtemp:/opt/webwork/webwork2$ svn info
Path: .
URL: http://svn.webwork.maa.org/system/trunk/webwork2
Repository Root: http://svn.webwork.maa.org/system
Repository UUID: c0722133-6baf-4dd8-8699-98d999cd4f06
Revision: 6830
Node Kind: directory
Schedule: normal
Last Changed Author: apizer
Last Changed Rev: 6830
Last Changed Date: 2011-06-03 08:49:04 -0400 (Fri, 03 Jun 2011)

wwtemp:/opt/webwork/pg$ svn info
Path: .
URL: http://svn.webwork.maa.org/system/trunk/pg
Repository Root: http://svn.webwork.maa.org/system
Repository UUID: c0722133-6baf-4dd8-8699-98d999cd4f06
Revision: 6830
Node Kind: directory
Schedule: normal
Last Changed Author: gage
Last Changed Rev: 6817
Last Changed Date: 2011-05-19 22:22:16 -0400 (Thu, 19 May 2011)

"Production" system, where errors occured is "2-4-patches":
webwork:/opt/webwork/webwork2$ svn info
Path: .
URL: http://svn.webwork.maa.org/system/branches/rel-2-4-patches/webwork2
Repository Root: http://svn.webwork.maa.org/system
Repository UUID: c0722133-6baf-4dd8-8699-98d999cd4f06
Revision: 6830
Node Kind: directory
Schedule: normal
Last Changed Author: apizer
Last Changed Rev: 6271
Last Changed Date: 2010-05-19 10:51:25 -0400 (Wed, 19 May 2010)

webwork:/opt/webwork/pg$ svn info
Path: .
URL: http://svn.webwork.maa.org/system/branches/rel-2-4-patches/pg
Repository Root: http://svn.webwork.maa.org/system
Repository UUID: c0722133-6baf-4dd8-8699-98d999cd4f06
Revision: 6830
Node Kind: directory
Schedule: normal
Last Changed Author: pearson
Last Changed Rev: 6589
Last Changed Date: 2010-12-01 00:34:26 -0500 (Wed, 01 Dec 2010)

I'll do more testing on the production system, when the academic year is over.


In reply to Sarunas Burdulis

Re: Webwork errors

by Sarunas Burdulis -
I had no luck with the 'rel-2-4-patches' install, using WWSafe and the latest Ubuntu Perl updates. The 'rel-2-4-patches' setup was a conversion from an earlier CVS install to updates from SVN.

After upgrading to 'trunk' version from http://svn.webwork.maa.org/system/trunk, everything seems to work fine on Ubuntu 10.04.2 with the latest updates, including perl, perl-modules etc.

In reply to Kim Boone

Re: Webwork errors

by Jason Aubrey -
Hi All,

I asked about this error on the mod_perl mailing list this morning to poll a likely source of mod_perl expertise:

http://mail-archives.apache.org/mod_mbox/perl-modperl/201105.mbox/browser

I'll keep you updated on any other potentially useful replies, but Torsten Förtsch (http://search.cpan.org/~opi/) replied to ask:

Are you really sure (I mean really really) that APR::Table is loaded? I see you load Apache2::Log but nothing about APR::Table.

I think if you replace line 74

my $warnings = $r->notes->get("warnings");

by

my $warnings = eval {$r->notes->get("warnings")};
if( $@ ) {
warn "APR::Table is '$INC{q{APR/Table.pm}}'";
die $@;
}

you will see that it is not loaded.

If you use a threaded Perl make sure every interpreter loads APR::Table.
Jason
In reply to Kim Boone

Re: Webwork errors

by John Hsu -
Hi all, we've been seeing the same APR::Table error on CentOS 5 (Apache 2.2.3, Perl 5.8.8). What fixed it for us was updating Apache to the latest 2.2.19.

Some additional info from trying to track down this bug:
  • Not reproducible when running the problematic sections in the shell. Needs to be paired with apache/mod_perl.
  • Only shows up on 64-bit, 32-bit CentOS 5 is fine.
  • Shows up in latest Perl 5.8.8 & 5.10.1 & 5.12.2
  • Probably not a problem with Perl modules, updating to the latest with CPAN didn't solve this.
  • mod_perl is the same version in both Ubuntu and CentOS, since the latest Ubuntu works fine, it probably isn't mod_perl.
  • Full error message:
"Failed to initialize course environment: Could not evaluate global environment file /home/john/webworkdev/webwork2/conf/global.conf: Can't locate object method "get" via package "APR::Table" at /home/john/webworkdev/webwork2/lib/Apache/WeBWorK.pm line 81."
  • An additional error message appeared with extra debugging statements & Perl 5.10.1:
"Failed to read include file /home/john/webworkdev/webwork2/conf/database.conf (has it been created from the corresponding .dist file?): Cannot allocate memory at (eval 1214) line 12."
  • The new error message appears to point to an out of memory error, however, the system has plenty of RAM. It does not appear to be a configurable OS memory limitation either, at least as far as I can tell from tweaking with ulimit.
  • The exception is thrown in the middle of a WWSafe->reval(), playing around with Safe versions did not fix this.






In reply to John Hsu

Re: Webwork errors

by Michael Gage -
This is very useful information John.  Thanks.

Yours is probably the best advice for resolving the issue. I suspect that this 
particular error doesn't really involve WWSafe.pm -- it just occurs there.

There is another error -- where the process just hangs and nothing happens until you restart -- that one definitely occurs because one is using one of the 
incompatible Safe.pm modules and changing to WWSafe.pm fixes it. (at least so far.)


-- Mike
In reply to Michael Gage

Re: Webwork errors

by Kurt O'Hearn -
Hello all,

I'm having the same errors described in the above posts, except I'm running Fedora 15. Here's other information related to my configuration:

Apache/2.2.17 (Unix) PHP/5.3.6 mod_python/3.3.1 Python/2.7.1 mod_ssl/2.2.17 OpenSSL/1.0.0d-fips mod_apreq2-20090110/2.8.0 mod_perl/2.0.5 Perl/v5.12.4

I also have the Safe.pm v2.29 perl module installed, and I even tried loading the Task::Kensho module in case I was missing any other dependencies.

If there's another thread I missed that these issues have been resolved, I'd appreciate redirection to it.

Thanks.
-Kurt
In reply to Kurt O'Hearn

Re: Webwork errors

by Michael Gage -
I suggest first that if you installed from a tarball, that you do an 

svn update

in the webwork2 and pg directories to make sure that you have the latest version of the webwork software.

This error seems to have been associated with one release of Apache  so updating to Apache 2.2.19 might fix the problem.

Safe.pm v2.29 is not compatible with WeBWorK but if you are using the latest trunk version you _should_ be using WWSafe.pm (included with WeBWorK) automatically and not using the Safe.pm v2.29 code.  The signature of using Safe.pm v2.29 is that certain problems (not all, but most of the using MathObjects) will simply hang and not return.

Hope this helps -- let us know what works.

-- Mike
In reply to Michael Gage

Re: Webwork errors

by Kurt O'Hearn -
Hi Michael,

Thanks for the advise. I updated both WeBWorK via SVN and Apache, but neither fixed my problem.

However, I was using the rel-2-4-patches branch of WeBWorK from the SVN repository, and decided to try using the trunk instead. After installing the trunk, everything works. Is there anything that was changed recently from 2.4.9 that may be conflicting with newer updates?

-Kurt