Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deploy): add missing plugin files for mysql-client library in mysql-setup #7909

Merged

Conversation

AndrewZures
Copy link
Contributor

@AndrewZures AndrewZures commented Apr 26, 2023

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

Bug Description 🐛

This PR fixes a bug found when running the datahub-mysql-setup job within a kubernetes cluster that connects to a MySQL 8 database instance. It appears the current mysql-setup script uses the mysql-client alpine package that does not include files necessary to support the MySQL caching_sha2_password plugin. An additional package is required to get the setup script to work.

How to Reproduce

  1. I am running a MySQL 8.0.32 instance in Azure with the caching_sha2_password plugin active (which occurs by default).
mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.32    |
+-----------+
1 row in set (0.04 sec)
mysql> SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'caching_sha2_password';
+-----------------------+----------------+---------------+----------------+---------------------+----------------+------------------------+--------------------+-----------------------------+----------------+-------------+
| PLUGIN_NAME           | PLUGIN_VERSION | PLUGIN_STATUS | PLUGIN_TYPE    | PLUGIN_TYPE_VERSION | PLUGIN_LIBRARY | PLUGIN_LIBRARY_VERSION | PLUGIN_AUTHOR      | PLUGIN_DESCRIPTION          | PLUGIN_LICENSE | LOAD_OPTION |
+-----------------------+----------------+---------------+----------------+---------------------+----------------+------------------------+--------------------+-----------------------------+----------------+-------------+
| caching_sha2_password | 1.0            | ACTIVE        | AUTHENTICATION | 2.1                 | NULL           | NULL                   | Oracle Corporation | Caching sha2 authentication | GPL            | FORCE       |
+-----------------------+----------------+---------------+----------------+---------------------+----------------+------------------------+--------------------+-----------------------------+----------------+-------------+
1 row in set (0.04 sec)
  1. I configured my Kube cluster to connect to my MySQL instance instead of using the default Bitnami chart.

  2. When running helm upgrade datahub datahub/datahub --values values.yaml the datahub-mysql-setup job fails on each run with the following error: 🐛

ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: Error loading shared library /usr/lib/mariadb/plugin/caching_sha2_password.so: No such file or directory
2023/04/25 23:09:18 Command exited with error: exit status 1

The Core Issue 💡

The MariaDB reference is notable as we are connecting to a MySQL instance. I believe this indicates that the mysql client used to execute the SQL DDL cannot find the proper plugin files in its local installation. Upon further investigation, it appears the mysql-client package used in the mysql-setup script is a mariadb client and likely the source of the problem.

I confirmed this client is the source of the error by rebuilding the mysql-setup docker image using its Dockerfile and attempting to manually connect to the same database. And I received the same error.

A Potential Solution 😃

Based on this thread this error has been seen before and the simple solution is to add the mariadb-connector-c package. I added the package in my local container and I was able to connect to the database without error.

Considerations 🤔

  • I would love feedback on my approach and I'm very open to alternative ideas! 🎉
  • Apologies if I've missed anything in the PR. This is my first contribution to DataHub!

@github-actions github-actions bot added the devops PR or Issue related to DataHub backend & deployment label Apr 26, 2023
@AndrewZures AndrewZures marked this pull request as ready for review April 26, 2023 18:59
@david-leifker david-leifker self-assigned this Apr 28, 2023
@david-leifker
Copy link
Collaborator

LGTM! Thank you!

@david-leifker david-leifker merged commit 39ddab8 into datahub-project:master Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops PR or Issue related to DataHub backend & deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants