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

[Bug]: skip-host-cache option removed in latest MySQL 8.3.0 version #8130

Closed
swaroopar opened this issue Jan 19, 2024 · 5 comments · Fixed by #8131
Closed

[Bug]: skip-host-cache option removed in latest MySQL 8.3.0 version #8130

swaroopar opened this issue Jan 19, 2024 · 5 comments · Fixed by #8131
Labels

Comments

@swaroopar
Copy link

swaroopar commented Jan 19, 2024

Module

MySQL

Testcontainers version

1.19.3

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host Arch

x86

Docker version

Github-hosted runner. Cannot check the docker version.

What happened?

The latest mysql contanier 8.3.0 does not work anymore with testcontainers. It complains about an unknown config option - '--skip-host-cache'.

Tests with previous versions work fines. I don't see mention of any change to this config parameter in the 8.3.0 release notes though.

Error: -19T04:32:46.946550Z 0 [ERROR] [MY-000068] [Server] unknown option '--skip-host-cache'.
Error: -19T04:32:46.946911Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
Error: -19T04:32:46.946926Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-01-19T04:32:48.385535Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.

Failed Job - https://github.com/eclipse-xpanse/xpanse/actions/runs/7579264089/job/20643575357?pr=1264

Config - https://github.com/testcontainers/testcontainers-java/blob/main/modules/mysql/src/main/resources/mysql-default-conf/my.cnf#L14

Relevant log output

No response

Additional Information

No response

@rowleya
Copy link

rowleya commented Jan 19, 2024

@wimdeblauwe
Copy link
Contributor

Running into this as well. The release note of 8.0.30 does mention the deprecation of the parameter:

The --skip-host-cache server option is now deprecated, and subject to removal in a future release.

Use a statement such as SET GLOBAL host_cache_size = 0, or set host_cache_size in the my.cnf file, instead. (WL #14359)

But indeed nothing about the actual removal in the 8.3.0 release notes.

@wimdeblauwe
Copy link
Contributor

This PR seems to be related: docker-library/mysql#1002

They replaced skip-host-cache with host_cache_size=0 which is probably what will fix it here as well.

@wimdeblauwe
Copy link
Contributor

This is a workaround that seems to work for me:

  1. Create a src/main/resources/mysql-default-conf/my.cnf file in your project
  2. Copy the contents of https://github.com/testcontainers/testcontainers-java/blob/main/modules/mysql/src/main/resources/mysql-default-conf/my.cnf into it
  3. Replace the line with skip-host-cache with host_cache_size=0

After that, tests work again.

@rowleya
Copy link

rowleya commented Jan 19, 2024

My current workaround is to use mysql 8.2.0 specifically in my application-test.yml file (this is for the unit testing of a Spring Boot application):
jdbc-url: jdbc:tc:mysql:8.2.0:///;databaseName=<database>?user=<user>&password=<password>

chadlwilson added a commit to gocd/gocd that referenced this issue Jan 20, 2024
chadlwilson added a commit to chadlwilson/testcontainers-java that referenced this issue Jan 20, 2024
eddumelendez added a commit that referenced this issue Jan 23, 2024
* Remove use of deprecated (removed in 8.3) MySQL config option

* Update MySQL default images to latest

- 5.6 went EOL in Feb 2021. Stop testing against it.
- 5.7 went EOL in Oct 2023. Retain tests for a bit, but stop using it as the default.
- 8.0.34+ is now LTS rather than rolling - use this as the default for most tests
- Add 8.3.0 as a candidate "innovation" version which will eventually become LTS

* Updates various docs to use 8.0 in the examples rather than EOL 5.7.

* Update MariaDB images to latest 10.3 patch release

Fixes #8130

---------

Co-authored-by: Eddú Meléndez <eddu.melendez@gmail.com>
miyabayt added a commit to miyabayt/spring-boot-doma2-sample that referenced this issue Apr 8, 2024
miyabayt added a commit to miyabayt/spring-boot-r2dbc-rest-sample that referenced this issue Apr 8, 2024
miyabayt added a commit to miyabayt/spring-boot-mybatis-rest-sample that referenced this issue Apr 8, 2024
miyabayt added a commit to miyabayt/spring-boot-r2dbc-thymeleaf-sample that referenced this issue Apr 9, 2024
jdubois added a commit to jdubois/jhipster-online that referenced this issue Nov 5, 2024
jdubois added a commit to jdubois/jhipster-online that referenced this issue Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants