Installation

WW 2.17 on Ubuntu 22.04 server Library Browser Error

WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -
Number of replies: 24

I have a new installation stood up on Ubuntu 2.17 following the manual installation instructions. I am preparing to migrate courses from 2.14 on our old server.

When attempting to use the Library Browser from course admin or a test course, I am getting the following Maria DB error:


In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Omar Hijab -
I recall a similar error while installing WW2.17 on Ubuntu 22.04. The following solved it for me:

- sudo apt install libmariadb3 libmariadb-dev
- sudo cpanm DBD::MariaDB
In reply to Omar Hijab

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -

Thanks for the reply Omar. I just tried that and I'm on the latest version.

In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Arnold Pizer -
In reply to Arnold Pizer

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -

Hi Arnold, yes I have. There were no errors during that part of the installation.

In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Arnold Pizer -

After running those commands and checking on tables:

wwadmin@wwserver:/opt/webwork/courses$ sudo mysql

MariaDB [(none)]> use webwork;

MariaDB [webwork]> show tables;

I see:

+-------------------------------+

| Tables_in_webwork             |

+-------------------------------+

| OPL_DBchapter                 |

| OPL_DBsection                 |

| OPL_DBsubject                 |

| OPL_author                    |

etc.  What do you see?

In reply to Arnold Pizer

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -

My output is below:



+-----------------------------------------------------+

| Tables_in_webwork                                   |

+-----------------------------------------------------+

| OPL_global_statistics                               |

| OPL_local_statistics                                |

| OPL_problem_user                                    |

| Pluu_ProbStat_G1_Spring2020_achievement             |

| Pluu_ProbStat_G1_Spring2020_achievement_user        |

| Pluu_ProbStat_G1_Spring2020_global_user_achievement |

| Pluu_ProbStat_G1_Spring2020_key                     |

| Pluu_ProbStat_G1_Spring2020_password                |

| Pluu_ProbStat_G1_Spring2020_past_answer             |

| Pluu_ProbStat_G1_Spring2020_permission              |

| Pluu_ProbStat_G1_Spring2020_problem                 |

| Pluu_ProbStat_G1_Spring2020_problem_user            |

| Pluu_ProbStat_G1_Spring2020_set                     |

| Pluu_ProbStat_G1_Spring2020_set_locations           |

| Pluu_ProbStat_G1_Spring2020_set_locations_user      |

| Pluu_ProbStat_G1_Spring2020_set_user                |

| Pluu_ProbStat_G1_Spring2020_setting                 |

| Pluu_ProbStat_G1_Spring2020_user                    |

| Test123_achievement                                 |

| Test123_achievement_user                            |

| Test123_global_user_achievement                     |

| Test123_key                                         |

| Test123_password                                    |

| Test123_past_answer                                 |

| Test123_permission                                  |

| Test123_problem                                     |

| Test123_problem_user                                |

| Test123_set                                         |

| Test123_set_locations                               |

| Test123_set_locations_user                          |

| Test123_set_user                                    |

| Test123_setting                                     |

| Test123_user                                        |

| admin_achievement                                   |

| admin_achievement_user                              |

| admin_global_user_achievement                       |

| admin_key                                           |

| admin_password                                      |

| admin_past_answer                                   |

| admin_permission                                    |

| admin_problem                                       |

| admin_problem_user                                  |

| admin_set                                           |

| admin_set_locations                                 |

| admin_set_locations_user                            |

| admin_set_user                                      |

| admin_setting                                       |

| admin_user                                          |

| depths                                              |

| location_addresses                                  |

| locations                                           |

+-----------------------------------------------------+

51 rows in set (0.001 sec)

In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Arnold Pizer -
In reply to Arnold Pizer

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -
Interesting, it is acting like I am trying to upload data to the OPL..something i've not seen when running opl-update:

In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Arnold Pizer -
The OPL update script has changed. I think a separate git pull command is now necessary. Let us know if this fixed your problem.
In reply to Arnold Pizer

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -
Thanks for your quick responses arnold! I did run the separate git pull command prior and it tells me it is already up to date.


In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Arnold Pizer -
If the OPL is up to date (as reported by git remote show origin) and running OPL-update does not create the OPL_DBsubject, etc. tables, I am not at all sure what is going on.
In reply to Arnold Pizer

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -
Yeah running OPL-Update seems to be prompting me to upload data to the OPL. I have never seen that before. It asks me to submit our University info etc.
In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Danny Glin -
As of WeBWorK 2.17 you will be asked if you are willing to upload your (anonymized) usage statistics when you update the OPL. Currently to get out of this you have to abort the script, but there is a change coming in the next few days which will allow you to say no and exit gracefully.

When you run OPL-update, it should update the OPL tables in the database before it tries to upload your statistics, so even if you abort at that stage it should have already handled the library browser stuff.

You can suppress the statistics upload completely by running
SKIP_UPLOAD_OPL_statistics=1 OPL-update

If you run that command, do you get any errors?
In reply to Danny Glin

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -

Hi Danny,


No I do not get any errors when running that command. See below:


I still get the same error on the front end when trying to access the library browser, and the table mentioned in the error still does not exist.

clj@ad.uauth.net@webwork2-gc:/opt/webwork/libraries/webwork-open-problem-library$ SKIP_UPLOAD_OPL_statistics=1 OPL-update


Downloading the latest OPL release.

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


Updating Library Statistics.

Importing statistics for 4 courses.

   1   2   3   4


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).

WARNING: Forcing protocol to  TCP  due to option specification. Please explicitly state intended protocol.


Skipping upload-OPL-statistics as requested


Done.





In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Andrew Parker -
Please check the contents of bin/OPL-update.pl

Line 39:
do $ENV{WEBWORK_ROOT} . '/bin/download-OPL-metadata-release.pl';

Your output suggests that this script is not being run...

Perhaps try running bin/download-OPL-metadata-release.pl on it's own?
In reply to Andrew Parker

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -

Hi Andrew, thanks for your assistance!


line 39 of the file is as follows:

do $ENV{WEBWORK_ROOT} . '/bin/download-OPL-metadata-release.pl';

Attempting to run the cmd manually results in this error:

Error in tempdir() using /opt/webwork/webwork2/bin/FileFetch.XXXXXX: Could not create directory /opt/webwork/webwork2/bin/FileFetch.CD9T0Q: Permission denied at /usr/share/perl/5.34/File/Fetch.pm line 456.

Attempting to re-run with sudo results in:

download-OPL-metadata-release.pl: command not found

In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Arnold Pizer -

Hi,

You could use sudo with the full path to the script. 

But it appears your permissions are not set up correctly which might cause other problems. I would suggest you redo the permissions in https://webwork.maa.org/wiki/Installation_Manual_for_2.17_on_Ubuntu#Setting_Permissions

Arnie


In reply to Arnold Pizer

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -
Running the "metadata release" script and "OPL-update" script using "sudo -e" and the full path to the script resulted in some different results that now allow the library browser to work. I am now getting some errors clicking on some of the different buttons.


In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Danny Glin -

This is probably an artifact of running some of the scripts as root.

Most likely you can just delete the folder at /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/fileFetch.H1nftW.  That folder was probably created as a temporary location for downloaded files.  It's worth looking to see what's in that folder to make sure that it doesn't look like anything important.

In reply to Danny Glin

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -
There is actually not a file or folder with that name in that path. Also noticed I'm getting a similar error in the Hmwk Sets editor:

Can't opendir(/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/FileFetch.H1nftW): Permission denied
at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor.pm line 699.
In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Andrew Parker -

> resulted in some different results

Can you please share what results you received from running the `download-OPL-metadata-release`? 

In reply to Andrew Parker

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -

Sure thing!

Found OPL METADATA release v2022-05-30.

Downloaded release archive, now extracting.

Restoring OPL tables from release database dump.

OPL path seems to be /opt/webwork/libraries/webwork-open-problem-library/

WARNING: Forcing protocol to  TCP  due to option specification. Please explicitly state intended protocol.

Removing temporary files.

Done!

In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -
I also get a similar error as above if I try to run OPL-update without sudo -E to the full path:

Can't opendir(/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/FileFetch.H1nftW): Permission denied
at /opt/webwork/webwork2/bin/generate-OPL-set-def-lists.pl line 62.
In reply to Chris Jolly

Re: WW 2.17 on Ubuntu 22.04 server Library Browser Error

by Chris Jolly -
I have found a workaround that I am happy with given how seldom OPL-update is run. 

Here is the upshot:
  • The OPL-update was not running correctly unless it was being run as sudo -E.
  • Doing so created a FileFetch directory under the courses folder that could not be accessed by anyone other than root.
  • Manually resassigning ownership and setting permissions to 755 resolved my errors.
  • Since we only run the OPL-update script between semesters, I am happy to document the workaround and use it in perpetuity.

Thanks to all who chimed in, it was very helpful!