blank access-network due to call to relation-set with blank value,

Bug #1839167 reported by Mihaela Andronic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Percona Cluster Charm
Triaged
Low
Unassigned

Bug Description

Hi

we need to file a bug on this: https://github.com/openstack/charm-percona-cluster/blob/master/hooks/percona_hooks.py#L811;

We have ran into a severe outage when shared-db-relation-changed function bombs on blank access-network due to call to relation-set with blank value, also, that should totally be deferring to spaces, too

the fix which was -- touch /tmp/seeded && chown mysql.mysql /tmp/seeded && mv /tmp/seeded /var/lib/mysql/seeded || and juju config mysql access-network="$IP" <-- see https://github.com/openstack/charm-percona-cluster/blob/stable/17.08/hooks/percona_hooks.py#L545

notes state that when config-change ran, line 202, it kicked to mark seeded in the charm state - the only other time seeded gets hooked up is if you upgrade-charm; which is why it was believed that 'access-network' value was needed due to be set.

E.g:

$ juju run --unit mysql/0 hooks/shared-db-relation-changed
ERROR no relation id specified
ERROR no relation id specified
Traceback (most recent call last):
  File "hooks/shared-db-relation-changed", line 709, in <module>
    main()
  File "hooks/shared-db-relation-changed", line 701, in main
    hooks.execute(sys.argv)
  File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/charmhelpers/core/hookenv.py", line 731, in execute
    self._hooks[hook_name]()
  File "hooks/shared-db-relation-changed", line 493, in shared_db_changed
    relation_settings={'access-network': access_network})
  File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/charmhelpers/contrib/peerstorage/__init__.py", line 256, in peer_store_and_set
    **kwargs)
  File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/charmhelpers/contrib/peerstorage/__init__.py", line 140, in relation_set
    relation_settings=relation_settings, **kwargs)
  File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/charmhelpers/core/hookenv.py", line 391, in relation_set
    relation_cmd_line + ["--file", settings_file.name])
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['relation-set', '--file', '/tmp/tmpuLehYo']' returned non-zero exit status 2

As such it looked like there's definitely a bug there that you can't relation-set a null value; this being run blindly is not gonna work https://github.com/openstack/charm-percona-cluster/blob/stable/17.08/hooks/percona_hooks.py#L548

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

The offending line is still in the charm; I suspect access-network should be checked for not being set and the relation data not set in that case.

Changed in charm-percona-cluster:
importance: Undecided → Low
status: New → Triaged
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.