WeBWorK Main Forum

Problems starting webwork after package upgrade

Problems starting webwork after package upgrade

by Lars Jensen -
Number of replies: 12
Hi Everyone,

After a Debian package upgrade on our test server we're having problem re-starting webwork. Apache started without problems, but the browser would report "Not found" when I pointed it to server/webwork2 URL. Then I moved the webwork.conf symbolic link from /etc/apache2/apache2.conf to /etc/apache2/mods-enabled and this got webwork started, but with errors (see below). 

Further, when I go to the  server/webwork2 page and attempt to login to a course, I get errors (see further down, below).

Any ideas?

Thanks,
Lars.

Starting web server: apache2[Sat Nov 02 17:43:41.657244 2013] [so:warn] [pid 8033] AH01574: module apreq_module is already loaded, skipping
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://mahler.tmcc.edu/webwork2
Localize.pm: Full path for the localization directory set to |/opt/webwork/webwork2/lib/WeBWorK/Localize|
defined(@array) is deprecated at /usr/share/perl5/Mail/Sender.pm line 318.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /usr/share/perl5/Mail/Sender.pm line 2693.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm line 115.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm line 117.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Index.pm line 318.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Index.pm line 320.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm line 197.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm line 199.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm line 371.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm line 373.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm line 109.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm line 111.
        (Maybe you should just omit the defined()?)
WebworkSOAP::WSDL: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
WebworkSOAP::WSDL: rpc_url set to http://mahler.tmcc.edu/webwork2_rpc 
WebworkWebservice: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
____________________

Error message when I attampt to login to a course:

Warning messages

Error messages

Can't locate object method "remote_addr" via package "Apache2::Connection" at /opt/webwork/webwork2/lib/WeBWorK/Authen.pm line 909.

Call stack

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

  • in WeBWorK::Authen::write_log_entry called at line 630 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::checkPassword called at line 555 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::authenticate called at line 526 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::verify_normal_user called at line 308 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::do_verify called at line 217 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::verify called at line 307 of /opt/webwork/webwork2/lib/WeBWorK.pm
In reply to Lars Jensen

Re: Problems starting webwork after package upgrade

by Heath Hart -
Hi there, Lars --

I ran into the same problem recently, and for the same reason: WeBWorK 2.7 does not play nicely with Apache 2.4. At the time, I gave up and reverted to my backed-up copy, choosing not to upgrade Debian.

This week, while we were off from classes, I've managed to cobble together some changes which make WeBWorK functional under Apache 2.4. I haven't tested every feature of WeBWorK under this configuration, so it's very likely that some features remain broken, but here's what I've come up with:

