Installation

WebworkClient 500 error

WebworkClient 500 error

by Albin Niva Printz -
Number of replies: 5
Hi!

When in Library Browser, if I select a hmwk set in the 'Add problem to Target Set:' menu, I encounter the following error:

WebworkClient Errors

Errors:

500 Can't connect to problem.math.su.se:443 at /var/webwork/webwork2/lib/WebworkClient.pm line 292.

End Errors

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.

Thu Oct 04 10:20:10 2018

Warning messages

  •  

Error messages

xmlrpcCall to listSetProblems returned no result for

Call stack

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

  • in WeBWorK::ContentGenerator::instructorXMLHandler::content called at line 233 of /var/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 382 of /var/webwork/webwork2/lib/WeBWorK.pm

Request information

Method POST
URI /ww2/instructorXMLHandler
HTTP Headers
Content-Length 226
Accept-Language en-GB,en;q=0.5
X-Requested-With XMLHttpRequest
Accept-Encoding gzip, deflate, br
Content-Type application/x-www-form-urlencoded; charset=UTF-8
Referer https://problem.math.su.se/ww2/Algebra-och-Geometri/instructor/setmaker/?effectiveUser=admin&key=Z7k7VCCG4MY1MbpaYknUQW7yan9k3dQM&user=admin
Cookie WeBWorKCourseAuthen.Utmanande_matematik=albin.printz%40gmail.com%09WVzGkShU3cP9qZL90qfmqa9vWotyI6Gf%091538637202; WeBWorKCourseAuthen.Algebra-och-Geometri=admin%09Z7k7VCCG4MY1MbpaYknUQW7yan9k3dQM%091538640961; __utma=91495576.1101515367.1504702921.1538481103.1538572638.21; __utmz=91495576.1538572638.21.17.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); _ga=GA1.2.1101515367.1504702921; __utma=225122438.1101515367.1504702921.1536222512.1538481010.9; __utmz=225122438.1522830009.4.2.utmcsr=prep.math.su.se|utmccn=(referral)|utmcmd=referral|utmcct=/mod/tenta/view.php; _ga=GA1.3.1101515367.1504702921; MoodleSession=r42gslh6lvun4krjnvf2d2vssj; _shibsession_64656661756c7468747470733a2f2f70726f626c656d2e6d6174682e73752e73652f73686962626f6c657468=_9aca619db588287e2858d42c8d79feda; __utmc=91495576; __utmc=225122438; _gid=GA1.2.856624744.1538572638
Host problem.math.su.se
Connection keep-alive
Accept */*
User-Agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

The apache error log throws the following

There were a lot of errors
Errors:
500 Can't connect to problem.math.su.se:443 at /var/webwork/webwork2/lib/WebworkClient.pm line 292.

End Errors
xmlrpcCall to listSetProblems returned no result for
[Thu Oct 04 10:28:06.940355 2018] [perl:error] [pid 13488] [client 130.237.198.139:44234] [/ww2/instructorXMLHandler] xmlrpcCall to listSetProblems returned no result for \n * in WeBWorK::ContentGenerator::instructorXMLHandler::content called at line 233 of /var/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm\n * in WeBWorK::ContentGenerator::go called at line 382 of /var/webwork/webwork2/lib/WeBWorK.pm, referer: https://problem.math.su.se/ww2/Algebra-och-Geometri/instructor/setmaker/?effectiveUser=admin&key=Z7k7VCCG4MY1MbpaYknUQW7yan9k3dQM&user=admin

If I turn on the unit test variable in WebworkClient.pm, I get a lot of

Use of uninitialized value in join or string at /var/webwork/webwork2/lib/WebworkClient.pm line 285

warnings. Now I'm stuck. Does anyone have any ideas as to what could cause this?

-Albin

In reply to Albin Niva Printz

Re: WebworkClient 500 error

by Michael Gage -
The root cause is that the AJAX call back to the server from the library page or the homework detail page is not connecting. This is usually because the
$server_root_url is not properly configured. You can verify the error by enabling the web developer tools (console) in your browser -- there will be some errors reported about not being able to connect.

There are possible variations on why the connection is not occurring. I think using the search feature in this forum and searching for "server_root_url" will bring up various examples of this problem and you can see which one most closely matches your case.

The usual situation is that the initial https or http in the server_root_url was not correctly set.

In reply to Michael Gage

Re: WebworkClient 500 error

by Albin Niva Printz -
$server_root_url is properly configured as

$webwork_url = '/ww2';
$server_root_url = 'https://problem.math.su.se';

The web-console only shows a JSON-parsing syntax error, which I think is because it tries to parse the error message.

I can't see any connection errors related to this. There are some images being loaded which shows no status code, might this be related (see attachment)?

We recently switched to https so this might be the issue, it has worked in the past.

I will keep looking around on the forum for similar issues.

Thanks!
In reply to Albin Niva Printz

Re: WebworkClient 500 error

by Danny Glin -
There have been cases in the past where in certain places in the code /webwork2 was hard-coded as the root url for WeBWorK, so there's a chance that the problems you're seeing are a result of using /ww2 as the url.

If you can, I'd say try changing $webwork_url back to '/webwork2' and seeing if it fixes the problem.
In reply to Danny Glin

Re: WebworkClient 500 error

by Michael Gage -
I can confirm that using /ww2 will not work. For now you must use $webwork_url='/webwork2'

This is a bug in the javaScript driving the LibraryBrowser and the HomeworkSetDetail page.


for the discussion where this bug was discovered.

/webwork2 is hardcoded into one of the addresses in a javaScript file. Since this file is served directly from the disk it does not reference site.conf to find the 'correct' value of $webwork_url. All of the perl code uses $webwork_url correctly. Perhaps someone with more experience with javaScript can suggest the best way to modify the javaScript files for LibraryBrowser and HomeworkSetDetail so that they observe the value of $webwork_url
In reply to Michael Gage

Re: WebworkClient 500 error

by Albin Niva Printz -
We have used /ww2/ for quite a while on this setup. We actually made some modifications to the necessary javascript files, instructorXMLHandler.pm, and renderViaXMLRPC.pm, which have worked fine up until recently.

I will continue digging, and post here if I manage to locate the issue...