Hello Sergei.

On 24.03.24 21:25, Sergei Vyshenski wrote:
Hi Oliver,

1. An observation.

As far as I can see, docker image found at

https://hub.docker.com/r/whiterabbitsecurity/openxpki3/tags

installs libdbd-mysql-perl (and does not install libdbd-mariadb-perl) module for use with MariaDB.
Which adds to my concerns from the previous message, see below.

The Docker Image comes with both drivers

    RUN apt-get update && \
    apt-get upgrade --assume-yes && \
    apt-get install --assume-yes gpg libdbd-mariadb-perl libdbd-mysql-perl libapache2-mod-fcgid apache2 wget locales less gettext

and it does not really matter which one to use as at least on debian based systems the two libraries can coexist.

But while checking the config I found out that we seem to have a schizophrenic default configuration :( While system/database.yaml refers to "driver: MariaDB" which is, as explained below, based on DBD::mysql, the webui/default.conf also says "MariaDB" but in this place this is handed by the default CGI driver which translates this into DBD::MariaDB. But as we get both drivers from the repos they can work in parallel, so this might be somewhat confusiing on the tech level and is also not "nice" but does not have any negative issues so far.

2. Now a serious problem.

Starting with version DBD-mysql-5.004 published on March 19, 2024:

https://metacpan.org/dist/DBD-mysql/changes

this module refuses to install with MariaDB:

DBD::mysql requires MySQL 8.x for building. Version reported by mysql_config --version: 10.6.16 at ./Makefile.PL line 451, <PIPE> line 3.
*** Error code 255

(version 10.6.16, mentioned here is exactly the version of MariDB-server)

and thus explicitly requires MySQL

Thank you for bringing this to our attentation, I will check with Scott if this has any impact on our EE packaging but as we use fixed versions there and build them against the OS libs, we need to see what is possible. In the past we had the same approach here as in debian and were able to ship both DBD drivers on the same system, so I also do not see any issues here other then getting the right versions aligned.


3. Also there are reports that module DBD-mariabd crashes stable versions of perl if used with UTF-8 staff.

As already said, we saw some weired errors at some installations with native MariaDB which is the reason why we still have both drivers and still have this confusion. Some years ago, when we decided to go for MariaDB as most of the others did, the situation was likely different from today and we are continously working on getting the best solution but we also need to take care about existing installations and legacy system.


As you mentioned your plans to switch to PostgreSQL, do you think that all the above problems should be solved by abandoning of MariaDB altogether? If yes, do you have plans to change demo scripts and configs included with openxpki (community edition) such that MariaDB be expelled?

Well this is basically the situation as it is today - we have a DBD::mysql driver working with MariaDB backends, we need to evaluate if the mysql8 based client is still happy with a MariaDB 10 server, if this works we can drop the DBD::MariaDB based driver.

Oliver


Regards, Sergei
=======================================
Hi Oliver,

Thank you so much for general clarification.

Still have two questions as server openxpki refuses to start with setup recommended by Quickstart from RTD, in particular with:
- libdbd-mariadb-perl installed and
- "MariaDB2" keyword present in configuration

See error log below my original message.

Question 1.
Is it a good idea to remove libdbd-mariadb-perl and install libdbd-mysql-perl (which leads to successful start of the openxpki server)?

Question 2.
After the switch of DBD drivers from Question 1, is it a good idea to keep "MariaDB2" keyword present in configuration?

Regards, Sergei

On 14 Mar 24 Thu 12:49, Oliver Welter wrote:
Hi Sergei,

the driver name refers to the OpenXPKI Module name.

The initial driver was "MySQL" using the libdbd-mysql in the background with a feature set of "ancient" mysql 5.x

The driver named "MariaDB" is almost the same and also uses libdbd-mysql but uses native SQL sequences as introduced in MariaDB server 10.

This worked fine with the older distros shipping mysql libraries from the 5.x branch but we went into some issues with newer distros shipping mysql 7/8. So finally migrated the OpenXPKI driver module to use libdbd-mariadb in the background and named it MariaDB2.

We also made the observation that MariaDB development slowed down and the recent news on the MariaDB company is also not really promissing, but mysql is not really a better choice :( As we made good experience in some projects with Postgres, we already discussed internally to move to it as the primary rdbms but as Mysql/MariaDB is still the more common system we will keep supporting this as long as it works.

best regards

Oliver

On 13.03.24 20:01, Sergei Vyshenski wrote:
Hi,

Trying to launch democa out of the latest stable community release
OpenXPKI-3.28.2 at
Linux Debian 12.5 with
MariaDB 10.11.6

Followed steps advised by
https://openxpki.readthedocs.io/en/latest/quickstart.html
(configuration for /etc/openxpki/ fetched from openxpki/openxpki-config project)

and in particular:
$ apt install mariadb-server libdbd-mariadb-perl
...
$ openxpkictl start
It says:
Starting OpenXPKI Community Edition v3.28.2
OpenXPKI server is not running or does not accept requests.
Status check failed
(See error log attached below.)

Now I remove libdbd-mariadb-perl and install libdbd-mysql-perl instead, as server openxpki wanted.
This helps:
$ openxpkictl start
OpenXPKI Server is running and accepting requests.
DONE.

Is it reasonable to switch dbd-mariadb for dbd-mysql?
The quoted Quickstart insists (with red letters) that dbd-mariadb is a preferable choice for MariaDB2 and OpenXPKI.

What is MariaDB2 (mentioned by Quickstart) by the way? Google only finds this name inside the OpenXPKI pages.
Debian 12.5 has MariaDB 10.11.6. Is it MariaDB1 or MariaDB2?
Also name "MariaDB2" is present multiple times in the configuration of openxpki/openxpki-config.
Is it safe to leave it there?

NB.
When project DBD-MariaDB was founded they claimed (see here: https://github.com/perl5-dbi/DBD-MariaDB) that it will be better than the project DBD-mysql, because "This Perl DBI driver is a fork of the DBD::mysql <https://metacpan.org/pod/DBD::mysql> driver and was created because said issues in the original DBD::mysql have not been addressed for more than a year." But today the project DBD-mysql evolves more rapidly than the project DBD-MariaDB:
https://metacpan.org/dist/DBD-mysql/changes

Regards, Sergei
======================
$> cat /var/log/openxpki.log (with the driver DBD-MariaDB installed)
2024/03/12 14:18:27 ERROR Database not connected; __error__ => install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at (eval 974) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/share/perl5/DBIx/Handler.pm line 41.
 [pid=4925|]
2024/03/12 14:18:27 FATAL Error during initialization task 'dbi': Database not connected [pid=4925|] 2024/03/12 14:18:27 FATAL Exception during server initialization: Database not connected; __error__ => install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at (eval 974) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/share/perl5/DBIx/Handler.pm line 41.
 (Database not connected; __error__ => install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at (eval 974) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, MariaDB, Mem, Proxy, Sponge.
 at /usr/share/perl5/DBIx/Handler.pm line 41.
) [pid=4925|]
======================


_______________________________________________
OpenXPKI-users mailing list
OpenXPKI-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openxpki-users





_______________________________________________
OpenXPKI-users mailing list
OpenXPKI-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openxpki-users

--
Protect your environment -  close windows and adopt a penguin!



_______________________________________________
OpenXPKI-users mailing list
OpenXPKI-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openxpki-users

Reply via email to