Installation

Apache won't start after upgrade

Apache won't start after upgrade

by Andrew Bayliss -
Number of replies: 10
I recently tried to upgrade my webwork installation from 2.5.0 to 2.5.1.3 on one of my school's ubuntu 10.04.4 LTS servers.

Admittedly, I am very new at ubuntu and administering a server. I was trying to follow the directions for upgrading on the wiki, as well as making changes to site.conf which are referenced when upgrading to 2.5.1. Anyways after following the directions, I tried to restart apache and received the following error.

"(in cleanup) Could not evaluate global environment file /opt/webwork/webwork2/conf/defaults.config: Failed to read include file /opt/webwork/webwork2/PG_VERSION (has it been created from the corresponding .dist file?): Bad file descriptor at (eval 30) line 12.

at /etc/apache2/conf.d/webwork.conf line 69.

Syntax error on line 45 of /etc/apache2/conf.d/webwork.conf:

Failed to read include file /opt/webwork/webwork2/PG_VERSION (has it been created from the corresponding .dist file?): Bad file descriptor at (eval 30) line 12.\n\t(in cleanup) Could not evaluate global environment file /opt/webwork/webwork2/conf/defaults.config: Failed to read include file /opt/webwork/webwork2/PG_VERSION (has it been created from the corresponding .dist file?): Bad file descriptor at (eval 30) line 12.\n at /etc/apache2/conf.d/webwork.conf line 69."

I was able to restore my former installation. However, I was really interested in some of the new features. If anyone could provide a little help, I would greatly appreciate it.

Andrew
In reply to Andrew Bayliss

Re: Apache won't start after upgrade

by Jason Aubrey -
Hi Andrew,

Did you also update pg? There should be a file in /opt/webwork/pg called "VERSION". If that file is there, then there should be a symlink in /opt/webwork/webwork2 called PG_VERSION. There are four ways this could get messed up, but my guess is that you're in case (1) or (2) below.

(1) If you see PG_VERSION in /opt/webwork/pg but no link to it in /opt/webwork/webwork2 then do

ln -s /opt/webwork/pg/VERSION PG_VERSION

from within /opt/webwork/webwork2.

(2) If you see /opt/webwork/webwork2/PG_VERSION but no /opt/webwork/pg/VERSION then update your pg to the github 2.5.1 version. Then double check that PG_VERSION does in fact point to the /opt/webwork/pg/VERSION file.

(3) If you see both /opt/webwork/webwork2/PG_VERSION and /opt/webwork/pg/VERSION then it could be that the symlink PG_VERSION is pointing to the wrong place. Then just delete it and do

ln -s /opt/webwork/pg/VERSION PG_VERSION

from within /opt/webwork/pg.

(4) If neither file is there then update pg to get /opt/webwork/pg/VERSION and make sure you have the github branch you want (2.5.1.3) and create the link as above.

Hope this helps,
Jason

In reply to Jason Aubrey

Re: Apache won't start after upgrade

by Andrew Bayliss -
I updated pg to version to 2.5.1 as found at github.com/openwebwork/pg in a zip file, and I took webwork2 from github.com/openwebwork/webwork2-dev. I was under the understanding that I did not need the pg-dev version to upgrade to webwork2 to version 2.5.1.3.

Also, I tried to create both links you referenced between PG_VERSION in the webwork2 directory and the VERSION file in pg directory. Unfortunately, it didn't resolve my problem. I am still getting the same error when I restart apache.

Andrew
In reply to Andrew Bayliss

Re: Apache won't start after upgrade

by Michael Gage -
Hi Andrew,

My diagnosis is the same as Jason's.  There is a command include("PG_VERSION") in defaults.config. (Also include("VERSION") and include("conf/site.conf") ) Apparently it can find the latter two but not the former.

If you type 

less PG_VERSION     

in    webwork/webwork2  directory you should get a listing 
of the PG version (which is actually contained in the file webwork/pg/VERSION).

ls -l PG_VERSION
should show you the address that the alias PG_VERSION points to.

If you don't get a listing then either a file is missing or a link is broken.  

Despite the long error message that is the only thing the compiler is complaining about. The other messages don't mean much after that first error.  

Hope this helps.

--Mike


In reply to Michael Gage

Re: Apache won't start after upgrade

by Andrew Bayliss -
I wasn't getting the pg version using the ls command above, so I had to delete PG_VERSION and recreate it using "ln -s /opt/webwork/pg/VERSION PG_VERSION". Afterwards when I restarted apache2, I got farther in the restarting process, but it still failed.

* Restarting web server apache2
webwork.apache2-config:
WeBWorK server is starting webwork.apache2-config:
WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config webwork.apache2-config:
The following locations and urls are set in webwork2/conf/site.conf webwork.apache2-config:
PG root directory set to /opt/webwork/pg webwork.apache2-config:
WeBWorK server userID is www-data webwork.apache2-config:
WeBWorK server groupID is wwdata webwork.apache2-config:
The webwork url on this site is http://webwork.sparta.org/webwork2 Localize.pm:
Full path for the localization directory set to |/opt/webwork/webwork2/lib/WeBWorK/Localize|

