WeBWorK Main Forum

Gateway quiz crashes server

Gateway quiz crashes server

by Evan Fink -
Number of replies: 13

We have just set up a WeBWorK server using version 2.17.  I was testing a Gateway Quiz, which was set up with a 5 minute time limit (and a closing date long in the future) to see what would happen if a student did not submit after the 5 minute timer was up.  A few minutes after the timer hit 0, I looked back at the test I had open, only to find that our server crashed.   After the server was restarted, I tried the same test again, and faced the same issue -- the crash occurred about two minutes after the timer hit 0.

I was hoping that someone here might have an idea what could have caused this crash, or where to start looking to find the cause.

Admittedly, we have not yet tried setting $gatewayGracePeriod to 10 yet, as was suggested in a recent thread.  Could this possibly help?  (And forgive the naive question, but does this advice simply mean: paste "$gatewayGracePeriod = 10;" into localOverrides.conf anywhere in the file?) 

Any thoughts are appreciated!

In reply to Evan Fink

Re: Gateway quiz crashes server

by Glenn Rice -

It sounds like something is wrong with the quiz that you are testing, or you have database corruption.

What is happening is that the default value for $gatewayGracePeriod is 120 (i.e. two minutes).  10 seconds before the end of the grace period the quiz will automatically submit if the gateway quiz page is left open in the browser until then.

What happens if you just manually submit the quiz before the grace period is over?  Does that cause the same issue?

In reply to Glenn Rice

Re: Gateway quiz crashes server

by Evan Fink -

It appears that if I submit the quiz either before 0:00, or, say, 30 seconds after 0:00, it doesn't cause the issue.  

I'll see what messages were in the system log tomorrow morning.  

Regarding the quiz: I have no idea if any of these are relevant, but the quiz has 20 questions, all displayed at once, and every question is drawn from a grouping set; most questions are multiple choice, with a handful of free response expecting integer or rational answers.

Thanks!

In reply to Evan Fink

Re: Gateway quiz crashes server

by Glenn Rice -
It is certainly odd that submitting the quiz before the grace period doesn't cause the same issue. Does the developer console in the browser give you any information when this happens?

The setup of the quiz itself shouldn't be relevant. More likely is that one of the problems does something wrong.

Also, as to your earlier question about setting $gatewayGracePeriod, yes, just add "$gatewayGracePeriod = 10;" somewhere in localOverrides.conf (without the surrounding quotes).
In reply to Glenn Rice

Re: Gateway quiz crashes server

by Evan Fink -

Hi, I've got a little more info now on this issue.  I did a new test today.  I opened a test at 3:07:07, with a 3 minute time limit, and simply let the test stay open.  At around 3:12 -- right when the auto submit should take place -- I noticed that the icon in my browser tab looked like it started refreshing repeatedly.  Sure enough, in the server log, there are records of POST requests each second from 3:12:02 to 3:12:07 (at which time I logged out of WW, to thwart another crash).

From the last actual crash, the server log shows that there was an out-of-memory kill.

So it sounds a little like WeBWorK auto-submit is trying to submit over and over again.  Apologies if this is misleading or unhelpful info, but if I'm right, could you imagine any reason why that might be happening?  Thanks again!

In reply to Evan Fink

Re: Gateway quiz crashes server

by Danny Glin -

What browser are you using?  Are you able to reproduce this with a different browser?

In reply to Danny Glin

Re: Gateway quiz crashes server

by Evan Fink -

Hmmm.... I've been using Chrome.  It seems to happen on both Chrome and Edge, but NOT on Firefox.

In reply to Danny Glin

Re: Gateway quiz crashes server

by Andras Balogh -
I tried this two days ago (since our browser also crashed a few times). I noticed in firefox under MacOS some kind of flickering at the bottom once, indicating repeated and rapid re-submission. I could reproduce it the second time.
In reply to Evan Fink

Re: Gateway quiz crashes server

by Andras Balogh -

You don't have access to the log files on the server?

Something like /var/log/syslog or /var/log/apache2/ssl_error.log ?

In reply to Andras Balogh

Re: Gateway quiz crashes server

by Glenn Rice -
Note that /var/log/apache2/ssl_error.log is not a standard apache2 log file. This is most likely what you have set for the ErrorLog variable in your apache2 site configuration file. The default error log file is /var/log/apache2/error.log.
In reply to Evan Fink

Re: Gateway quiz crashes server

by Glenn Rice -

I finally figured out how this is happening.  You are apparently using a setting that I never use.  Namely the gateway test "Number of Graded Submissions per Test" option being set to something other than 1.  I am guessing you left this at the default value of 0 when you tried this.  In this case, the javascript auto submissions start 10 seconds before the end of the grace period, and occur repeatedly until the full grade period is over.

See https://github.com/openwebwork/webwork2/pull/1953 for the fix.