| Bug #100490 | Docker container log doesn't make sense when configuration is mistaken | ||
|---|---|---|---|
| Submitted: | 11 Aug 2020 8:27 | Modified: | 12 Aug 2020 9:07 |
| Reporter: | Tsubasa Tanaka (OCA) | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Package Repos | Severity: | S3 (Non-critical) |
| Version: | 5.6.49, 5.7.31 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | Contribution | ||
[11 Aug 2020 8:27]
Tsubasa Tanaka
[11 Aug 2020 8:31]
Tsubasa Tanaka
fix as same as 5.5 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug100490.patch (application/octet-stream, text), 1.24 KiB.
[11 Aug 2020 8:32]
Tsubasa Tanaka
The patched container works fine. $ sudo docker run work --invalid-option [Entrypoint] MySQL Docker Image 5.7.31-1.1.17 [Entrypoint] ERROR: Unable to start MySQL. Please check your configuration. [Entrypoint] 2020-08-11T08:32:10.807114Z 0 [ERROR] unknown option '--invalid-option' 2020-08-11T08:32:10.810425Z 0 [ERROR] Aborting
[11 Aug 2020 9:15]
MySQL Verification Team
Hello tanaka-San, Thank you for the report and contribution. regards, Umesh
[12 Aug 2020 7:37]
Terje Røsten
Hi! Can you please cut and paste the patch as comment? Current patch seems to be borken in some way.
[12 Aug 2020 7:39]
Lars Tangvald
Posted by developer: Thanks for the report! When the --validate-config option was added to 8.0 (but not 5.6 and 5.7) we added the method for verifying the config as a variable to the template, but the entry used for the older versions contains an unescaped &, which is sed replaces with the name of the variable, garbling the command. Simply escaping the ampersand should fix this. Note that the supplied patch seems corrupted
[12 Aug 2020 9:05]
Tsubasa Tanaka
Sorry for broken patch.
diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh
index d1b8f30..628f952 100755
--- a/5.6/docker-entrypoint.sh
+++ b/5.6/docker-entrypoint.sh
@@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then
# Test that the server can start. We redirect stdout to /dev/null so
# only the error messages are left.
result=0
- output=$("$@" --verbose --help 2>%%VALIDATE_CONFIG%%1 > /dev/null) || result=$?
+ output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$?
if [ ! "$result" = "0" ]; then
echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.'
echo >&2 "[Entrypoint] $output"
diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh
index 45d13ab..b667658 100755
--- a/5.7/docker-entrypoint.sh
+++ b/5.7/docker-entrypoint.sh
@@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then
# Test that the server can start. We redirect stdout to /dev/null so
# only the error messages are left.
result=0
- output=$("$@" --verbose --help 2>%%VALIDATE_CONFIG%%1 > /dev/null) || result=$?
+ output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$?
if [ ! "$result" = "0" ]; then
echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.'
echo >&2 "[Entrypoint] $output"
[12 Aug 2020 9:06]
Tsubasa Tanaka
Previous patch is broken (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug100490.patch (application/octet-stream, text), 1.24 KiB.
[12 Aug 2020 9:06]
Tsubasa Tanaka
Sorry, fixed again.. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug100490.patch (application/octet-stream, text), 1.23 KiB.
[12 Aug 2020 9:07]
Tsubasa Tanaka
Sorry for my mistakes..
