ElvishArtisan / rivendell

A full-featured radio automation system targeted for use in professional broadcast and media environments
197 stars 63 forks source link

Rivendell can't connect to database during installation #968

Closed xotakfr closed 1 month ago

xotakfr commented 1 month ago

Hi, it's me again with my installation issues. Coming next is installation of Rivendell package. Here's part of logs :

Setting up rivendell (4.2.2-2) ...
rddbmgr: unable to open database [Access denied for user 'rduser'@'localhost' (using password: YES) QMYSQL: Unable to connect]
Created symlink /etc/systemd/system/multi-user.target.wants/rivendell.service → /usr/lib/systemd/system/rivendell.service.
Synchronizing state of apache2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable apache2

Line 2 of logs, unable to connect.

I also wanted to know if there's cli tools to test connection to Rivendell server from a client perspective, since I don't really want to setup a GUI within my container to test. Have a good day.

Edit : Once I'm done doing the setup, I will add my process to the wiki, for a server-side installation. If I really can't figure that out, I'll try from a Ubuntu VM, have a noble ISO laying around

Edit 2 : After bunch of looking around, seems like the tables are populated (at least the Users one)

ElvishArtisan commented 1 month ago

Hmm. I'm wondering if this isn't due to differences between debootstrap and the manual installer. Can you give us the step-by-step procedure you're using? That way I can try it here.

xotakfr commented 1 month ago

First you have to use SystemD as init process, it isn't supported on other init. The container is run using systemd-nspawn command

The following commands are to be run as root.

I created a directory called rivendell-server-noble in /var/lib/machines. If you aren't creating it, debootstrap will do

Then, as I am running from a Gentoo system, I had to install debootstrap and ubuntu archive keys but you shouldn't have problems with that if you are using Ubuntu

To create the root of the container, I used the following command : debootstrap --include=systemd-container,dbus-broker --component=main,universe noble rivendell-server-noble.

After the process is done, you can access to the container using systemd-nspawn -D rivendell-server-noble which will launch a shell in the container. It will only serve to set the root password (using passwd)

Then, I will use machinectl as it allows more options on how to start the container.

The main difference with a Docker container is that you can boot it with SystemD as PID 1.

To do that, I use machinectl start rivendell-server-noble. It will launch in background.

To attach, I did machinectl login rivendell-server-noble, which will prompt for a username and password like a regular Linux tty.

There, I had to enable systemd-networkd.service to get access to the Internet, else it won't work. Then, I installed wget with apt, created an user called rd with proper group.

Finally, I followed the instructions from the appliance installation guide, namely getting the installation script and executing it. On installation type, I choose server installation (n°2).

Hope it helps. If it you need more help, don't hesitate.

ElvishArtisan commented 1 month ago

Ah, Gentoo. You're way over my head here.

However, about the database connection failure: it's completely normal to see that during the initial rivendell package installation. There's a "chicken-and-egg" problem here: the package's post-installation script tries to check the schema of the database (and update it if necessary), but we cannot create a Rivendell database until after the package is installed. That works great during package upgrades, but it means that we have to treat the initial connection failure as a "soft error" during the initial installation.

xotakfr commented 1 month ago

Yeah that's what I thought because I access the Rivendell database by connecting to mariadb directly and even list the contents of Users table. And normally you should be able to run the container anywhere provided the required tool installed. Meanwhile, I'd need some help migrating a Rivendell server, as I am currently helping some indie radio to get back on software side at least, since they're still running CentOS 7. Thanks for your time, I'll probably seek some help on the mailing list if i can figure out how it works!