AlmaLinux 9 + RT 5.0.5 + MariaDB - rt_user not created in database

server host OS: AlmaLinux 9 (RHEL 9 like)
DB: MariaDB 10 (on remote server)
perl: /opt/perl5/perls/perl-5.32.1/bin/perl (managed by perlbrew)

I’m attempting to install RT5.0.5 on a newly imaged AlmaLinux 9 (similar to RHEL 9) host. I’m using a successful config from my CentOS Stream 8 host but there seems to be a conflict in the database modules.

We’re using a centralized database server running MariaDB, so the database is not hosted on the RT server.

config line:
./configure --with-web-handler=standalone --with-web-user=apache --with-web-group=apache --enable-gd --enable-graphviz --enable-gpg --with-db-type=mysql --with-rt-group=rt --with-web-handler=fastcgi

I note that --with-db-type=mariadb is not a valid option. I’ve tried, just in case.

If I install the mariadb and mariadb-devel RPMs then ‘make fixdeps’ fails to install DBD::mysql because mysql_config reports version 10.x and it wants mysql version 8. I’ve found a work around for this by installing mariadb & mysql-devel RPMs before running ‘make fixdeps’, then
‘sudo dnf -y erase mysql-devel ; sudo dnf install -y mariadb-devel mysql-libs’
and it seems to work in that ‘make testdeps’ exits happily … except when I run ‘sudo make initialize-database’ it fails to create the rt_user user, so everything after the initial DB create fails:

I note that without mysql-libs “make testdeps” does not exit happily.

(I should mention I have to edit sbin/rt-setup-database script in the source directory to remove a duplicate “‘package=s’,” from the GetOptions() block but no other changes are made)

; please make initialize-database
[sudo] password for lvd:
/opt/perl5/perls/perl-5.32.1/bin/perl -I/opt/rt5/local/lib -I/opt/rt5/lib sbin/rt-setup-database --action init --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your mysql instance on [redacted] (port ‘3306’) as root
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Working with:
Type: mysql
Host: [redacted]
Port: 3306
Name: rt5
User: rt_user
DBA: root
Now creating a mysql database rt5 for RT.
Done.
Now populating database schema.
Done.
Now inserting database ACLs.
Done.
[411686] [Thu Dec 14 16:30:27 2023] [warning]: DBI connect(‘dbname=rt5;host=[redacted];port=3306’,‘rt_user’,…) failed: Access denied for user ‘rt_user’@‘[redacted]’ (using password: YES) at /opt/perl5/perls/perl-5.32.1/lib/site_perl/5.32.1/DBIx/SearchBuilder/Handle.pm line 117. (/opt/perl5/perls/perl-5.32.1/lib/5.32.1/Carp.pm:293)
[411686] [Thu Dec 14 16:30:27 2023] [critical]: Connect Failed Access denied for user ‘rt_user’@‘[redacted]’ (using password: YES)
at /scratch/lvd/rt-5.0.5/sbin/…/lib/RT.pm line 222. (/scratch/lvd/rt-5.0.5/sbin/…/lib/RT.pm:409)
Connect Failed Access denied for user ‘rt_user’@‘[redacted]’ (using password: YES)
at /scratch/lvd/rt-5.0.5/sbin/…/lib/RT.pm line 222.

I don’t think I’m missing a user create step here, am I? I’ve re-read the documentation and tried so many things I’ve completely lost track but I really think rt-setup-database should be creating the rt_user user in mariadb. The DBA ‘root’@‘[the host I’m trying to install RT on]’ has full privs with grant option.

What am I missing?

thanks,
nomad

Hey,

Given you’re using a remote database server I’d check that the user was created with the correct hostname/IP to connect from. Check with: SHOW PRIVILEGES;

Cheers,
Andrew

The user isn’t created at all. There are no changes to the user table after running make initialize-database.

nomad

Hey,

That matches what I was expecting. Create the account first. :slight_smile:

My interpretation of the documentation(mainly the README that is distributed with the source) is that the initialize script should be creating the account. This is based on the documentation not in any way mentioning the need to create one nor giving any information on what permissions the account needs. The script asks for the name and password for the DBA (in this case, root), implying it should (be able to) create the account along with the database.

So, when you say ‘create the account’ would you please expand? I’m not a database person. What’s the create command I need to issue?

Hey, yeah, agreed, the docs are a bit confusing there.

You need to run the following from a mysql client prompt. Something like this should give you run: mysql -h $db_server -u root -p and then enter:

GRANT ALL PRIVILEGES ON rt5.* TO rt_user@$rt_server IDENTIFIED BY ‘$db_rt_user_password’;

You need to replace $db_server, $rt_server, $db_rt_user_password with your details. $rt_server will most likely be the IP address (IPv4 or IPv6 as relevant, or maybe twice if you have both).

Cheers,
Andrew

Thanks. I’ll give this a try on Tuesday.

thanks, that seems to have solved it.