ERROR cannot write relation settings

Bug #2046257 reported by Felipe Reyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard Charm
Fix Committed
Undecided
Felipe Reyes
2023.1
Fix Released
Undecided
Unassigned
2023.2
Fix Released
Undecided
Unassigned
Ussuri
Fix Released
Undecided
Unassigned
Victoria
Fix Released
Undecided
Unassigned
Wallaby
Fix Released
Undecided
Unassigned
Xena
Fix Released
Undecided
Unassigned
Yoga
Fix Released
Undecided
Unassigned
Zed
Fix Released
Undecided
Unassigned

Bug Description

The code associated to the bug https://bugs.launchpad.net/charm-openstack-dashboard/+bug/2030094 introduced a new relation that uses an app databag, although the relation_set() call is not wrapped with a `if is_leader()` , hence it's producing a hook failure when the hook runs on follower units.

2023-12-07 08:22:32 INFO juju.worker.uniter resolver.go:155 awaiting error resolution for "relation-joined" hook
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 ERROR cannot write relation settings
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 Traceback (most recent call last):
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/dashboard-relation-joined", line 528, in <module>
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 main()
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/dashboard-relation-joined", line 488, in main
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 hooks.execute(sys.argv)
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/charmhelpers/core/hookenv.py", line 962, in execute
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 self._hooks[hook_name]()
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/dashboard-relation-joined", line 483, in dashboard_relation_changed
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 relation_set(rel_id, relation_settings=relation_settings, app=True)
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/charmhelpers/core/hookenv.py", line 518, in relation_set
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 subprocess.check_call(
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 raise CalledProcessError(retcode, cmd)
2023-12-07 08:22:32 WARNING unit.openstack-dashboard/2.dashboard-relation-joined logger.go:60 subprocess.CalledProcessError: Command '['relation-set', '--app', '-r', 'dashboard:1146', '--file', '/tmp/tmp3rblyek9']' returned non-zero exit status 1.
2023-12-07 08:22:33 ERROR juju.worker.uniter.operation runhook.go:153 hook "dashboard-relation-joined" (via explicit, bespoke hook script) failed: exit status 1
2023-12-07 08:22:33 INFO juju.worker.uniter resolver.go:155 awaiting error resolution for "relation-joined" hook

Related commit: https://opendev.org/openstack/charm-openstack-dashboard/commit/484b7d82601bf4f493df7f564b5b74575819436d

Felipe Reyes (freyes)
Changed in charm-openstack-dashboard:
assignee: nobody → Felipe Reyes (freyes)
status: New → Triaged
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (master)
Changed in charm-openstack-dashboard:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-openstack-dashboard (master)

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903506
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/4d5581438ad216a0de69c0959e05e0b8a76bc9aa
Submitter: "Zuul (22348)"
Branch: master

commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413

Changed in charm-openstack-dashboard:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/2023.2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/2023.1)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/zed)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/yoga)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/xena)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/wallaby)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/victoria)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/ussuri)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-openstack-dashboard (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903454
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/a6c1b873e51d9c23f05c79ca180cf3b84a987d27
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit a6c1b873e51d9c23f05c79ca180cf3b84a987d27
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413
    (cherry picked from commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa)

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

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903455
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/b6d79b24c2d7982fe709be6b64443915e51e8564
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit b6d79b24c2d7982fe709be6b64443915e51e8564
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413
    (cherry picked from commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa)

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

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903456
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/617fbcc8a0f50d30d0aad1ba679dcbd7cbd41a47
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 617fbcc8a0f50d30d0aad1ba679dcbd7cbd41a47
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413
    (cherry picked from commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa)

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

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903457
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/4b428abc59481c032fd89e990545234c05232e72
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 4b428abc59481c032fd89e990545234c05232e72
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413
    (cherry picked from commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa)

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

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903519
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/3905f0a6ae35257257b1dd5ccc275f4c26678b16
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 3905f0a6ae35257257b1dd5ccc275f4c26678b16
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413
    (cherry picked from commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa)

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

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903520
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/41ee8b99ecd0ecf5b878eb38e51a5fc47e7f5dad
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 41ee8b99ecd0ecf5b878eb38e51a5fc47e7f5dad
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413
    (cherry picked from commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa)
    (cherry picked from commit 3905f0a6ae35257257b1dd5ccc275f4c26678b16)

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

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903458
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/2d1db3743548bc03eda4838ecb7324cc0bf41927
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 2d1db3743548bc03eda4838ecb7324cc0bf41927
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413
    (cherry picked from commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa)
    (cherry picked from commit 3905f0a6ae35257257b1dd5ccc275f4c26678b16)

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

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/903459
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/f7049fa6208e097da102eb0b7b0eb5891dbd4fb5
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit f7049fa6208e097da102eb0b7b0eb5891dbd4fb5
Author: Felipe Reyes <email address hidden>
Date: Tue Dec 12 11:06:29 2023 -0300

    Run relation_set() in dashboard_relation_changed() on leader

    The commit 484b7d8260 introduced a new relation that relies on an
    application databag to exchange data, although only the leader can write
    to it, and the original patch didn't guard the relation_set() call with
    a is_leader(), this patch addresses that problem wich produces a hook
    failure on follower units when openstack-dashboard is deployed in HA.

    Closes-Bug: #2046257
    Related-Bug: #2030094
    Change-Id: I1930b0b96f65cb627f896db67dddc6370cf6a413
    (cherry picked from commit 4d5581438ad216a0de69c0959e05e0b8a76bc9aa)
    (cherry picked from commit 3905f0a6ae35257257b1dd5ccc275f4c26678b16)

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.