Model default series is not honoured - wrong series gets deployed

Bug #1927135 reported by Peter Matulis
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Simon Richardson
Snap Store Server
Fix Released
High
Guillermo Gonzalez

Bug Description

When a default series is set on the model it is not honoured during the deployment of a charm. Some other series gets deployed instead. This only appears to affect the new charm store; the old charm store is fine.

$ juju add-model --config default-series=focal openstack

$ juju deploy ch:nova-compute nova-compute-ch-def

$ juju deploy cs:nova-compute nova-compute-cs-def

$ juju status
Model Controller Cloud/Region Version SLA Timestamp
openstack serverstack serverstack/serverstack 2.9.0 unsupported 14:50:43Z

App Version Status Scale Charm Store Channel Rev OS Message
nova-compute-ch-def waiting 0/1 nova-compute charmhub stable 539 ubuntu waiting for machine
nova-compute-cs-def waiting 0/1 nova-compute charmstore stable 327 ubuntu waiting for machine

Unit Workload Agent Machine Public address Ports Message
nova-compute-ch-def/0 waiting allocating 0 10.5.0.7 waiting for machine
nova-compute-cs-def/0 waiting allocating 1 10.5.0.8 waiting for machine

Machine State DNS Inst id Series AZ Message
0 pending 10.5.0.7 f4c76b44-202c-4c81-af7c-83060a95cf7b xenial nova ACTIVE
1 pending 10.5.0.8 7fbeaad4-6fc5-447b-a791-e05a9b921267 focal nova ACTIVE

Tags: charmhub
Revision history for this message
Daniel Manrique (roadmr) wrote :

So, the revision of the charm is correct (539 is the latest in charmhub, and should map to 327 on charmstore). The charm payload actually is the same and does support focal.

In the two-phase request that Juju makes, it first does an "invalid base" request, and in here the charmhub API *is* reporting xenial as the sole available base:

$ curl -XPOST -s https://api.charmhub.io/v2/charms/refresh -H 'Content-type: application/json' -d '{"context": [], "actions": [{"name": "nova-compute", "base": {"architecture": "amd64", "name": "NA", "channel": "NA"}, "channel": "stable", "action": "install", "instance-key": "a-test"}]}' | jq
{
  "error-list": [],
  "results": [
    {
      "charm": null,
      "error": {
        "code": "invalid-charm-base",
        "extra": {
          "default-bases": [
            {
              "architecture": "amd64",
              "channel": "16.04",
              "name": "ubuntu"
            }
          ]
        },
        "message": "Instance key 'a-test' invalid 'base' in 'install' for charm_id=ubPbvtErosR9P4NGEt24wak8LDsczRi4 name=nova-compute"
      },
      "id": "ubPbvtErosR9P4NGEt24wak8LDsczRi4",
      "instance-key": "a-test",
      "name": "nova-compute",
      "released-at": null,
      "result": "error"
    }
  ]
}

then Juju uses that as the series to deploy.

We'll have a closer look at how the available bases are calculated for this snap.

Changed in snapstore-server:
status: New → Confirmed
Revision history for this message
Daniel Manrique (roadmr) wrote :

In the channelmap for stable / ubuntu 20.04, xenial comes first, but there are also others, which I would expect to be offered in the invalid base thing above.

{
      "channel": {
        "base": {
          "architecture": "all",
          "channel": "20.04",
          "name": "ubuntu"
        },
        "name": "stable",
        "released-at": "2021-05-03T15:18:56.357860+00:00",
        "risk": "stable",
        "track": "latest"
      },
      "revision": {
        "bases": [
          {
            "architecture": "all",
            "channel": "16.04",
            "name": "ubuntu"
          },
          {
            "architecture": "all",
            "channel": "18.04",
            "name": "ubuntu"
          },
          {
            "architecture": "all",
            "channel": "20.04",
            "name": "ubuntu"
          },
          {
            "architecture": "all",
            "channel": "20.10",
            "name": "ubuntu"
          },
          {
            "architecture": "all",
            "channel": "21.04",
            "name": "ubuntu"
          }
        ],
        "created-at": "2021-05-03T11:44:28.223000+00:00",
        "download": {
          "hash-sha-256": "f9c71b551dc221c5de25ed1fc68dc516af6c602d1bc6a753a9005fae9a61fd39",
          "size": 530465,
          "url": "https://api.charmhub.io/api/v1/charms/download/ubPbvtErosR9P4NGEt24wak8LDsczRi4_539.charm"
        },
        "revision": 539,
        "version": "539"
      }

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

The API response is for 16.04 because that's the preferred series in the charm metadata, and as agreed with Juju devs the API should return a single item in the default bases for the preferred series.

We can easily change the response to include all the supported bases, but juju will probably not use it, something to check with them.

Revision history for this message
John A Meinel (jameinel) wrote :

So I think this is actually a Juju issue, that when deploying from charmhub we ignore the 'default-series' in the model.
Without default-series being set, I would expect both of them to be defaulting to xenial.

Changed in juju:
importance: Undecided → High
milestone: none → 2.9.2
status: New → Triaged
Changed in juju:
milestone: 2.9.2 → 2.9.3
Changed in juju:
assignee: nobody → Simon Richardson (simonrichardson)
status: Triaged → In Progress
Changed in snapstore-server:
importance: Undecided → High
assignee: nobody → Guillermo Gonzalez (verterok)
Changed in snapstore-server:
status: Confirmed → In Progress
Changed in snapstore-server:
status: In Progress → Fix Committed
Revision history for this message
Simon Richardson (simonrichardson) wrote :
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
Changed in snapstore-server:
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.