Installation

WebWork would not start on reboot.

WebWork would not start on reboot.

by Daryl Tingley -
Number of replies: 3
Hi.  I am using Revision 7146
I updated to 7146 last summer and remember having some problems getting apache2 to start. I thought I had the issue fixed, however...
This weekend a power failure caused our machine to reboot.
apache2 would not start. Below is the error message.

In desperation, I commented out the offending line in 
/opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm 
That is line 43, 
#use File::Path 'remove_tree';
Webwork is now up and running, but I need to know if my "fix" will cause an issue somewhere else, and would also like to know what the correct "fix" is?

Thanks, Daryl



webwork.apache2-config:  The webwork url on this site is http://weisner2.math.unb.ca/webwork2
Localize.pm: Full path for the localization directory set to |/opt/webwork/webwork2/lib/WeBWorK/Localize|
Syntax error on line 45 of /opt/webwork/webwork2/conf/webwork.apache2-config:
"remove_tree" is not exported by the File::Path module\nCan't continue after import errors at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm line 43\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm line 43.\nCompilation failed in require at (eval 1219) line 3.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK.pm line 86.\nCompilation failed in require at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\n\t(in cleanup) "remove_tree" is not exported by the File::Path module\nCan't continue after import errors at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm line 43\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm line 43.\nCompilation failed in require at (eval 1219) line 3.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK.pm line 86.\nCompilation failed in require at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm
 line 35.\nCompilation failed in require at /opt/webwork/webwork2/conf/webwork.apache2-config line 96.\n
In reply to Daryl Tingley

Re: WebWork would not start on reboot.

by Danny Glin -
I went through this issue this summer.  I don't have my WeBWorK server in front of me, so I'm working from memory on the details:

Some versions of the perl File::Path package do not include the remove_tree routine, which was a more robust replacement for rmtree (mostly improving error reporting).

There are two fixes:
  1. Update the perl File::Path package to a version which contains the remove_tree routine.  I chose not to go this route because it would mean installing via CPAN rather than using the version provided by the package manager (in my case yum on a RedHat system).
  2. Do a search and replace in CourseAdmin.pm replacing all instances of "remove_tree" with "rmtree".  If you do this, all functions in WeBWorK should work, but things using remove_tree may not provide useful errors if they fail.
As the name indicates, remove_tree is used to remove a directory tree (i.e. a directory and all of its subdirectories).  I believe that the only place this is used in CourseAdmin.pm is for deleting a course.  By commenting it out, this is likely the only functionality that you are breaking.

I had a discussion with the WeBWorK developers about using remove_tree vs. rmtree.  The former provides more verbose output in case of any errors or warnings, while the latter works with all versions of File::Path.  In the end I wan't able to convince them to change to rmtree.

Danny
In reply to Daryl Tingley

Re: WebWork would not start on reboot.

by Arnold Pizer -
Hi,

Danny is correct.  I would check the version of File::Path you are using.  remove_tree is in version 2.07 that was released in November 2008 so you must be using a version older than that.  Updating using cpan should be fine.
You could also check what version is currently packaged with your OS.

remove_tree is used e.g. when archiving courses which is something you might want to do.  

Arnie
In reply to Arnold Pizer

Re: WebWork would not start on reboot.

by Daryl Tingley -
A follow up, for information. 

The machine I use (like Danny's) runs RedHat.  It is managed by the technology people on campus. But I have root access.


Most of the perl modules needed by webwork  were installed (by me) with yum. A few with cpan. Root's  .cpan directory shows File::Path was built last summer, when I updated webwork. I recall installing a few modules at that time. I recall a bit of frustration, perhaps that was with File::Path, not sure. 

On Oct 30 an update of perl was done with yum (likely automatically). I guess File::Path reverted back to the redhat version at that time. When the machine was rebooted a few days later the webserver would not restart because of the wrong version of File::Path. 

I have now installed File::Path into site_perl. I dont think that will get overwritten by future updates.

Thanks form the help, Daryl