juju attach not working in k8s charms

Bug #1843470 reported by David
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

The result expected with `juju attach` is supposed to change the "tuple" of the charm revision combined with each resource revision and trigger upgrade-charm as part of that change.

I am trying to do that, but the upgrade-charm isn't executed.

Before running the juju attach:

$ juju show-status-log ro-k8s/0
Time Type Status Message
10 Sep 2019 17:41:41Z workload maintenance fetching resource: ro-image
10 Sep 2019 17:42:02Z juju-unit executing running leader-elected hook
10 Sep 2019 17:42:04Z juju-unit executing running config-changed hook
10 Sep 2019 17:42:08Z juju-unit executing running mysql-relation-joined hook
10 Sep 2019 17:42:13Z juju-unit executing running mysql-relation-changed hook
10 Sep 2019 17:42:16Z juju-unit executing running ro-relation-joined hook
10 Sep 2019 17:42:21Z workload waiting Waiting for mysql to be ready
10 Sep 2019 17:42:21Z juju-unit executing running mysql-relation-changed hook
10 Sep 2019 17:42:26Z workload maintenance Configuring ro container
10 Sep 2019 17:42:28Z workload maintenance Sending RO configuration
10 Sep 2019 17:42:29Z workload waiting Waiting for mysql to be ready
10 Sep 2019 17:42:29Z juju-unit executing running ro-relation-changed hook
10 Sep 2019 17:42:31Z workload maintenance Sending RO configuration
10 Sep 2019 17:42:33Z workload waiting waiting for container
10 Sep 2019 17:42:33Z juju-unit executing running config-changed hook
10 Sep 2019 17:42:34Z juju-unit allocating Started container ro-k8s
10 Sep 2019 17:42:34Z workload waiting Started container ro-k8s
10 Sep 2019 17:42:35Z juju-unit executing running log-storage-attached hook
10 Sep 2019 17:43:01Z juju-unit idle
10 Sep 2019 17:43:01Z workload active ready

$ juju attach ro-k8s ro-image=rocks.canonical.com:5000/canonicalosm/ro:ha-patch
$ juju show-status-log ro-k8s/0
Time Type Status Message
10 Sep 2019 17:41:41Z workload maintenance fetching resource: ro-image
10 Sep 2019 17:42:02Z juju-unit executing running leader-elected hook
10 Sep 2019 17:42:04Z juju-unit executing running config-changed hook
10 Sep 2019 17:42:08Z juju-unit executing running mysql-relation-joined hook
10 Sep 2019 17:42:13Z juju-unit executing running mysql-relation-changed hook
10 Sep 2019 17:42:16Z juju-unit executing running ro-relation-joined hook
10 Sep 2019 17:42:21Z workload waiting Waiting for mysql to be ready
10 Sep 2019 17:42:21Z juju-unit executing running mysql-relation-changed hook
10 Sep 2019 17:42:26Z workload maintenance Configuring ro container
10 Sep 2019 17:42:28Z workload maintenance Sending RO configuration
10 Sep 2019 17:42:29Z workload waiting Waiting for mysql to be ready
10 Sep 2019 17:42:29Z juju-unit executing running ro-relation-changed hook
10 Sep 2019 17:42:31Z workload maintenance Sending RO configuration
10 Sep 2019 17:42:33Z workload waiting waiting for container
10 Sep 2019 17:42:33Z juju-unit executing running config-changed hook
10 Sep 2019 17:42:34Z juju-unit allocating Started container ro-k8s
10 Sep 2019 17:42:34Z workload waiting Started container ro-k8s
10 Sep 2019 17:42:35Z juju-unit executing running log-storage-attached hook
10 Sep 2019 17:43:01Z juju-unit idle
10 Sep 2019 17:43:01Z workload active ready

There's no upgrade-charm hook. And the charm hasn't upgraded with the new resource.

Tags: k8s
Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.6.9
importance: Undecided → High
status: New → Triaged
tags: added: k8s
Revision history for this message
Ian Booth (wallyworld) wrote :

It works for normal file resources but not OCI image resources. It uses the fingerprint value of the resource to detect if there's been a change but for OCI image resources we don't have that. Looking at how we can make it work.

Revision history for this message
David (davigar15) wrote : Re: [Bug 1843470] Re: juju attach not working in k8s charms
Download full text (4.8 KiB)

Another way could be using `juju upgrade-charm`, and update there the
resource.

But the problem there is that if the revision number hasn’t changed, it
gives an error saying that the charm revision is already the latest one.

Thanks,
David

On Wed, 11 Sep 2019 at 06:35, Ian Booth <email address hidden> wrote:

