OPL Maintenance

Running OPL-update gives permission denied error

Running OPL-update gives permission denied error

by Harshal Patel -
Number of replies: 9

Hello,

I'm new to Webwork and I'm in the process of installing Webwork 2.17 on a RHEL8 distribution. I cloned the OPL repository, when I try to run the OPL-update command (or /opt/webwork/webwork2/bin/OPL-update) as wwadmin user, it shows the following error:

Downloading the latest OPL release.
Execution of /opt/webwork/webwork2/bin/download-OPL-metadata-release.pl failed:
Error in tempdir() using /opt/webwork/webwork2/bin/FileFetch.XXXXXX: Could not create directory /opt/webwork/webwork2/bin/FileFetch.Igl0eE: Permission denied at /usr/share/perl5/vendor_perl/File/Fetch.pm line 459.

"/opt/webwork/libraries" folder is owned by wwadmin user and group. Within the libraries folder, "webwork-open-problem-library" folder is owned by root user and group. Here's what I have tried so far:

  • Tried changing owner of libraries folder from wwadmin to root and tried running OPL-update as root user. It does not start the installation.
  • Tried changing owner of "webwork-open-problem-library" folder from root to wwadmin and tried running OPL-update as wwadmin user. It still shows me the same error.

Please let me know how can I fix this issue.

Thank you!


In reply to Harshal Patel

Re: Running OPL-update gives permission denied error

by Glenn Rice -

The folder that you are getting the error from is the /opt/webwork/webwork2/bin folder.  Check that your user has write permissions for that folder.

In reply to Glenn Rice

Re: Running OPL-update gives permission denied error

by Harshal Patel -
Hi Glenn,

Thank you for the tip. I allowed wwadmin user to have write permissions to the bin folder (and everything beneath). Now when I ran the OPL-update command again, I received a different error:

Downloading the latest OPL release.
Found OPL METADATA release v2023-04-30.
Downloaded release archive, now extracting.
/bin/tar: webwork-open-problem-library/JSON-SAVED: Cannot utime: Operation not permitted
/bin/tar: webwork-open-problem-library/JSON-SAVED: Cannot change mode to rwxr-sr-x: Operation not permitted
/bin/tar: webwork-open-problem-library/TABLE-DUMP: Cannot utime: Operation not permitted
/bin/tar: webwork-open-problem-library/TABLE-DUMP: Cannot change mode to rwxr-sr-x: Operation not permitted
/bin/tar: webwork-open-problem-library: Cannot utime: Operation not permitted
/bin/tar: webwork-open-problem-library: Cannot change mode to rwxr-sr-x: Operation not permitted
/bin/tar: Exiting with failure status due to previous errors
Execution of /opt/webwork/webwork2/bin/download-OPL-metadata-release.pl failed:
There was an error extracting the release:  at /opt/webwork/webwork2/bin/download-OPL-metadata-release.pl line 58.
What other permissions am I missing here?

Also, when I go to the Library Browser from the webwork website site, it shows the following error message:
DBD::mysql::st execute failed: Table 'webwork-test.opl_dbsubject' doesn't exist at /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 353.

Appreciate your assistance, thank you.
In reply to Glenn Rice

Re: Running OPL-update gives permission denied error

by Harshal Patel -
Hi Glenn,

I am getting this error message again. wwadmin user has write permissions to the folder. Attaching the screenshot. Does the group need to be wwadmin as well?

Thank you!
Attachment Bin folder permissions.png
In reply to Harshal Patel

Re: Running OPL-update gives permission denied error

by Glenn Rice -

You need to have write permissions for the directory that you run the script from. So just change the directory you are in to one that you have write permissions for.

In reply to Glenn Rice

Re: Running OPL-update gives permission denied error

by Harshal Patel -
Hi Glenn,

I tried running the OPL-update script from the directory I have full permissions. Still shows the same error and I followed the exact steps at https://webwork.maa.org/wiki/Installation_Manual_for_2.17_on_Oracle_(and_related)_Linux

I reinstalled the entire webwork directory but still getting the same error. I'm not sure what's causing the error at this point.
In reply to Harshal Patel

Re: Running OPL-update gives permission denied error

by Glenn Rice -

Which of the errors above are you getting exactly?

If you are getting

Execution of /opt/webwork/webwork2/bin/download-OPL-metadata-release.pl failed:
Error in tempdir() using /opt/webwork/webwork2/bin/FileFetch.XXXXXX: Could not create directory /opt/webwork/webwork2/bin/FileFetch.Igl0eE: Permission denied at /usr/share/perl5/vendor_perl/File/Fetch.pm line 459.
then it is because you don't have permissions for the directory you are in.

If you are getting the other error you posted, it is because you don't have the correct permissions for the webwork-open-problem-library directory.

In reply to Glenn Rice

Re: Running OPL-update gives permission denied error

by Harshal Patel -
Thanks Glenn,

I made some permission changes, now when I run OPL-update command, it seems to run successfully but with one error (sh: /usr/bin/mysql: No such file or directory) highlighted below:
Downloading the latest OPL release.
Found OPL METADATA release v2023-04-30.
Downloaded release archive, now extracting.
Switching OPL clone in /opt/webwork/libraries/webwork-open-problem-library/ to new branch of release tag v2023-04-30.
Switched to a new branch 'v2023-04-30'
Restoring OPL tables from release database dump.
OPL path seems to be /opt/webwork/libraries/webwork-open-problem-library/
sh: /usr/bin/mysql: No such file or directory
Removing temporary files. Done! Using WeBWorK root: /opt/webwork/webwork2 Using PG root: /opt/webwork/pg Using library root: /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary Using contrib root: /opt/webwork/libraries/webwork-open-problem-library/Contrib Saved OPL set definition list to /opt/webwork/webwork2/htdocs/DATA/library-set-defs.json. Saved Contrib set definition list to /opt/webwork/webwork2/htdocs/DATA/contrib-set-defs.json. Updating Library Statistics. Importing statistics for 1 courses. 1 You may want to run load-OPL-global-statistics.pl to update the global statistics data. If this is being run by OPL-update, that will be done automatically. Loading global statistics (if possible).
sh: /usr/bin/mysql: No such file or directory
Skipping upload-OPL-statistics as requested
Done.
When I go to the Library Browser in my course, it gives me the following error:
DBD::MariaDB::st execute failed: Table 'webwork.opl_dbsubject' doesn't exist at /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 353.

I'm using mariaDB driver and have not installed mySQL server because I'm connecting webwork with an external mySQL server, I made the changes in site.conf file to reflect that location.


In reply to Harshal Patel

Re: Running OPL-update gives permission denied error

by Glenn Rice -

You will need to install the mariadb or mysql client on your server.  If your remote database is mariadb, then install the mariadb client.  If your remote database is mysql, then install the mysql client.  The client package will provide the missing executable, and give you access to your remote database if configured correctly in site.conf.

If your remote database is mariadb and you install the mariadb client, then you may need to make a link from `/usr/bin/mariadb` to `/usr/bin/mysql` if your distribution package does not provide that link.  On Ubuntu that link is provided.

In reply to Glenn Rice

Re: Running OPL-update gives permission denied error

by Harshal Patel -
Thank you Glenn, installing the mariadb client worked. I did not have to make a link to '/usr/bin/mysql.'