RT 4.4.2 -> 5.0.0 database upgrade error (Postgres)

Looks like there’s a glitch in rt-setup-database when it tries to process ACLs: the upgrade fails when applying the 4.5.1 ACLs:

Processing 4.5.0
Now populating database schema.
Processing 4.5.1
Now populating database schema.
Now inserting database ACLs.
[14600] [Tue Aug 25 02:42:45 2020] [warning]: do "etc/upgrade/4.5.1/acl.Pg" failed, '.' is no longer in @INC; did you mean do "./etc/upgrade/4.5.1/acl.Pg"? at /opt/rt5/sbin/../lib/RT/Handle.pm line 467. (/opt/rt5/sbin/../lib/RT/Handle.pm:467)
Couldn't finish 'upgrade' step.

ERROR: Couldn't load ACLs: 

This happens with the Postgres (Pg) database backend, we’re running Postgres 11 in our environment.

As implied by the error message adding . to @INC in rt-setup-database solves the problem - the upgrades all process cleanly after that.

(I’m sure there’s a more elegant solution if I took 15 minutes to look at the code but I’m betting the Best Practical team knows where to look better than me and can fix it in 5 minutes or less.)

Just had the same issue. Worked around with
PERL_USE_UNSAFE_INC=1 make upgrade-database

1 Like

This is not the problem of RT itself but the underlaying operating system and Perl inside. You will have the same problem with older plugins installations. Can be solved either by setting the suggested variable or by extending Perl lib path:

export PERL5LIB=.:$PERL5LIB

It is likely unsafe but if you know what you are doing, it should be OK.