> It works for normal file resources but not OCI image resources. It uses
> the fingerprint value of the resource to detect if there's been a change
> but for OCI image resources we don't have that. Looking at how we can
> make it work.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1843470
>
> Title:
> juju attach not working in k8s charms
>
> Status in juju:
> Triaged
>
> Bug description:
> The result expected with `juju attach` is supposed to change the
> "tuple" of the charm revision combined with each resource revision and
> trigger upgrade-charm as part of that change.
>
> I am trying to do that, but the upgrade-charm isn't executed.
>
>
> Before running the juju attach:
>
> $ juju show-status-log ro-k8s/0
> Time Type Status Message
> 10 Sep 2019 17:41:41Z workload maintenance fetching resource:
> ro-image
> 10 Sep 2019 17:42:02Z juju-unit executing running leader-elected
> hook
> 10 Sep 2019 17:42:04Z juju-unit executing running config-changed
> hook
> 10 Sep 2019 17:42:08Z juju-unit executing running
> mysql-relation-joined hook
> 10 Sep 2019 17:42:13Z juju-unit executing running
> mysql-relation-changed hook
> 10 Sep 2019 17:42:16Z juju-unit executing running
> ro-relation-joined hook
> 10 Sep 2019 17:42:21Z workload waiting Waiting for mysql to be
> ready
> 10 Sep 2019 17:42:21Z juju-unit executing running
> mysql-relation-changed hook
> 10 Sep 2019 17:42:26Z workload maintenance Configuring ro container
> 10 Sep 2019 17:42:28Z workload maintenance Sending RO configuration
> 10 Sep 2019 17:42:29Z workload waiting Waiting for mysql to be
> ready
> 10 Sep 2019 17:42:29Z juju-unit executing running
> ro-relation-changed hook
> 10 Sep 2019 17:42:31Z workload maintenance Sending RO configuration
> 10 Sep 2019 17:42:33Z workload waiting waiting for container
> 10 Sep 2019 17:42:33Z juju-unit executing running config-changed
> hook
> 10 Sep 2019 17:42:34Z juju-unit allocating Started container ro-k8s
> 10 Sep 2019 17:42:34Z workload waiting Started container ro-k8s
> 10 Sep 2019 17:42:35Z juju-unit executing running
> log-storage-attached hook
> 10 Sep 2019 17:43:01Z juju-unit idle
> 10 Sep 2019 17:43:01Z workload active ready
>
>
> $ juju attach ro-k8s ro-image=
> rocks.canonical.com:5000/canonicalosm/ro:ha-patch
> $ juju show-status-log ro-k8s/0
> Time Type Status Message
> 10 Sep 2019 17:41:41Z workload maintenance fetching resource:
> ro-image
> 10 Sep 2019 17:42:02Z juju-unit executing running leader-elected
> hook
> 10 Sep 2019 17:42:04Z juju-unit executing running config-changed
> hook
> 10 Sep 2...

Read more...

Revision history for this message
Ian Booth (wallyworld) wrote :

It works for local charms, so as a work around you could pull the charm and unpack locally for now.
ie
juju upgrade-charm myapp --path path/to/charm --resource my_image=foo

Revision history for this message
David (davigar15) wrote :
Download full text (4.6 KiB)

Yes. But if we do that in production, we can't go back to a charm of the
charm store

David

On Wed, Sep 11, 2019 at 7:50 AM Ian Booth <email address hidden> wrote:

> It works for local charms, so as a work around you could pull the charm
> and unpack locally for now.
> ie
> juju upgrade-charm myapp --path path/to/charm --resource my_image=foo
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1843470
>
> Title:
> juju attach not working in k8s charms
>
> Status in juju:
> Triaged
>
> Bug description:
> The result expected with `juju attach` is supposed to change the
> "tuple" of the charm revision combined with each resource revision and
> trigger upgrade-charm as part of that change.
>
> I am trying to do that, but the upgrade-charm isn't executed.
>
>
> Before running the juju attach:
>
> $ juju show-status-log ro-k8s/0
> Time Type Status Message
> 10 Sep 2019 17:41:41Z workload maintenance fetching resource:
> ro-image
> 10 Sep 2019 17:42:02Z juju-unit executing running leader-elected
> hook
> 10 Sep 2019 17:42:04Z juju-unit executing running config-changed
> hook
> 10 Sep 2019 17:42:08Z juju-unit executing running
> mysql-relation-joined hook
> 10 Sep 2019 17:42:13Z juju-unit executing running
> mysql-relation-changed hook
> 10 Sep 2019 17:42:16Z juju-unit executing running
> ro-relation-joined hook
> 10 Sep 2019 17:42:21Z workload waiting Waiting for mysql to be
> ready
> 10 Sep 2019 17:42:21Z juju-unit executing running
> mysql-relation-changed hook
> 10 Sep 2019 17:42:26Z workload maintenance Configuring ro container
> 10 Sep 2019 17:42:28Z workload maintenance Sending RO configuration
> 10 Sep 2019 17:42:29Z workload waiting Waiting for mysql to be
> ready
> 10 Sep 2019 17:42:29Z juju-unit executing running
> ro-relation-changed hook
> 10 Sep 2019 17:42:31Z workload maintenance Sending RO configuration
> 10 Sep 2019 17:42:33Z workload waiting waiting for container
> 10 Sep 2019 17:42:33Z juju-unit executing running config-changed
> hook
> 10 Sep 2019 17:42:34Z juju-unit allocating Started container ro-k8s
> 10 Sep 2019 17:42:34Z workload waiting Started container ro-k8s
> 10 Sep 2019 17:42:35Z juju-unit executing running
> log-storage-attached hook
> 10 Sep 2019 17:43:01Z juju-unit idle
> 10 Sep 2019 17:43:01Z workload active ready
>
>
> $ juju attach ro-k8s ro-image=
> rocks.canonical.com:5000/canonicalosm/ro:ha-patch
> $ juju show-status-log ro-k8s/0
> Time Type Status Message
> 10 Sep 2019 17:41:41Z workload maintenance fetching resource:
> ro-image
> 10 Sep 2019 17:42:02Z juju-unit executing running leader-elected
> hook
> 10 Sep 2019 17:42:04Z juju-unit executing running config-changed
> hook
> 10 Sep 2019 17:42:08Z juju-unit executing running
> mysql-relation-joined hook
> 10 Sep 2019 17:42:13Z juju-unit executing running
> mysql-relation-changed hook
> 10 Sep 2019 17:42:16Z juju-unit ...

Read more...

Ian Booth (wallyworld)
Changed in juju:
assignee: nobody → Ian Booth (wallyworld)
Ian Booth (wallyworld)
Changed in juju:
status: Triaged → Fix Committed
Changed in juju:
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.