policyd-override is not updated after the attach-resource (due to charm not implementing upgrade-charm hook)

Bug #1915724 reported by Giuseppe Petralia
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Neutron API Charm
Fix Released
High
Cornellius Metto

Bug Description

neutron-api units have already a policyd-override in place and I want to update it with a new one.
I create a zip file containing the new yaml and attach it with:

$ juju attach-resource neutron-api policyd-override=policyd-override.zip

But I can't see the new policy in the /etc/neutron/policy.d

If i list resources I can see that the units are not fetching the new revision of the resource from the controller and the revision they are using is not equal to the expected one:

$ juju resources neutron-api --details
Unit Resource Revision Expected
neutron-api/0 policyd-override 2021-11-02T11:01 2021-15-02T12:42
neutron-api/1 policyd-override 2021-11-02T11:01 2021-15-02T12:42
neutron-api/2 policyd-override 2021-11-02T11:01 2021-15-02T12:42

In the units logs I can see:
2021-02-15 12:48:21 INFO juju.worker.uniter resolver.go:147 found queued "upgrade-charm" hook
2021-02-15 12:48:22 INFO juju.worker.uniter.operation runhook.go:145 skipped "upgrade-charm" hook (missing)

Workaround
============
$ juju run -a neutron-api resource-get policyd-override

After that the revision is equal to the expected:

$ juju resources neutron-api --details
Unit Resource Revision Expected
neutron-api/0 policyd-override 2021-15-02T12:42 2021-15-02T12:42
neutron-api/1 policyd-override 2021-15-02T12:42 2021-15-02T12:42
neutron-api/2 policyd-override 2021-15-02T12:42 2021-15-02T12:42

and then I need to disable (false) and re-enable (true) policyd-override with:

$ juju config neutron-api use-policyd-override=false
$ juju config neutron-api use-policyd-override=true

Versions
===========
1. charm-neutron-api rev. 287
2. juju v2.8.7
3. cloud:bionic-ussuri

summary: - policyd-override is not updated after the attach-resource
+ policyd-override is not updated after the attach-resource (due to charm
+ not implementing upgrade-charm hook)
Changed in charm-neutron-api:
status: New → Triaged
importance: Undecided → High
milestone: none → 21.04
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

The reason the policy-override is not working is due to the charm not having an upgrade-charm hook, which was a bit of a surprise.

Fix: add upgrade-charm hook to minimally process the policyd using `maybe_do_policyd_overrides()` helper function in charm-helpers.

tags: added: onboarding
Changed in charm-neutron-api:
assignee: nobody → Cornellius Metto (ckmetto)
Changed in charm-neutron-api:
status: Triaged → In Progress
Changed in charm-neutron-api:
milestone: 21.04 → none
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-neutron-api (master)
tags: added: good-first-bug
removed: onboarding
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-neutron-api (master)

Reviewed: https://review.opendev.org/c/openstack/charm-neutron-api/+/790372
Committed: https://opendev.org/openstack/charm-neutron-api/commit/2c6e8255d12d0ba4a59c461ca45bc344cadc0379
Submitter: "Zuul (22348)"
Branch: master

commit 2c6e8255d12d0ba4a59c461ca45bc344cadc0379
Author: Cornellius Metto <email address hidden>
Date: Mon May 10 09:06:48 2021 +0300

    Add upgrade-charm symlink in hooks directory

    Closes-Bug: #1915724
    Change-Id: I8ca9e0c49d789921b2782ab95d0fc22483c09653

Changed in charm-neutron-api:
status: In Progress → Fix Committed
Changed in charm-neutron-api:
milestone: none → 21.10
Changed in charm-neutron-api:
status: Fix Committed → Fix Released
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.