WeBWorK Main Forum

Webwork errors when submitting a problem

Webwork errors when submitting a problem

by Lars Jensen -
Number of replies: 5
We're getting the following error when clicking the submit button. I first thought it had to do with a wrong symbolic link, but haven't been able to find one... Any ideas what might cause this? It looks like webwork is trying to create the log directory in the wrong spot...

We're running the latest CVS as of a few days ago.

Thanks,
Lars.

Warning messages

  • Failed to create directory /opt/webwork/webwork2/opt/ with start directory /opt/webwork/webwork2 at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 282.
  • Failed to create directory /opt/webwork/webwork2/opt/webwork/ with start directory /opt/webwork/webwork2 at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 282.
  • Failed to create directory /opt/webwork/webwork2/opt/webwork/courses/ with start directory /opt/webwork/webwork2 at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 282.
  • Failed to create directory /opt/webwork/webwork2/opt/webwork/courses/testinglj/ with start directory /opt/webwork/webwork2 at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 282.
  • Failed to create directory /opt/webwork/webwork2/opt/webwork/courses/testinglj/logs/ with start directory /opt/webwork/webwork2 at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 282.

In reply to Lars Jensen

Re: Webwork errors when submitting a problem

by Michael Gage -
Argh :-) -- this is bug #1133. Make this modification to your global.conf file where it defines the location of the transaction log.
 # The transaction log contains data from each recorded answer submission. This
# is useful if the database becomes corrupted.
# I changed this to log to the system logs directory to work around a
# bug in surePathToTempFile.
$webworkFiles{logs}{transaction} = "$webworkDirs{logs}/$courseName.transaction.log";
I've placed this hack in the CVS version of global.conf.dist for now until someone has time to make a permanent fix. (Read the notes in bug #1133 before jumping into the fix -- there are some delicate spots. )
In reply to Michael Gage

Re: Webwork errors when submitting a problem

by Lars Jensen -
Hi Mike,

Thanks! -This worked, but only after commenting out the line:

$courseDirs{logs}        = "$courseDirs{root}/logs";

I assume this is needed too.

Lars.
In reply to Michael Gage

Re: Webwork errors when submitting a problem

by Lars Jensen -
Hi Mike,

After I made the changes above, I now get the errors below.

Immediately after login:

Warning messages

  • failed to open /login.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 688.
  • failed to open /login.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 688.

After a submission of an an answer:

Warning messages

  • failed to open /transaction.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 671.
Lars.

In reply to Lars Jensen

Re: Webwork errors when submitting a problem

by Michael Gage -
I don't think you wanted to comment out the definition of the course log directory. That causes the path to the login.log to
be right under the root directory when it should be under the course directory.

WeBWorK now also thinks the transaction.log has a complete path of /transaction.log right under the root directory, which is clearly not what you want.

You want the transaction.log to be in

....webwork2/logs/transaction.log

$webworkDirs{log} should give you webwork2/logs if you
trace it through in global.conf. At the moment it seems to be undefined in your case. Perhaps there is a semi-colon out of place in the global.conf file?

Hope this helps.

Take care,

Mike
In reply to Michael Gage

Re: Webwork errors when submitting a problem

by Lars Jensen -
Hi Mike,

Sorry - I edited the wrong area of my global.conf. Instead of editing the "Logs" section, I edited the transactions logs section of the "Defaults for course-specific locations" area. Everything us OK now. Thanks for your help.

Lars.