canonical / charmed-mysql-snap

SNAP for Charmed MySQL charm.
https://snapcraft.io/charmed-mysql
Apache License 2.0
0 stars 4 forks source link

Unable to upgrade mysqld-exporter to v0.15 #46

Open shayancanonical opened 6 months ago

shayancanonical commented 6 months ago

Steps to reproduce

  1. Checkout to 361e3e8
  2. Run tox -e smoke
  3. sudo snap logs charmed-mysql.mysqld-exporter

Expected behavior

We are able to upgrade to 0.15, fix the breaking changes (as proposed in [361e3e8), and things should just work

Actual behavior

mysqld-exporter, after making the appropriate changes, is unable to start up because of errors in mysqld-exporter (as describe in https://github.com/prometheus/mysqld_exporter/issues/754)

There are 2 issues:

  1. 0.15 does not correctly parse unix socket --mysqld.address (it looks for host:port)
  2. 0.15 always requires .my.cnf even though my.cnf style file for arguments that make up DATA_SOURCE is optional if command line args are passed in

Versions

Operating system: Ubuntu 22.04

Log output

Logs of mysqld-exporter snap service:

2024-04-03T20:50:22Z charmed-mysql.mysqld-exporter[3938882]: ts=2024-04-03T20:50:22.170Z caller=mysqld_exporter.go:221 level=info msg="Build context" build_context="(go=go1.18.1, user=team+pkg-go@tracker.debian.org, date=20240226-15:31:07)"                       
2024-04-03T20:50:22Z charmed-mysql.mysqld-exporter[3938882]: ts=2024-04-03T20:50:22.170Z caller=config.go:146 level=error msg="failed to parse config" section=client err="set field \"port\": strconv.ParseInt: parsing \"///var/snap/charmed-mysql/common/var/run/mysqld/mysqld.sock)\": invalid syntax"                  
2024-04-03T20:50:22Z charmed-mysql.mysqld-exporter[3938882]: ts=2024-04-03T20:50:22.170Z caller=mysqld_exporter.go:225 level=info msg="Error parsing host config" file=.my.cnf err="no configuration found"
2024-04-03T20:50:22Z systemd[1]: snap.charmed-mysql.mysqld-exporter.service: Main process exited, code=exited, status=1/FAILURE
2024-04-03T20:50:22Z systemd[1]: snap.charmed-mysql.mysqld-exporter.service: Failed with result 'exit-code'.
2024-04-03T20:50:22Z systemd[1]: snap.charmed-mysql.mysqld-exporter.service: Scheduled restart job, restart counter is at 5.
2024-04-03T20:50:22Z systemd[1]: Stopped Service for snap application charmed-mysql.mysqld-exporter.
2024-04-03T20:50:22Z systemd[1]: snap.charmed-mysql.mysqld-exporter.service: Start request repeated too quickly.
2024-04-03T20:50:22Z systemd[1]: snap.charmed-mysql.mysqld-exporter.service: Failed with result 'exit-code'.
2024-04-03T20:50:22Z systemd[1]: Failed to start Service for snap application charmed-mysql.mysqld-exporter.

Additional context

github-actions[bot] commented 6 months ago

https://warthogs.atlassian.net/browse/DPE-3941