Files
Alexey MilovidovandClaude Opus 4.6 667d982c85 Fix sporadic MySQL 8 container startup failure in integration tests
MySQL 8 sporadically fails during data directory initialization with
"Could not generate RSA Private/Public key pair" in resource-constrained
CI environments (ARM, container-in-container). These RSA keys are used
for `sha256_password` / `caching_sha2_password` authentication plugins,
which these tests don't use (`mysql_native_password` is the default).

The fix provides pre-generated RSA keys to the MySQL 8 container and
disables auto-generation, eliminating the sporadic failure.

Failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96238&sha=856f7c28ba3cf10f393598a6f629af2af41de311&name_0=PR&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%203%2F4%29

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-06 23:29:29 +01:00

24 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Create CA certificate
openssl genrsa 2048 > ca-key.pem
openssl req -new -x509 -nodes -days 3600 -key ca-key.pem -out ca.pem -subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=ca"
# Create server certificate, remove passphrase, and sign it
# server-cert.pem = public key, server-key.pem = private key
openssl req -newkey rsa:2048 -days 3600 -nodes -keyout server-key.pem -out server-req.pem -subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=server"
openssl rsa -in server-key.pem -out server-key.pem
openssl x509 -req -in server-req.pem -days 3600 -CA ca.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
# Create client certificate, remove passphrase, and sign it
# client-cert.pem = public key, client-key.pem = private key
openssl req -newkey rsa:2048 -days 3600 -nodes -keyout client-key.pem -out client-req.pem -subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=client"
openssl rsa -in client-key.pem -out client-key.pem
openssl x509 -req -in client-req.pem -days 3600 -CA ca.pem -CAkey ca-key.pem -set_serial 01 -out client-cert.pem
# Create RSA key pair for MySQL sha256_password/caching_sha2_password authentication.
# Pre-generating these avoids sporadic "Could not generate RSA Private/Public key pair"
# errors during MySQL initialization in resource-constrained CI environments.
openssl genrsa -out private_key.pem 2048
openssl rsa -in private_key.pem -pubout -out public_key.pem