Help in completing lab 18 from linux level 2 (mariadb troubleshooting)

Hi

I was trying this lab, I was not be able to figure out how to start again the mariadb server. This is the warnings and errors from the mariadb log file:

2023-08-25 15:58:34 0 [ERROR] mysqld: Server GSSAPI error (major 851968, minor 2529639093) : gss_acquire_cred failed -Unspecified GSS failure. Minor code may provide more information. Keytab FILE:/etc/krb5.keytab is nonexistent or empty.
2023-08-25 15:58:34 0 [ERROR] Plugin ‘gssapi’ init function returned error.
2023-08-25 15:58:37 0 [Warning] mysqld: GSSAPI plugin : default principal ‘mariadb/stdb01.stratos.xfusioncorp.com@’ not found in keytab
2023-08-25 15:58:37 0 [ERROR] mysqld: Server GSSAPI error (major 851968, minor 2529639093) : gss_acquire_cred failed -Unspecified GSS failure. Minor code may provide more information. Keytab FILE:/etc/krb5.keytab is nonexistent or empty.
2023-08-25 15:58:37 0 [ERROR] Plugin ‘gssapi’ init function returned error.

I’m not quite sure how to do it, I tried many things. I think this is a kerberos issue with mariadb, so I tried to setup the kerberos configuration but none of the commands which I found from the redhat forums works. I tried to create the keytab but with no sucess, the only thing that I never tried is put the keytab directly to the /etc/krb5.keytab with vi, because I think this is not a correct way or solution to solve this. Also I tried to disable the GSSAPI with no success. I looked in all the files from the mariadb configs, and comment the only invocation to GSSAPI. This and trying to use other api in mariadb to replace the GSSAPI didn’t works , because the GSSAPI still persists when I used sudo systemctl start mariadb. I don’t know how to approach this problem now.

So any help will be appreciated !

Best Regards

Hi @carlos140

I’m not sure what you did to have this error :slight_smile: To fix this ticket

  • Try to start MariaDB
  • Check the status to see the error message
  • Search how to fix this error

TIP : you have to clean mysql folder and run mysql_install_db

Good luck

In my case in this task error was with absence of /var/lib/mysql
So, I just do:

sudo mkdir /var/lib/mysql
sudo chown mysql:mysql /var/lib/mysql
sudo systemctl start mariadb.service

In other cases mariadb may need to be updated, so try to do it.

1 Like

Hi

Many thanks both for the answers. I was able to solve the lab finally. But first I want to show you that the GSSAPI error is in the logs file, when you boot the lab container:

In my case the folder /var/lib/mysql was also in my lab, so I didn’t have to make sudo mkdir /var/lib/mysql , but the ownership was wrong, so I change the ownership with chown, as you suggested.

After that mariadb doesn’t work, because there is also a dependency hell going on, so you need to update the system with sudo yum upgrade -y. After that you can start mariadb with systemctl.

@bhard bhard how do you figure out that there was an owner issue ? How do you apporach this lab to found the issue ? Let me know if you can. I found amazing that you figure out this, without the logs notify you explicity.

Hi @carlos140

  • Try to start mariadb : you will see that it’s failed

  • run journalctl -xe : go through all the log you’ll see somewhere that mariadb can’t initialize /var/lib/mysql

  • Check if this folder exists if not, create it and assign it to mysql:mysql

  • if the folder already exists check the owner if it’s mysql

  • if all previous is already ok remove the content of the folder and reinitialize mariadb : mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql then start it

Hi @carlos140!
I remember that in my lab I can figure out the problem from mariadb start logs.
So I just look in my notes for this lab and assume that you have similar problem.
Well, plus some skill in troubleshooting from current work :wink:

@bhard I see. Thanks for the help! It seems you have very good troubleshooting skills based from your work experience.

@mmkmou I will check that in the weekend, I will let you know. Thanks for the advice. It makes sense to me now.