canonical / mysql-k8s-operator

A Charmed Operator for running MySQL on Kubernetes
https://charmhub.io/mysql-k8s
Apache License 2.0
8 stars 15 forks source link

Error: The provided server is currently not in a InnoDB cluster group with quorum and thus may contain inaccurate or outdated data. #260

Open carlcsaposs-canonical opened 1 year ago

carlcsaposs-canonical commented 1 year ago

Steps to reproduce

(transient) mysql-router-k8s-operator integration-database test: https://github.com/canonical/mysql-router-k8s-operator/actions/runs/5591832035/jobs/10223531090#step:6:86

Expected behavior

No error

Actual behavior

Error: The provided server is currently not in a InnoDB cluster group with quorum and thus may contain inaccurate or outdated data. when MySQL Router bootstrapping

Versions

Operating system: ubuntu-22.04 github runner

Juju agent: 2.9.42

Charm revision: 88

Log output

Traceback:

unit-mysql-router-k8s-0: 20:15:44 ERROR unit.mysql-router-k8s/0.juju-log backend-database:3: Failed to bootstrap router
logged_command=['--bootstrap', 'relation-3:***@mysql-k8s-primary.testing.svc.cluster.local:3306', '--strict', '--conf-set-option', 'http_server.bind_address=127.0.0.1', '--conf-use-gr-notifications']
stderr:
Error: The provided server is currently not in a InnoDB cluster group with quorum and thus may contain inaccurate or outdated data.

unit-mysql-router-k8s-0: 20:15:44 ERROR unit.mysql-router-k8s/0.juju-log backend-database:3: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/./src/kubernetes_charm.py", line 146, in <module>
    ops.main.main(KubernetesRouterCharm)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/venv/ops/main.py", line 441, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/venv/ops/main.py", line 149, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/venv/ops/framework.py", line 344, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/venv/ops/framework.py", line 833, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/venv/ops/framework.py", line 922, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 1059, in _on_relation_changed_event
    getattr(self.on, "database_created").emit(
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/venv/ops/framework.py", line 344, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/venv/ops/framework.py", line 833, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/venv/ops/framework.py", line 922, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/src/abstract_charm.py", line 172, in reconcile_database_relations
    workload_.enable(tls=self._tls_certificate_saved, unit_name=self.unit.name)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/src/workload.py", line 208, in enable
    self._bootstrap_router(tls=tls)
  File "/var/lib/juju/agents/unit-mysql-router-k8s-0/charm/src/workload.py", line 180, in _bootstrap_router
    raise Exception("Failed to bootstrap router") from None
Exception: Failed to bootstrap router

Additional context

github-actions[bot] commented 1 year ago

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

carlcsaposs-canonical commented 1 year ago

Happened again here: https://github.com/canonical/mysql-router-k8s-operator/actions/runs/5832291973/job/15817515887

Guessing that mysql charm is not waiting for mysql to be ready (i.e. cluster setup) before providing credentials in databag