warewulf / warewulf3

Warewulf is a scalable systems management suite originally developed to manage large high-performance Linux clusters.
107 stars 45 forks source link

wwinit database: Access denied to wwroot #281

Closed kelbstf closed 2 years ago

kelbstf commented 3 years ago

Hello All,

It looks like the problem described in "wwinit database: Access denied to wwroot #64" (https://github.com/warewulf/warewulf3/issues/64) returned for

MariaDB logfiles keep notifying:

/var/log/mariadb/mariadb.log:2021-09-24 13:47:44 68 [Warning] Aborted connection 68 to db: \
   'unconnected' user: 'wwroot' host: 'localhost' (CLOSE_CONNECTION)

And wwinit fails like this:

wwinit DATABASE
database:     Checking to see if RPM or capability 'mysql-server' is install NO
database:     Checking to see if RPM or capability 'mariadb-server' is insta OKd 
database:     Activating Systemd unit: mariadb
database:      + /bin/systemctl -q restart mariadb.service                   OK
Enter databas Database version: 1oot user:database:
localhost
database:     Updating database permissions for base user
database:      + mysql --defaults-extra-file=/tmp/0.FyZcM7YK47w9/my.cnf ware OK
database:     Updating database permissions for root user
database:      + mysql --defaults-extra-file=/tmp/0.FyZcM7YK47w9/my.cnf ware OK
database:     Checking binstore kind
DBI connect('database=warewulf;host=localhost','wwroot',...) failed: \
   Access denied for user 'wwroot'@'localhost' (using password: YES) at \ 
  /usr/share/perl5/vendor_perl/Warewulf/DataStore/SQL/MySQL.pm line 257.
                                                                        SUCCESS
Done.

Where:

/usr/share/perl5/vendor_perl/Warewulf/DataStore/SQL/MySQL.pm
##257    $dbh = DBI->connect_cached($conn_str, $db_user, $db_pass, \%attr);

Actually this error shows up right from the beginning, with a clean installation, and did not improve, when changing the password and/or rewriting the permissions directly in mysql.

I tested for all the typical mysql authentication related errors, but everything looks as healthy as it can get. Not sure whether Warewulf has an option to raise the log level?

Does any one of you has a similar problem/can help, please?

Best regards

kelbstf commented 3 years ago

Hello, i should have added, that logging in to MariaDB on mysql CLI with the questionable user account wwroot and accessing the database warewulf perfectly works. In the meantime also tried with raising the GRANTS to ALL for that user on that db, but that did not help either...

Best regards

kelbstf commented 3 years ago

In the meantime checked the following: switched from "wwroot" to "root" in "/etc/warewulf/database-root.conf", started wwinit DATABASE and found that "mariadb.log" still is flooded with:

2021-09-24 17:28:33 92 [Warning] Access denied for user 'wwroot'@'localhost' (using password: YES)
2021-09-24 17:28:33 92 [Warning] Aborted connection 92 to db: 'unconnected' user: 'wwroot' host: 'localhost' (CLOSE_CONNECTION)

which seems to indicate that this file "database-root.conf" is not evaluated by warewulf at all?

kelbstf commented 2 years ago

Turned out that the server had to be rebooted to make the config change effective; this falls in line with the impression that this problem was cache related.