helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

[prometheus-mysql-exporter] failed to validate config - Error parsing host config

Open thomas-vt opened this issue 1 year ago • 6 comments

Describe the bug a clear and concise description of what the bug is.

ts=2023-06-29T15:19:46.283Z caller=mysqld_exporter.go:220 level=info msg="Starting mysqld_exporter" version="(version=0.15.0, branch=HEAD, revision=6ca2a42f97f3403c7788ff4f374430aa267a6b6b)" ts=2023-06-29T15:19:46.283Z caller=mysqld_exporter.go:221 level=info msg="Build context" build_context="(go=go1.20.5, platform=linux/amd64, user=root@c4fca471a5b1, date=20230624-04:09:04, tags=netgo)" ts=2023-06-29T15:19:46.283Z caller=config.go:150 level=error msg="failed to validate config" section=client err="no user specified in section or parent" ts=2023-06-29T15:19:46.283Z caller=mysqld_exporter.go:225 level=info msg="Error parsing host config" file=.my.cnf err="no configuration found"

What's your helm version?

v3.11.3

What's your kubectl version?

v1.27.1

Which chart?

prometheus-mysql-exporter

What's the chart version?

1.14.0

What happened?

Added the following changes to values.yaml

`extraVolumeMounts:

  • name: mysql-cnf mountPath: "/home/.my.cnf" subPath: ".my.cnf"

extraVolumes:

  • name: mysql-cnf configMap: name: mysql-configmap items: - key: .my.cnf path: .my.cnf

config: my-cnf: "/home/.my.cnf"

mysql: existingSecret: "mysqlexporter-dsn"`

Created secret mysqlexporter-dsn and configmap mysql-configmap

What you expected to happen?

Pod does not start and is in CrashLoop

Logs show message

ts=2023-06-29T15:19:46.283Z caller=mysqld_exporter.go:220 level=info msg="Starting mysqld_exporter" version="(version=0.15.0, branch=HEAD, revision=6ca2a42f97f3403c7788ff4f374430aa267a6b6b)" ts=2023-06-29T15:19:46.283Z caller=mysqld_exporter.go:221 level=info msg="Build context" build_context="(go=go1.20.5, platform=linux/amd64, user=root@c4fca471a5b1, date=20230624-04:09:04, tags=netgo)" ts=2023-06-29T15:19:46.283Z caller=config.go:150 level=error msg="failed to validate config" section=client err="no user specified in section or parent" ts=2023-06-29T15:19:46.283Z caller=mysqld_exporter.go:225 level=info msg="Error parsing host config" file=.my.cnf err="no configuration found"

How to reproduce it?

No response

Enter the changed values of values.yaml?

`extraVolumeMounts:

  • name: mysql-cnf mountPath: "/home/.my.cnf" subPath: ".my.cnf"

extraVolumes:

  • name: mysql-cnf configMap: name: mysql-configmap items: - key: .my.cnf path: .my.cnf

config: my-cnf: "/home/.my.cnf"

mysql: existingSecret: "mysqlexporter-dsn"`

Enter the command that you execute and failing/misfunctioning.

helm -n install prometheus-mysql-exporter -f values.yaml

Anything else we need to know?

No response

thomas-vt avatar Jun 29 '23 15:06 thomas-vt

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

stale[bot] avatar Aug 07 '23 05:08 stale[bot]

hi @thomas-vt , I having the same problem. and my environment is similar to yours as well. may i know have u managed to resolve this?

cognixusRay avatar Aug 18 '23 00:08 cognixusRay

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

stale[bot] avatar Sep 17 '23 06:09 stale[bot]

Same here

isole avatar Nov 09 '23 09:11 isole

Hi I have the same problem. I am using the "existingConfigSecret" and have deployed a connection string as a secret that is in the same namespace as my chart's ressources.

Aboitier avatar Dec 28 '23 15:12 Aboitier

Hi I am trying to run the mysql-exporter using docker-compose file but getting error: Creating network "mysql-exp_default" with the default driver Creating mysql-exp_mysqld-exporter_1 ... done Attaching to mysql-exp_mysqld-exporter_1 mysqld-exporter_1 | ts=2024-03-11T07:20:46.685Z caller=mysqld_exporter.go:220 level=info msg="Starting mysqld_exporter" version="(version=0.15.1, branch=HEAD, revision=cc349684494b5038ec5a52233bdca9eb9291e6f2)" mysqld-exporter_1 | ts=2024-03-11T07:20:46.685Z caller=mysqld_exporter.go:221 level=info msg="Build context" build_context="(go=go1.21.5, platform=linux/amd64, user=root@d89c15b9f5ad, date=20231212-07:55:09, tags=unknown)" mysqld-exporter_1 | ts=2024-03-11T07:20:46.685Z caller=config.go:150 level=error msg="failed to validate config" section=client err="no user specified in section or parent" mysqld-exporter_1 | ts=2024-03-11T07:20:46.685Z caller=mysqld_exporter.go:225 level=info msg="Error parsing host config" file=/etc/mysql-exporter/mysql-exporter.yaml err="no configuration found" mysql-exp_mysqld-exporter_1 exited with code 1

Here is the docker-compose.yml

` version: '3.8'

services: mysqld-exporter: image: prom/mysqld-exporter ports: - "9104:9104" volumes: - /path/to/mysql-exporter.yaml:/etc/mysql-exporter/mysql-exporter.yaml command: ["--config.my-cnf=/etc/mysql-exporter/mysql-exporter.yaml"]

Here is the mysql-exporter.yaml: datasource: username: password: host: port:

`

Saurabh-ghub avatar Mar 11 '24 07:03 Saurabh-ghub