(1) In the Apache configuration file, the names "MaxClients" should be renamed "MaxRequestWorkers" and "MaxRequestsPerChild" should be renamed "MaxConnectionsPerChild". (see: http://docs.cpanel.net/twiki/bin/view/EasyApache/Apache/Apache24Issues )

(2) In /opt/webwork/webwork2/lib/WeBWork/Authen.pm, replace "remote_addr" with "client_addr" (3 occurrences). You'll still get warning messages about defined(@array) being deprecated, but this should get you going past the sticking point you've described.

Good luck,
Heath
In reply to Heath Hart

Re: Problems starting webwork after package upgrade

by Arnold Pizer -
Hi Heath,

How is WeBWorK working with Apache 2.4?  The main problem was (is?) that mod_perl was not compatible with Apache 2.4 (try googling "apache 2.4 mod_perl"). Maybe the mod_perl package you used is compatible with Apache 2.4 (what distro are you using?).

If the only problem (with at least some distros) involves changing the Apache configuration file, that would be great.

Arnie
In reply to Arnold Pizer

Re: Problems starting webwork after package upgrade

by Heath Hart -
Hi there -- Over the Thanksgiving break, I started with a clean Fedora 19 64-bit install and was able to run WeBWorK in that environment with the minimal changes I described above. The version of Apache we're using is 2.4.6 and the version of mod_perl we're using is 2.0.7. I hope that info helps. Let me know if I can be of any additional help. Heath
In reply to Heath Hart

Re: Problems starting webwork after package upgrade

by Geoff Goehle -
I just wanted to help close off this thread by saying that Apache 2.4 support is now available in the develop branch (as of 1/28/2014).  The main difference is that you should use the webwork-apache2.4-config file instead of webwork-apache2-config.  
In reply to Geoff Goehle

Re: Problems starting webwork after package upgrade

by Chris Caldwell -
I am having this same problem.  I am new to WeBWorK and working through 
 
http://webwork.maa.org/wiki/Installation_Manual_for_2.9_on_Ubuntu_14.04

My system is running Ubuntu 14.4 (Server Version: Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f mod_apreq2-20090110/2.8.0 mod_perl/2.0.8 Perl/v5.18.2); ww_version: 2.10, pg_version: 2.10. 

What might I be doing wrong?

 

Error messages

Can't locate object method "remote_addr" via package "Apache2::Connection" at /opt/webwork/webwork2/lib/WeBWorK/Authen.pm line 920.

Call stack

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

  • in WeBWorK::Authen::write_log_entry called at line 629 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::checkPassword called at line 554 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::authenticate called at line 524 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::verify_normal_user called at line 306 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::do_verify called at line 217 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
  • in WeBWorK::Authen::verify called at line 317 of /opt/webwork/webwork2/lib/WeBWorK.pm

Request information

MethodPOST
URI/webwork2/admin/
HTTP Headers
User-AgentMozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Refererhttp://math.utm.edu/webwork2/admin/
Originhttp://math.utm.edu
Content-Length238
Accept-Languageen-US,en;q=0.8
ConnectionKeep-Alive
Cookie__utma=52522220.1045221416.1414421962.1420562789.1420639439.10; __utmc=52522220; __utmz=52522220.1414421962.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
Accepttext/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Cache-Controlmax-age=0
Content-Typemultipart/form-data; boundary=----WebKitFormBoundaryrAB0dHWQ4vLdDle5
Hostmath.utm.edu


Loaded Modules

core.c, http_core.c, mod_access_compat.c, mod_alias.c, mod_apreq2.c, mod_auth_basic.c, mod_authn_core.c, mod_authn_file.c, mod_authz_core.c, mod_authz_host.c, mod_authz_user.c, mod_autoindex.c,mod_cgi.c, mod_deflate.c, mod_dir.c, mod_env.c, mod_filter.c, mod_headers.c, mod_info.c, mod_log_config.c, mod_logio.c, mod_mime.c, mod_negotiation.c, mod_perl.c, mod_php5.c, mod_rewrite.c,mod_setenvif.c, mod_so.c, mod_socache_shmcb.c, mod_ssl.c, mod_status.c, mod_unixd.c, mod_userdir.c, mod_version.c, mod_watchdog.c, prefork.c,

Server Settings

Server Version: Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f mod_apreq2-20090110/2.8.0 mod_perl/2.0.8 Perl/v5.18.2
Server Built: Jul 22 2014 14:36:38
Server loaded APR Version: 1.5.1-dev
Compiled with APR Version: 1.5.1-dev
Server loaded APU Version: 1.5.3
Compiled with APU Version: 1.5.3
Module Magic Number: 20120211:27
Hostname/port: math.utm.edu:80
Timeouts: connection: 1200    keep-alive: 5
MPM Name: prefork
MPM Information: Max Daemons: 150 Threaded: no Forked: yes
Server Architecture: 64-bit
Server Root: /etc/apache2
Config File: /etc/apache2/apache2.conf
Server Built With:  -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/etc/apache2" -D SUEXEC_BIN="/usr/lib/apache2/suexec" -D DEFAULT_PIDLOG="/var/run/apache2.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="mime.types" -D SERVER_CONFIG_FILE="apache2.conf"

In reply to Chris Caldwell

Re: Problems starting webwork after package upgrade

by Chris Caldwell -
Here is a workaround for my install (but I have still no clue if this is caused by my error or a bug).  Lines 909 through 917 of Authen.pm are as follows:

        # If its apache 2.4 then it has to also mod perl 2.0 or better
        my $APACHE24 = 0;
        if (MP2 && Apache2::ServerUtil::get_server_banner() =~
          m:^Apache/(\d\.\d+\.\d+):) {
            $APACHE24 = version->parse($1) >= version->parse('2.4.00');
        }

        # If its apache 2.4 then the API has changed
        if ($APACHE24) {

just add $APACHE24 = 1; above the if.   I also need to do this in SendMail.pm about line 272 (seems to use the same code).   And of course restart the server...
In reply to Chris Caldwell

Re: Problems starting webwork after package upgrade

by Lasha K -
Hello Chris,
Thanks for your post and providing a temp fix.

I am on Debian Jessie (Testing) running Apache 2.4.10. If I try to turn off server token on Apache using
ServerTokens Prod

in /etc/apache2/conf-enabled/security.conf
I am getting the same error as you mentioned (also recently mentioned by Ben here).
If I set this option to
ServerTokens OS
Then everything works as expected.
In reply to Lasha K

Re: Problems starting webwork after package upgrade

by Chris Caldwell -
Most security sites (and our university's ITC) recommend against passing too much info about your system to would be hackers.  Why not try "ServerTokens Min" which would give less info, but perhaps enough ("Server: Apache/2.4.10" instead of "Server: Apache/2.4.10 (Unix)")?  When I get a chance, I was going to try spoofing that line (which Apache allows) and give some weird version number that is high enough to pass the WW test, but too crazy to be any use to hackers (because my temporary fix above will surely fail on upgrade).

I am running WeBWorKs on a server that does many other things, so I cannot just change system settings as freely as the install manuals seem to desire. (E.g., the default db engine must be utf8; I cannot change that.)

Perhaps the coders might add a comment in the (at least three) scripts that use this same code saying they are assuming the server is broadcasting at least product, major and minor version info in its header.  They code also only needs to know if it is greater > 2.4, so they should not assume the minor version info is also passed (so you could use "ServerTokens Minor" and not broadcast your operating system).  

In reply to Chris Caldwell

Re: Problems starting webwork after package upgrade

by Lasha K -
Hi Chris,
Thank you very much for your reply. I will certainly try the option Min instead of OS. Still, even with OS enabled, WW e-mail does not work in my case (following the link throws the similar error message as mentioned above).
I am sure the problem here is not caused by WebWork code. In my case, it is due to some server misconfiguration. Namely, the version of mod_perl (2) is not propagated system-wide, even if I have set MOD_PERL_API_VERSION=2 in Apache envars (in /opt/apache2/envars):

For instance, I have installed Apache2::SOAP from CPAN along with mod_perl2, and all necessary Debian packages like libapache2-mod-perl2, and when I issue the command
perl -MApache2::SOAP -e 'print "installed!\n"'
the following error message is thrown
Unsupported version of mod_perl at /usr/local/share/perl/5.20.1/SOAP/Transport/HTTP2.pm line 85.
Compilation failed in require.
BEGIN failed--compilation aborted.

This problem about mod_perl version has been earlier reported on both MAA and Moodle forums here
I have also seen a note in WebWork documentation to install mod_perl2 from cpan to avoid any conflicts with SOAP. I believe it is exactly what I have done. Alas, still no success.
Lastly, it is clear that WSDL will not work either when there is such a misconfiguration.
In reply to Chris Caldwell

Re: Problems starting webwork after package upgrade

by Geoff Goehle -
As an FYI, future versions of WW will allow the server version to be set manually.  For now either use "ServerTokens Minor" or manually edit the code to change $Apache24 = 1 in the appropriate places.  
In reply to Lasha K

Re: Problems starting webwork after package upgrade

by Nathan Wallach -

Since I ran into this issue after changing the Apache config to use "ServerTokens Prod" and did not find the current recommended solution in the forums or the current install docs, I have added it to the WW 2.15 installation instructions on the wiki in the section about site.conf, and am posting in the relevant forum threads.

The best approach to fixing errors of this type is for the site.conf file to manually provide a value for "$server_apache_version" in site.conf. This was explained in the release notes for version 2.11 at https://webwork.maa.org/wiki/Release_notes_for_WeBWorK_2.11 but has not been well document elsewhere.

In reply to Nathan Wallach

Re: Problems starting webwork after package upgrade

by Nathan Wallach -
At present, in WW 2.15 and apparently back to WW 2.11, the setting
$server_apache_version = '2.4';
in site.conf should work, but not forms like
$server_apache_version = '2.4.29';
with 3 numeric parts to the version number. This is due to a bug in the code adding support for this setting. Hopefully this will be fixed in WW 2.16, and maybe in a hotfix to WW 2.15.
See: https://github.com/openwebwork/webwork2/pull/1145