Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the case where the unit is not (yet) the leader #2

Closed
relaxdiego opened this issue Feb 20, 2020 · 1 comment
Closed

Handle the case where the unit is not (yet) the leader #2

relaxdiego opened this issue Feb 20, 2020 · 1 comment

Comments

@relaxdiego
Copy link
Collaborator

2020-02-20 08:41:26 DEBUG start Traceback (most recent call last):
2020-02-20 08:41:26 DEBUG start   File "/var/lib/juju/agents/unit-charm-k8s-grafana-1/charm/hooks/start", line 67, in <module>
2020-02-20 08:41:26 DEBUG start     main(Charm)
2020-02-20 08:41:26 DEBUG start   File "lib/ops/main.py", line 187, in main
2020-02-20 08:41:26 DEBUG start     _emit_charm_event(charm, juju_event_name)
2020-02-20 08:41:26 DEBUG start   File "lib/ops/main.py", line 118, in _emit_charm_event
2020-02-20 08:41:26 DEBUG start     event_to_emit.emit(*args, **kwargs)
2020-02-20 08:41:26 DEBUG start   File "lib/ops/framework.py", line 192, in emit
2020-02-20 08:41:26 DEBUG start     framework._emit(event)
2020-02-20 08:41:26 DEBUG start   File "lib/ops/framework.py", line 602, in _emit
2020-02-20 08:41:26 DEBUG start     self._reemit(event_path)
2020-02-20 08:41:26 DEBUG start   File "lib/ops/framework.py", line 637, in _reemit
2020-02-20 08:41:26 DEBUG start     custom_handler(event)
2020-02-20 08:41:26 DEBUG start   File "/var/lib/juju/agents/unit-charm-k8s-grafana-1/charm/hooks/start", line 48, in on_start_delegator
2020-02-20 08:41:26 DEBUG start     self.adapter.set_pod_spec(output.spec)
2020-02-20 08:41:26 DEBUG start   File "/var/lib/juju/agents/application-charm-k8s-grafana/charm/src/adapters.py", line 28, in set_pod_spec
2020-02-20 08:41:26 DEBUG start     self._framework.model.pod.set_spec(spec_obj)
2020-02-20 08:41:26 DEBUG start   File "lib/ops/model.py", line 452, in set_spec
2020-02-20 08:41:26 DEBUG start     raise ModelError('cannot set a pod spec as this unit is not a leader')
2020-02-20 08:41:26 DEBUG start ops.model.ModelError: cannot set a pod spec as this unit is not a leader
2020-02-20 08:41:27 ERROR juju.worker.uniter.operation runhook.go:132 hook "start" failed: exit status 1
2020-02-20 08:41:37 DEBUG start Traceback (most recent call last):
2020-02-20 08:41:37 DEBUG start   File "/var/lib/juju/agents/unit-charm-k8s-grafana-1/charm/hooks/start", line 67, in <module>
2020-02-20 08:41:37 DEBUG start     main(Charm)
2020-02-20 08:41:37 DEBUG start   File "lib/ops/main.py", line 187, in main
2020-02-20 08:41:37 DEBUG start     _emit_charm_event(charm, juju_event_name)
2020-02-20 08:41:37 DEBUG start   File "lib/ops/main.py", line 118, in _emit_charm_event
2020-02-20 08:41:37 DEBUG start     event_to_emit.emit(*args, **kwargs)
2020-02-20 08:41:37 DEBUG start   File "lib/ops/framework.py", line 192, in emit
2020-02-20 08:41:37 DEBUG start     framework._emit(event)
2020-02-20 08:41:37 DEBUG start   File "lib/ops/framework.py", line 602, in _emit
2020-02-20 08:41:37 DEBUG start     self._reemit(event_path)
2020-02-20 08:41:37 DEBUG start   File "lib/ops/framework.py", line 637, in _reemit
2020-02-20 08:41:37 DEBUG start     custom_handler(event)
2020-02-20 08:41:37 DEBUG start   File "/var/lib/juju/agents/unit-charm-k8s-grafana-1/charm/hooks/start", line 48, in on_start_delegator
2020-02-20 08:41:37 DEBUG start     self.adapter.set_pod_spec(output.spec)
2020-02-20 08:41:37 DEBUG start   File "/var/lib/juju/agents/application-charm-k8s-grafana/charm/src/adapters.py", line 28, in set_pod_spec
2020-02-20 08:41:37 DEBUG start     self._framework.model.pod.set_spec(spec_obj)
2020-02-20 08:41:37 DEBUG start   File "lib/ops/model.py", line 452, in set_spec
2020-02-20 08:41:37 DEBUG start     raise ModelError('cannot set a pod spec as this unit is not a leader')
2020-02-20 08:41:37 DEBUG start ops.model.ModelError: cannot set a pod spec as this unit is not a leader
2020-02-20 08:41:37 ERROR juju.worker.uniter.operation runhook.go:132 hook "start" failed: exit status 1
@exceptorr
Copy link
Contributor

Fixed in #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants