RT upgrade from 5.0.2 to 5.0.4

Hello,

i’m trying to upgrade my RT instance from 5.0.2 to 5.0.4 and I’m following your instructions to the letter. However, make upgrade-database fails systematically telling that:

[HUGE MYSQL ERROR STACK THAT I CANNOT PASTE HERE DUE TO LENGTH]
...
[155394] [Wed May 31 09:28:37 2023] [critical]: _DoSearch is not so successful as it still needs redo search, won't call _BuildAccessTable (/root/rt/rt-5.0.4/sbin/../lib/RT/Attributes.pm:84)
Couldn't finish 'upgrade' step.

ERROR: Couldn't prepare SQL query:
ALTER TABLE CustomRoles ADD COLUMN LookupType VARCHAR(255) collate NOCASE

ERROR: no such table: CustomRoles

make: *** [Makefile:394: upgrade-database] Error 255

There is no documentation regarding this, and no issues can be submitted to the github.

Here are my upgrade steps;

- Created www user and group
- Installed cpan
- curl -L -o cpanm https://cpanmin.us/
- chmod +x cpanm
- RT_FIX_DEPS_CMD=./cpanm make fixdeps
- dnf install perl-CPAN
- dnf install perl-Devel-Peek perl-open
- cpam -f Text::Balanced Alien::Base::ModuleBuild Alien::LibGumbo ... and a long list of dependencies
- make testdeps => all clean
- mysql dump for backup
- make upgrade
- make upgrade-database
- faliure

Could you please lend me a hand?

This seems very bizarre. Do you have a CustomRoles table? (Are you comfortable checking the database?)

This table has been present in RT since 4.3.12.

Hi Andrew,
Here is a list of all the tables in my DB:
MariaDB [rt5]> show tables;
±------------------------+
| Tables_in_rt5 |
±------------------------+
| ACL |
| Articles |
| Assets |
| Attachments |
| AttachmentsIndex |
| Attributes |
| AuthTokens |
| CachedGroupMembers |
| Catalogs |
| Classes |
| Configurations |
| CustomFieldValues |
| CustomFields |
| CustomRoles |
| GroupMembers |
| Groups |
| Links |
| ObjectClasses |
| ObjectCustomFieldValues |
| ObjectCustomFields |
| ObjectCustomRoles |
| ObjectScrips |
| ObjectTopics |
| Principals |
| Queues |
| ScripActions |
| ScripConditions |
| Scrips |
| Templates |
| Tickets |
| Topics |
| Transactions |
| Users |
| sessions |
±------------------------+
34 rows in set (0.000 sec)

Thanks

Add that column to the CustomRoles table is the first action in the SQL upgrade patch for 5.0.4, so that is yelling out at me that the wrong database is being used for the upgrade, or you are upgrading from a database older than 4.3.12 (hopefully unlikely!).

I don’t know how much extra information is provided (I’ve not used it), but I see that up rt-setup-database has a --debug option, but that’d be useful?

You could also check your MySQL logs, there might be a hint there