Then,
Syntax error on line 45 of /etc/apache2/conf.d/webwork.conf: Can't locate Text/CSV.pm in @INC (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . /etc/apache2) at /opt/webwork/webwork2/lib/WeBWorK/File/Classlist.pm line 29.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/File/Classlist.pm line 29.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm line 71.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm line 71.

The error code is continues in that vain for a few more lines. I am wondering due to "Can't locate Text/CSV.pm in @INC" if there are more links that are broken. I looked through webwork.apache2-config and made the adjustments for Apache 2.2, but still to no avail. I continue to get the above error when restarting apache2.

Andrew
In reply to Andrew Bayliss

Re: Apache won't start after upgrade

by Michael Gage -
You are missing a cpan module

sudo cpan Text::CSV

Should install it


-- Mike
In reply to Michael Gage

Re: Apache won't start after upgrade

by Andrew Bayliss -
Thank you all so much for the help.

Deleting and and reestablishing the link between PG_VERSION and VERSION in the pg folder, then installing the CPAN module seems to have worked.

I have upgraded the courses and updated the modelcourse. However, when upgrading the courses I get the following:

"There are extra database fields which are not defined in the schema for at least one table. They can only be removed manually from the database."
&
"Field published => missing in schema"

Also, I am unable to use the Library browser. I get the following error.

DBD::mysql::st execute failed: Table 'webwork.OPL_DBsubject' doesn't exist at /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 243.


Andrew
In reply to Andrew Bayliss

Re: Apache won't start after upgrade

by Michael Gage -
Hi Andrew,

&
"Field published => missing in schema"

This ok.  Your old courses will have an extra unused field in some of the tables.
(The "published" field has been replaced by the "visible" field. ) New courses
won't show this warning.

If you want, you can learn to use mysql directly to remove this field, but it will not do any harm aside from issuing this warning message in the "upgrade courses" page.

For the other message you need to run the OPL upgrade file and also make sure that  you have overridden the problemLibraryVersion number, setting it to 2.5

# For configuration instructions, see:
# http://webwork.maa.org/wiki/National_Problem_Library
# The directory containing the natinal problem library files. Set to "" if no problem
# library is installed.
$problemLibrary{root}        ="/opt/webwork/libraries/NationalProblemLibrary";
# Problem Library version (currently version 2).
$problemLibrary{version} = "2";   #set to 2.5 to use the OPL


in localOverrides.conf.  
In reply to Michael Gage

Re: Apache won't start after upgrade

by Andrew Bayliss -
So far, you have really helped me get this upgrade done. The problem library is fixed. Everything seems useable with my courses, but the last issue I am having is trying to access the Course Configuration page. I get the following.

WeBWorK error

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

Sun Feb 17 22:04:49 2013

Warning messages

  • Use of uninitialized value $localizeDir in opendir at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Config.pm line 491.<br />Use of uninitialized value $localizeDir in concatenation (.) or string at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Config.pm line 491.<br />

Error messages

can't opendir : No such file or directory at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Config.pm line 491.

Call stack

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

  • in WeBWorK::ContentGenerator::Instructor::Config::getConfigValues called at line 514 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Config.pm
  • in WeBWorK::ContentGenerator::Instructor::Config::pre_header_initialize called at line 181 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 371 of /opt/webwork/webwork2/lib/WeBWorK.pm

Request information

Method GET
URI /webwork2/CP_PreCalc_Bayliss/instructor/config/
HTTP Headers
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection keep-alive
Referer http://webwork.sparta.org/webwork2/CP_PreCalc_Bayliss/instructor/sets/?effectiveUser=admin&user=admin&theme=&key=aZGAgB45DxI8j0HZaQ6VD8iwJtM6aY4J
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Cookie WeBWorKCourseAuthen.AB_Calc_Bayliss=admin%09vFWClLJZq03wWZkZDUvbRs5xODJC1Ywu%091361155100; WeBWorKCourseAuthen.CP_PreCalc_Bayliss=admin%09aZGAgB45DxI8j0HZaQ6VD8iwJtM6aY4J%091361156681
Host webwork.sparta.org

Again, thank you for all your time with helping me with this.

Andrew
In reply to Andrew Bayliss

Re: Apache won't start after upgrade

by Michael Gage -
That's a bug that has been recently fixed.  You need these entries
in defaults.config:

# Location of theme templates.
$webworkDirs{themes} = "$webworkDirs{htdocs}/themes";

# Location of localization directory.
$webworkDirs{localize} = "$webworkDirs{root}/lib/WeBWorK/Localize";

# URL of general WeBWorK documentation.
$webworkURLs{docs} = "http://webwork.maa.org";


(the middle one is what needs to be added). If you use git to update
your ww2.5.1.3 repo from openwebwork/webwork2-dev then you should have
this line added automatically.

There are some other updates as well -- including ongoing updates to the
math3 theme. If you want to just enter the location of the localize directory
to your localOverrides.conf file that should also get rid of the error

-- Mike