Page 1 of 1

Database corruption issues

Posted: Fri Mar 29, 2019 1:19 pm
by gwakem
Server info: Fusion 4.1.7 on RHEL 7.5
Question: Is there a quick command I can use within mariadb to reset the password field for all fused servers?
Background: All of my servers stopped allowing fusion to check in after a reboot. It appears that all passwords stored in the database have become corrupt. I manually changed one and it corrected, but here is the type of data Im looking at:

Code: Select all

[password] => �m(y�	Ca�,
There are over 200 servers fused in there so I really, really do not want to do it by hand.

Re: Database corruption issues

Posted: Fri Mar 29, 2019 1:48 pm
by ssax
Do they all use the same username/password?

If yes, you could do this:

Code: Select all

mysql -ufusion -pfusion fusion -e "update servers set password = 'YOURPASSWORD';"

Re: Database corruption issues

Posted: Mon Apr 01, 2019 8:02 am
by gwakem
Unfortunately this did not seem to fix the issue. I did have a special charicter in the password, but even escaping that left the password still did not work.

I changed the password on a single remote server, and updated the password field globally to test a plain password with no special characters, but that does not work either. I confirmed the password is being updated in the database.

As a special control I did this:
* Set password manually on a remote Nagios instance

Code: Select all

htpasswd /usr/local/nagios/etc/htpasswd.users xxxxxxxx
New password: 
Re-type new password: 
Updating password for user xxxxxxxx
* Set password globally on the fusion server

Code: Select all

mysql -ufusion -pfusion fusion -e "update servers set password = 'password';"
* Verified the database updated correctly:

Code: Select all

MariaDB [fusion]> select * from servers limit 5;
(good results for password field)
* Fusion > Admin > Manage Fused Servers > Server in question > Edit > Test Fusion Settings > FAIL

* copy password directly from SQL query output (select * from servers limit 5;) into Password field in the web interface > Test Fusion Settings > SUCCESS

Wat

Re: Database corruption issues

Posted: Mon Apr 01, 2019 8:10 am
by gwakem
I see why. Its because in the database, it's hashed. When I run the command, it puts it in plaintext. I mean, this makes sense.

I took the hash from the test case, re-ran the command with the hash as the password, and that worked. I can change the password globally on all remote systems using Anisble so that's fine.

Its working now, this can be locked.

Re: Database corruption issues

Posted: Mon Apr 01, 2019 4:39 pm
by npolovenko
@gwakem, Good catch! I will be closing this thread as resolved.