Installation

failure to export a problem set

failure to export a problem set

by Dick Lane -
Number of replies: 4
Using Export Selected Set (in Hmwk Sets Editor) succeeds on one of my servers but fails on the other with

++++ begin error message ++++
Results of last action performed: 0 sets exported, 1 set skipped.

set abc - Failed to open /opt/webwork/courses/MAA-master/templates/setabc.def at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm line 1998.
++++ end error message ++++

On each server, the command "svn update", while in /opt/webwork/webwork2, loads no files but reports
Fetching external item into 'htdocs/mathjax'
External at revision 634.
At revision 6668.

Since the failure occurs on my production server (which will have live classes next week), I am slightly concerned [only "slightly" because few users of the Library Browser seem to require saving of a DEF file]. OTOH, I would like to fix this anomalous difficulty.

Note: repeating the several chmod & chgrp commands in the Setting Permissions section of http://webwork.maa.org/wiki/New_Installation_Manual_for_2.4_on_Ubuntu_10.04 did not cure the situation.
In reply to Dick Lane

Re: failure to export a problem set

by Dick Lane -
For whatever it is worth (FWIW), I will note that
        sudo  find  /opt/webwork  -name  "*.log"  -print
did not identify plausible clues to this malfunction.

Where else could I have looked?
In reply to Dick Lane

Re: failure to export a problem set

by Michael Gage -
My first guess (and it's only a guess) is that the webserver does not have permission to write into the directory /opt/webwork/courses/MAA-master/templates/ for some reason.
In reply to Michael Gage

Re: failure to export a problem set

by Dick Lane -
Thanks, Mike --- your guess was correct.

I fixed things (I hope the fix is a cure) with the following commands copied from section 10.2 Setting Permissions of http://webwork.maa.org/wiki/New_Installation_Manual_for_2.4_on_Ubuntu_10.04

su
cd /opt/webwork/webwork2/
chgrp -R wwdata DATA ../courses htdocs/tmp logs tmp
chmod -R g+w DATA ../courses htdocs/tmp logs tmp
find DATA/ ../courses/ htdocs/tmp logs/ tmp/ -type d -a ! \( -name .svn -prune \) -exec chmod g+s {} \;
exit

+++++
Here is my guess about the cause of the difficulty.
1) after some work on another computer, I created a TGZ archive of templates and copied it to my main server
2) while logged-in as wwadmin on my main server, I expanded that archive and moved (I've forgotten whether mv, cp -R, or rsync -a was used) the template folder into the course directory.

Although the original templates had correct owner:group (on the other computer), the expanded version (using "tar -xgz") of the copy got wwadmin:wwadmin as its ownership.

+++++ Follow-up
I have subsequently invoked
sudo chown -R www-data templates

Probably not needed for a fix (because of the "chmod -R g+w ..." command), but a cure should yield a more elegant result.
In reply to Dick Lane

Re: failure to export a problem set

by Michael Gage -
+++++ Follow-up
I have subsequently invoked
sudo chown -R www-data templates

This is my practice whenever I make changes from the command line -- it saves a lot of headaches. In fact I make sure that the entire webwork/courses directory and its subdirectories are owned by the webserver. It's also one reason why I often do things from the web even though I could do them slightly quicker from the command line. It's not quicker if I forget to get the permissions right when I am done.

One other trick which can help. You can first do

sudo su www-data

so that you are acting as the webserver when you make command line changes. (su stands for switch user).

Thanks for the report.

-- Mike