upgrade-juju --version increments supplied patch version

Bug #1626784 reported by Christopher Lee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Andrew Wilkins

Bug Description

When using juju-upgrade with the --version argument, the agent version used is the supplied version with an incremented patch version.

For instance, ask for 2.0-rc2.2 and juju uses '2.0-rc2.3'

Example recreation:
  $ rc1/bin/juju bootstrap --constraints mem=2G charm-test lxd/localhost
  $ rc2/bin/juju upgrade-juju -m charm-test:controller --version 2.0-rc2.2

  no prepackaged tools available, using local agent binary 2.0-rc2.3
  started upgrade to 2.0-rc2.3

Revision history for this message
Tim Penhey (thumper) wrote :

This seems strange to me. There is no indication what the rc2 binary is.

I'm taking a wild stab in the dark and assuming it is a build of master as of rc2 time.

Specifying a particular version when said version doesn't exist in streams is a bit strange.
I'd expect the following to work better:

  $ rc1/bin/juju bootstrap --constraints mem=2G charm-test lxd/localhost
  $ rc2/bin/juju upgrade-juju -m charm-test:controller

Changed in juju:
status: New → Incomplete
Revision history for this message
Christopher Lee (veebers) wrote :

Oops, you're right about the binaries. To clarify:

$ rc1/bin/juju --version
2.0-rc1-xenial-amd64

$ rc2/bin/juju --version
2.0-rc2-xenial-amd64

Revision history for this message
Tim Penhey (thumper) wrote :

Right, in that case, it makes sense to try what I specified.

Revision history for this message
Christopher Lee (veebers) wrote :

Added extra irc convo details:

13:29 <thumper> behaviour around this is a bit different now I think
13:29 <thumper> we don't have the ability for force an upload of the tools you have locally
...
13:29 <thumper> only always build, or use a defined value
13:29 <thumper> and it expects to find that defined one in streams

Revision history for this message
Andrew Wilkins (axwalk) wrote :

I can reproduce this issue.

1. bootstrap 2.0rc1:

  juju bootstrap lxd lxd --config agent-metadata-url=http://juju-dist.s3.amazonaws.com/parallel-testing/agents --config agent-stream=revision-build-4415

2. Confirmed that the stream has 2.0rc2 agents, using github.com/axw/juju-tools.

3. with "2.0rc2" (master), ran upgrade-juju:

  juju upgrade-juju -m controller --version 2.0-rc2

This doesn't use the 2.0rc2 agents in the stream, and does an upload instead.

Changed in juju:
status: Incomplete → Triaged
importance: Undecided → High
milestone: none → 2.0-rc2
Andrew Wilkins (axwalk)
Changed in juju:
assignee: nobody → Andrew Wilkins (axwalk)
status: Triaged → In Progress
Revision history for this message
Andrew Wilkins (axwalk) wrote :

The problem occurs when the bootstrap agent version doesn't exist in the stream. I bootstrapped with a 2.0rc1 client, but there are no agents for that in the stream I pointed at, so bootstrap auto-built and uploaded. Because it was built-from-source, the agent version has a build number added, and it becomes 2.0rc1.1.

When the agent has a non-zero build number, upgrade-juju is forcing uploads. We should only be uploading if:
 - the specified agent isn't in the stream, or
 - the user specified --build-agent

Revision history for this message
Andrew Wilkins (axwalk) wrote :
Andrew Wilkins (axwalk)
Changed in juju:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
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.