mysqlrouter.conf invalid characters

Bug #2004088 reported by Pedro Victor Lourenço Fragola
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Router Charm
Fix Committed
Medium
Unassigned

Bug Description

[Issue description]

Version => mysql-router 8.0/stable 35

After the unit's filesystem ran out of disk space, the config file => /var/lib/mysql/<app-name>-mysql-router/mysqlrouter.conf had some lines with invalid characters:

[metadata_cache:[\w$]+$]
ttl = 0.1

I tried to simulate this issue in other ways and tried to check a way to re-create a fresh mysqlrouter.conf file, I checked in the logs that the update-status makes the charm write to the file "Writing /var/lib/mysql/glance-mysql-router/mysqlrouter.conf".

[How to create the issue]

echo > /var/lib/mysql/glance-mysql-router/mysqlrouter.conf
juju run -u glance-mysql-router/0 hooks/update-status

cat mysqlrouter.conf

[metadata_cache:[\w$]+$]
ttl = 0.1
auth_cache_ttl = -1
auth_cache_refresh_interval = 2

After that, I was able possible to reproduce the issue with the file with invalid characters.
If the file is edited with some other character and "update-status" is executed the line with the invalidated characters will also be added
The configuration file is not completely recreated, only a few lines are added.

NOTE: The issue was created during the "full filesystem usage" but I was only able to simulate the issue in my lab by doing the above procedure.

1 - Is this expected behavior?
2 - The goal is to avoid this type of character insertion in the file.

Revision history for this message
Pedro Victor Lourenço Fragola (pedrovlf) wrote :

Just as a note it is not possible to do remove-relation and add-relation to fix the config file due to another BUG LP#2004089 I reported from the same environment.

Seyeong Kim (seyeongkim)
tags: added: sts
Changed in charm-mysql-router:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (master)

Change abandoned by "Seyeong Kim <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/881162
Reason: As discussion.

Revision history for this message
Felipe Reyes (freyes) wrote :

Marking as won't fix based on the discussed there was at the reviewed patch.

Changed in charm-mysql-router:
status: In Progress → Won't Fix
Revision history for this message
Edward Hope-Morley (hopem) wrote :

From what I can tell this is the current patchset: https://review.opendev.org/c/openstack/charm-mysql-router/+/886810

Changed in charm-mysql-router:
status: Won't Fix → In Progress
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (stable/jammy)

Fix proposed to branch: stable/jammy
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/902535

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (stable/21.10)

Fix proposed to branch: stable/21.10
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/902591

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (stable/21.10)

Change abandoned by "Nicolas Bock <email address hidden>" on branch: stable/21.10
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/902591

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (stable/focal)

Fix proposed to branch: stable/focal
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/902592

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (stable/focal)

Change abandoned by "Nicolas Bock <email address hidden>" on branch: stable/focal
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/902592

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (stable/focal)

Fix proposed to branch: stable/focal
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/902593

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (stable/focal)

Change abandoned by "Alex Kavanagh <email address hidden>" on branch: stable/focal
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/902593
Reason: stable/focal is end-of-life and doesn't get published anywhere; really must clean out these old branches. Sorry for the confusion.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-mysql-router (stable/jammy)

Reviewed: https://review.opendev.org/c/openstack/charm-mysql-router/+/902535
Committed: https://opendev.org/openstack/charm-mysql-router/commit/08a33d6759c4012c7ec470fdd2dcd7852b036394
Submitter: "Zuul (22348)"
Branch: stable/jammy

commit 08a33d6759c4012c7ec470fdd2dcd7852b036394
Author: Nicolas Bock <email address hidden>
Date: Tue Aug 1 07:46:53 2023 -0600

    Add cleanup of configuration files on `stop`

    When this subordinate is removed from a unit it leaves its configuration
    files behind. This can become an issue if the subordinate is added back
    to the unit as pointed out in #2004088.

    This change adds a cleanup step to the `stop` hook so that those
    configuration files are removed on the removal of the subordinate charm.

    Closes-Bug: #2004088
    Closes-Bug: #2004089
    Change-Id: Icfca352f29e089aeccd1434d33a573ca1682339a
    Signed-off-by: Nicolas Bock <email address hidden>
    (cherry picked from commit 17595788edd80580624b03a664dd5cdb05bba47f)

tags: added: in-stable-jammy
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-mysql-router (master)

Reviewed: https://review.opendev.org/c/openstack/charm-mysql-router/+/915310
Committed: https://opendev.org/openstack/charm-mysql-router/commit/d334665b2d8bb113223508f348d053020e8c860c
Submitter: "Zuul (22348)"
Branch: master

commit d334665b2d8bb113223508f348d053020e8c860c
Author: Seyeong Kim <email address hidden>
Date: Tue Apr 9 11:32:46 2024 +0900

    Fixing broken mysql-router configuration

    A customer faced an issue when they face full disk. Mysql router configuration file was broken. As this charm doesn't handle whole configuration file, charm wrote just part of them based on template. so re-bootstrapping is needed when this symptom happens.

    To do that, I put code to check configuration file size, and if it is under 1000bytes, run bootstrap.

    func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1196
    Closes-Bug: #2004088
    Change-Id: Ic28f0406eb8d5dbd9131ae83090498297ac48c31

Changed in charm-mysql-router:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (master)

Change abandoned by "Seyeong Kim <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/886810

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (stable/jammy)

Fix proposed to branch: stable/jammy
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/921716

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (stable/focal)

Fix proposed to branch: stable/focal
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/921906

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (stable/21.10)

Fix proposed to branch: stable/21.10
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/921907

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (stable/21.10)

Change abandoned by "Seyeong Kim <email address hidden>" on branch: stable/21.10
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/921907

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (stable/focal)

Change abandoned by "Seyeong Kim <email address hidden>" on branch: stable/focal
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/921906

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-mysql-router (stable/jammy)

Reviewed: https://review.opendev.org/c/openstack/charm-mysql-router/+/921716
Committed: https://opendev.org/openstack/charm-mysql-router/commit/d9af34ac232e0dcb022298074ed6b91c7e4476a9
Submitter: "Zuul (22348)"
Branch: stable/jammy

commit d9af34ac232e0dcb022298074ed6b91c7e4476a9
Author: Seyeong Kim <email address hidden>
Date: Tue Apr 9 11:32:46 2024 +0900

    Fixing broken mysql-router configuration

    A customer faced an issue when they face full disk. Mysql router configuration file was broken. As this charm doesn't handle whole configuration file, charm wrote just part of them based on template. so re-bootstrapping is needed when this symptom happens.

    To do that, I put code to check configuration file size, and if it is under 1000bytes, run bootstrap.

    func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1218
    Closes-Bug: #2004088
    Change-Id: Ic28f0406eb8d5dbd9131ae83090498297ac48c31
    (cherry picked from commit d334665b2d8bb113223508f348d053020e8c860c)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (master)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.