Unable to deploy charm of older revision from channel where an image resource has been removed in newer version

Bug #1991511 reported by Tom Haddon
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
High
Unassigned

Bug Description

For the nginx-ingress-integrator charm we have a `placeholder-image` image resource because the charm itself doesn't actually need a workload resource. Up until Juju 2.9.23 there was no way of having a k8s charm with no workload that couldn't be prevented from being installed on machine models. With `assumes: - k8s-api` in metadata.yaml this is now possible.

So, I've updated nginx-ingress-integrator to include `assumes: - k8s-api` in metadata.yaml and have published it to the edge channel for testing. I've confirmed this charm isn't deployable on machine models, which is great.

However, the next stage of testing is to deploy the old version of the charm (that includes the workload) and then test a charm upgrade to the new version that doesn't include the workload.

To do this I ran the following in a k8s model:
```
juju deploy nginx-ingress-integrator --channel=edge --revision=29 ingress
```
However, this fails with the following in `juju debug-log` (repeated over and over):
```
controller-0: 10:51:26 INFO juju.worker.caasapplicationprovisioner.runner restarting "ingress" in 3s
controller-0: 10:51:29 INFO juju.worker.caasapplicationprovisioner.runner start "ingress"
controller-0: 10:51:29 INFO juju.worker.caasapplicationprovisioner.runner stopped "ingress", err: getting OCI image resources: unable to fetch OCI image resources for ingress: while getting resource from charmhub: resource "placeholder-image" not found
controller-0: 10:51:29 ERROR juju.worker.caasapplicationprovisioner.runner exited "ingress": getting OCI image resources: unable to fetch OCI image resources for ingress: while getting resource from charmhub: resource "placeholder-image" not found
```
And here's the juju status output:
```
$ juju status ingress
Model Controller Cloud/Region Version SLA Timestamp
ingress-test microk8s-localhost microk8s/localhost 2.9.34 unsupported 10:50:58+02:00

App Version Status Scale Charm Channel Rev Address Exposed Message
ingress waiting 0/1 nginx-ingress-integrator edge 29 no installing agent

Unit Workload Agent Address Ports Message
ingress/0 waiting allocating installing agent

```
There are no pods in microk8s for this application.

Tags: canonical-is
Tom Haddon (mthaddon)
tags: added: canonical-is
Revision history for this message
Tom Haddon (mthaddon) wrote :

I've confirmed that I can work around this by running the following:

juju deploy nginx-ingress-integrator --channel=edge --revision=29 --resource placeholder-image='google/pause'

Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.9.36
Revision history for this message
Joseph Phillips (manadart) wrote :

I'm a little unclear on the steps here.

"the next stage of testing is to deploy the old version of the charm (that includes the workload) and then test a charm upgrade to the new version that doesn't include the workload."

Are you deploying the same charm into the model with a different application name here?

What is the mode of "upgrade".

Changed in juju:
status: Triaged → Incomplete
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1991511] Re: Unable to deploy charm of older revision from channel where an image resource has been removed in newer version

The workflow is something like:
1) build a charm, revision 1 that uses a sidecar resource at revision 3
2) new version of the charm, revision 5, no longer has a resource
3) Try to deploy the old version of the charm `juju deploy charm --revision
1` fails because the track of the charm (latest) no longer has a resource
for 'sidecar', but you can force it with `juju deploy charm --revision 1
--resource sidecar=3`

But ultimately that is a workaround. We probably need to work with Charmhub
for them to expose the information about known revisions of resources
associated with an old revision of a charm.

On Thu, Oct 13, 2022 at 8:35 AM Joseph Phillips <email address hidden>
wrote:

> I'm a little unclear on the steps here.
>
> "the next stage of testing is to deploy the old version of the charm
> (that includes the workload) and then test a charm upgrade to the new
> version that doesn't include the workload."
>
> Are you deploying the same charm into the model with a different
> application name here?
>
> What is the mode of "upgrade".
>
> ** Changed in: juju
> Status: Triaged => Incomplete
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1991511
>
> Title:
> Unable to deploy charm of older revision from channel where an image
> resource has been removed in newer version
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1991511/+subscriptions
>
>

Revision history for this message
Tom Haddon (mthaddon) wrote :

"the next stage of testing is to deploy the old version of the charm (that includes the workload) and then test a charm upgrade to the new version that doesn't include the workload."

I was just explaining why I was doing what I was doing. The short version is that trying to run this command fails:

```
juju deploy nginx-ingress-integrator --channel=edge --revision=29 ingress
```

Changed in juju:
status: Incomplete → Triaged
Changed in juju:
milestone: 2.9.36 → 2.9.37
Changed in juju:
milestone: 2.9.37 → 2.9.38
Changed in juju:
milestone: 2.9.38 → 2.9.39
Changed in juju:
milestone: 2.9.39 → 2.9.40
Changed in juju:
milestone: 2.9.40 → 2.9.41
Changed in juju:
milestone: 2.9.41 → 2.9.42
Changed in juju:
milestone: 2.9.42 → 2.9.43
Changed in juju:
milestone: 2.9.43 → 2.9.44
Changed in juju:
milestone: 2.9.44 → 2.9.45
Changed in juju:
milestone: 2.9.45 → 2.9.46
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.