Juju cannot upgrade to 1.26-alpha1

Bug #1489896 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
Critical
Martin Packman

Bug Description

All upgrade jobs failed for the test of commit 5656861.
    http://reports.vapour.ws/releases/3016
^ At this hour, reports is behind, but it will catchup.

There is only one commit between that last tested revision of 1.26-alpha1 and failing revision:
    https://github.com/juju/juju/commit/5656861f7e3f2516aaf1a067d9fee7c876a3de15

Revision history for this message
Martin Packman (gz) wrote :

Well, status is nice and clear now:

machines:
  "0":
    agent-state: error
    agent-state-info: 'upgrade to 1.26-alpha1 failed (giving up): move lastlogin and
      last connection to their own collections: E11000 duplicate key error index:
      juju.userLastLogin.$_id_ dup key: { : "admin" }'
    agent-version: 1.26-alpha1

Puts blame pretty clearly on the commit that changed things.

Martin Packman (gz)
Changed in juju-core:
assignee: nobody → Martin Packman (gz)
status: Triaged → In Progress
Revision history for this message
Martin Packman (gz) wrote :

Reverted the breaking change:

<https://github.com/juju/juju/pull/3145>

It can be relanded with upgrade fix next week.

Changed in juju-core:
status: In Progress → Fix Committed
Revision history for this message
Cheryl Jennings (cherylj) wrote :

I was able to easily reproduce this by running "watch juju status" during an upgrade to 1.26.

The problem stems from users accessing the API during the upgrade. Running status during the upgrade results in the login time being recorded for the user before the MigrateLastLoginAndLastConnection step runs. That step will then fail because it tries to insert a doc for that user's last login time, but the doc already exists.

We could fix this by inserting the lastlogin docs individually and ignoring duplicate key errors. We shouldn't use Upsert in this case, as what's written to the new lastLoginDoc will be more up to date than what's read in through the usersC collection.

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote : Fix Released in juju-core master

Juju-CI verified that this issue is Fix Released in juju-core master:
    http://reports.vapour.ws/releases/3019

Changed in juju-core:
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.