WeBWorK Main Forum

Error when attempting to archive a course

Error when attempting to archive a course

by Tim Alderson -
Number of replies: 3

WW 2.17 on Ubuntu 20.04

When attempting to archive a particular course, the first page (Report on database structure/Directory structure) shows all checks are passed (all green), then when I click "archive" the following error occurs:

attempting to archive:

An error occured while archiving the course Math1503_Fall_2022:
Failed to archive course directory '/opt/webwork/courses/Math1503_Fall_2022' with command '2>&1 /bin/tar -C /opt/webwork/courses/Math1503_Fall_2022/.. -czf /opt/webwork/courses/221dc010-9cff-11ec-84ad-c85e7b1c8c9f_Math1503_Fall_2022.tar.gz Math1503_Fall_2022' (exit=2 signal=0 core=0): /bin/tar: Math1503_Fall_2022/templates/linear_algebra: Cannot open: Permission denied /bin/tar: Exiting with failure status due to previous errors at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm line 2339.


On a second run-through the Report on database structure/Directory structure now reports:

html_temp => /var/www/html/wwtmp/Math1503_Fall_2022 missing


Five other courses from the same term archived fine, only this one experiences the issue.

I found a post from 2015 regarding permissions, but not sure if the approach recommended back then would still be advised.

Any help appreciated.




In reply to Tim Alderson

Re: Error when attempting to archive a course

by Glenn Rice -

Based on the specific error that you posted check the permissions of /opt/webwork/courses/Math1503_Fall_2022/templates/linear_algebra.  Use "ls -l /opt/webwork/courses/Math1503_Fall_2022/templates/" and check that its owner and group are that of your server, and that it has read permission.  The permission should be something like drwxr-xr-x if it is a directory, -rw-r--r-- if it is a regular file, and lrwxrwxrwx if it is a symbolic link.  The are possible variants depending on the owner and group settings that would work.  Just compare the permission for the linear_algebra file, directory, or link to the other files in templates.

You can probably fix permissions for all files in that course by running "sudo chown -R www-data:www-data /opt/webwork/courses/Math1503_Fall_2022" and "sudo chmod -R ug+w /opt/webwork/courses/Math1503_Fall_2022".  This assumes that your server user is www-data.

Another possibility is that a course archive for that course already exists, and the permissions on the file are such that the server can not overwrite it.  Check the contents of /opt/webwork/courses for a file by the name of Math1503_Fall_2022.tar.gz, and check its permissions and ownership.

Note that when a course is archived the html temporary directory is deleted.  Then the next time you try to archive it, you get that the directory is missing.  That has been that way for a long time (but will no longer be that way for WW 2.18).


In reply to Glenn Rice

Re: Error when attempting to archive a course

by Tim Alderson -
Thank you Glenn for the clear and detailed reply. I will try what you suggest.
In reply to Glenn Rice

Re: Error when attempting to archive a course

by Tim Alderson -

Thanks again Glenn, changing permissions for the course directory did the trick.