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 SSL errors on the container Fedora cases. #1290

Merged
merged 1 commit into from
Dec 17, 2022

Conversation

junaruga
Copy link
Contributor

This PR fixes #1289 . Could you review this PR? Note I wrote the context in the commit message. Thanks.


This commit fixes the SSL related failures in the CI container Fedora cases.

The MariaDB 10.5.18 mysqld failed to start in the CI, container "fedora:rawhide" (Fedora 38) and "fedora:latest" (Fedora 37) cases with the SSL error below. So, we set the SSL configurations manually as well as MacOSX case.

 + /usr/libexec/mysqld --user=root --log-error=/build/mysql.log --ssl
2022-12-16 17:49:58 0 [Note] /usr/libexec/mysqld (mysqld 10.5.18-MariaDB) starting as process 724 ...
+ cat /build/mysql.log
2022-12-16 17:49:58 0 [Note] InnoDB: Uses event mutexes
2022-12-16 17:49:58 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2022-12-16 17:49:58 0 [Note] InnoDB: Number of pools: 1
2022-12-16 17:49:58 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-12-16 17:49:58 0 [Note] mysqld: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2022-12-16 17:49:58 0 [Note] InnoDB: Using Linux native AIO
2022-12-16 17:49:58 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-12-16 17:49:58 0 [Note] InnoDB: Completed initialization of buffer pool
2022-12-16 17:49:58 0 [Note] InnoDB: 128 rollback segments are active.
2022-12-16 17:49:58 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-12-16 17:49:58 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-12-16 17:49:58 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-12-16 17:49:58 0 [Note] InnoDB: 10.5.18 started; log sequence number 45079; transaction id 20
2022-12-16 17:49:58 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-12-16 17:49:58 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-12-16 17:49:58 0 [Note] InnoDB: Buffer pool(s) load completed at 221216 17:49:58
SSL error: Private key does not match the certificate public key
Error: -16 17:49:58 0 [ERROR] Failed to setup SSL
Error: -16 17:49:58 0 [ERROR] SSL error: Private key does not match the certificate public key
Error: -16 17:49:58 0 [ERROR] Aborting

After fixing the issue, we also saw the following failing tests with the error below. So, we recreated the db user.

expected no Exception, got #<Mysql2::Error: Access denied for user 'root'@'localhost'> with backtrace:

Note this issue didn't happened on the container CentOS case. But as we applied the fix to all the container cases to simplify the logic.

This commit fixes the SSL related failures in the CI container Fedora cases.

The MariaDB 10.5.18 mysqld failed to start in the CI, container "fedora:rawhide" (Fedora 38)
and "fedora:latest" (Fedora 37) cases with the SSL error below.
So, we set the SSL configurations manually as well as MacOSX case.

```
 + /usr/libexec/mysqld --user=root --log-error=/build/mysql.log --ssl
2022-12-16 17:49:58 0 [Note] /usr/libexec/mysqld (mysqld 10.5.18-MariaDB) starting as process 724 ...
+ cat /build/mysql.log
2022-12-16 17:49:58 0 [Note] InnoDB: Uses event mutexes
2022-12-16 17:49:58 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2022-12-16 17:49:58 0 [Note] InnoDB: Number of pools: 1
2022-12-16 17:49:58 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-12-16 17:49:58 0 [Note] mysqld: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2022-12-16 17:49:58 0 [Note] InnoDB: Using Linux native AIO
2022-12-16 17:49:58 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-12-16 17:49:58 0 [Note] InnoDB: Completed initialization of buffer pool
2022-12-16 17:49:58 0 [Note] InnoDB: 128 rollback segments are active.
2022-12-16 17:49:58 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-12-16 17:49:58 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-12-16 17:49:58 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-12-16 17:49:58 0 [Note] InnoDB: 10.5.18 started; log sequence number 45079; transaction id 20
2022-12-16 17:49:58 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-12-16 17:49:58 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-12-16 17:49:58 0 [Note] InnoDB: Buffer pool(s) load completed at 221216 17:49:58
SSL error: Private key does not match the certificate public key
Error: -16 17:49:58 0 [ERROR] Failed to setup SSL
Error: -16 17:49:58 0 [ERROR] SSL error: Private key does not match the certificate public key
Error: -16 17:49:58 0 [ERROR] Aborting
```

After fixing the issue, we also saw the following failing tests with the error
below. So, we recreated the db user.

```
expected no Exception, got #<Mysql2::Error: Access denied for user 'root'@'localhost'> with backtrace:
```

Note this issue didn't happened on the container CentOS case. But as we applied
the fix to all the container cases to simplify the logic.
@junaruga
Copy link
Contributor Author

The MacOS case failed. But I don't think the failure is related to this PR.
https://github.com/brianmario/mysql2/actions/runs/3716062019/jobs/6301955057

@junaruga junaruga marked this pull request as ready for review December 16, 2022 20:15
@sodabrew
Copy link
Collaborator

sodabrew commented Dec 17, 2022

The set of CI scripts might be due for minor refactoring, but let's land this to unblock now. Thank you for the PR!!

@sodabrew sodabrew merged commit 7f6f33a into brianmario:master Dec 17, 2022
@junaruga junaruga deleted the wip/fix-fedora-ssl-error branch December 17, 2022 09:05
@junaruga
Copy link
Contributor Author

The set of CI scripts might be due for minor refactoring, but let's land this to unblock now. Thank you for the PR!!

Thanks for reviewing! Right. We might be able to refactor the set of the CI scripts. What can we refactor in the CI scripts in your opinion?

@voxik
Copy link

voxik commented Dec 21, 2022

After fixing the issue, we also saw the following failing tests with the error below. So, we recreated the db user.

expected no Exception, got #<Mysql2::Error: Access denied for user 'root'@'localhost'> with backtrace:

Just guessing, but isn't the key in this commit?

https://src.fedoraproject.org/fork/mschorm/rpms/rubygem-mysql2/c/c7e03e581c0ea3c8a8e38d59fc6df13352434c6b

@junaruga
Copy link
Contributor Author

Perhaps, it improves the testing logic. In this PR, I used the logic used in non-container test cases to align.

mysql2/ci/setup.sh

Lines 133 to 138 in 7f6f33a

sudo mysql ${MYSQL_OPTS} -u "${DB_SYS_USER}" <<SQL
DROP USER 'root'@'localhost';
CREATE USER 'root'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
SQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fedora latest (37) and rawhide (38) cases fail with SSL error on MariaDB 10.5.18.
3 participants