Installation

Upgrading courses after update to 2.20

Upgrading courses after update to 2.20

by Wesley Burr -
Number of replies: 5

I bit the bullet and jumped from 2.15 to 2.20. Everything seems to have gone smoothly, except for the Upgrade Courses. I can create new courses, manually move Templates over, the problem library is there, etc., etc.. As far as I can tell all the AUTH stuff also works, although more testing will happen on that.

But the Upgrade Courses button runs into some kind of problem that I don't understand. 

Invalid path at /opt/webwork/webwork2/lib/WeBWorK/Utils/CourseDirectoryIntegrityCheck.pm line 77.

Context
72:         my ($target, $path) = @{ $ce->{courseLinks}{$link} };
73: 
74:         # All links should actually be links, and should have the correct target.  Note that the link target may also be
75:         # a link, and so the realpath of the configured link target and realpath of the course link path must be
76:         # compared to check that the link target is correct.
77:         my $good = -l $path && path($path)->realpath eq path($target)->realpath;
78: 
79:         $links_ok = 0 if !$good;
80:         push @results, [ $link, $target, $path, $good ];
81:     }
82: 

So something in the upgrade is running into a file path issue, but there's no indication as to what it is, or where. I've resorted to dumping most of my historic courses out of the /webwork/courses/ directory to manually try to debug it down to an example of something that fails. And I would like to be able to login to a couple of the older courses to fix some export issues, but they all fail with

  • It looks like the database is missing a column. You may need to upgrade your course tables. If this is the admin course then you will need to upgrade the admin tables using the upgrade_admin_db.pl script. at /opt/webwork/webwork2/lib/WeBWorK/DB/Database.pm line 133.

Any advice or suggestions would be welcome! 

In reply to Wesley Burr

Upgrading courses after update to 2.20

by Glenn Rice -

First check that the required system directories that the links are supposed to point to all exist.  Those are the OPL library and contrib directories, usually /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary and /opt/webwork/libraries/webwork-open-problem-library/Contrib, the OPL CAPA directory, usually /opt/webwork/libraries/webwork-open-problem-library/Contrib/CAPA, and the webwork2 student orientation directory, usually /opt/webwork/webwork2/assets/pg/Student_Orientation.

In reply to Glenn Rice

Upgrading courses after update to 2.20

by Wesley Burr -

Yes, all of these directories exist and are navigable. They're all owned by wwadmin as well.  

In reply to Wesley Burr

Upgrading courses after update to 2.20

by Glenn Rice -

What is happening is that you have courses with bad links in them.  Links that point to locations inside nonexistent directories.  As a result the realpath calls are failing.  I will put in a pull request that fixes the issue.

In the mean time the only way to fix this would be to manually delete the broken links in the templates directories of these courses.  You can find them by running "find /opt/webwork/courses -xtype l".  That will give you a list of all of the broken links in the courses directory.  Then you can delete the ones that are causing the problem.

In reply to Glenn Rice

Upgrading courses after update to 2.20

by Wesley Burr -

That's perfect, thank you! It was CAPA and Contrib: the modelCourse had a CAPA -> Library/Contrib/CAPA and a Contrib -> Library/Contrib set of symlinks that were broken and didn't exist inside Library -> /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary. Not sure if that came from the 2.20 git pull, or if it was broken residuals from years and years of running on this system. 

Once I stripped those out / created the targets, it went through to the usual interface and I was able to upgrade all of my courses from 2024-25, with the usual warnings and so on - creating the extra database fields, creating the missing subdirectories, etc. 

Thanks for your help!

In reply to Wesley Burr

Upgrading courses after update to 2.20

by Glenn Rice -

It is too late for you now perhaps, but the pull request that fixes the issue has been merged.  So if this happens again, the issue won't occur, and the links will be fixed by the upgrade process.