race condition in charm upload

Bug #1653562 reported by Jason Hobbs
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

I have a test that creates many applications from a local charm. In parallel, i have 5 threads running that do:

for i in x to y:
   juju deploy ./small-charm small{$i}

The charms all have the same name and get assigned a full name like "local:xenial/small-charm-999", the number being dependent on the order the charm gets uploaded.

Sometimes I'll get an error:
ERROR cannot upload charm: already exists

I guess more than one upload is trying to claim the same name - looks like a race condition.

This is with juju2.1-beta3

tags: added: race-condition
Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.2.0
milestone: 2.2.0 → 2.1.0
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Removing 2.1 milestone as we will not be addressing this issue in 2.1.

Changed in juju:
milestone: 2.1-rc2 → none
Revision history for this message
Paul Gear (paulgear) wrote :

This can also occur during charm upgrades. Retrying the upgrade usually works:

[master*]paulgear@peleg:/srv/branches/canonical-livepatch-charm$ juju upgrade-charm --path $JUJU_REPOSITORY/builds/canonical-livepatch canonical-livepatch
ERROR cannot upload charm: already exists
[master*]paulgear@peleg:/srv/branches/canonical-livepatch-charm$ juju upgrade-charm --path $JUJU_REPOSITORY/builds/canonical-livepatch canonical-livepatch
Added charm "local:xenial/canonical-livepatch-1" to the model.

tags: added: canonical-is
description: updated
Revision history for this message
Paul Collins (pjdc) wrote :

I ran into this today with a couple of 2.4.3 controllers, e.g.:

(juju2-jaas-azure-westeurope-001)prodstack-cdo@wekufe:~$ juju upgrade-charm --path /srv/mojo/$MOJO_PROJECT/$MOJO_SERIES/$MOJO_WORKSPACE/charms/$MOJO_SERIES/nrpe nrpe
ERROR cannot upload charm: already exists
(juju2-jaas-azure-westeurope-001)prodstack-cdo@wekufe:~$ juju upgrade-charm --path /srv/mojo/$MOJO_PROJECT/$MOJO_SERIES/$MOJO_WORKSPACE/charms/$MOJO_SERIES/nrpe nrpe
Added charm "local:xenial/nrpe-1" to the model.
(juju2-jaas-azure-westeurope-001)prodstack-cdo@wekufe:~$ _

Revision history for this message
Junien F (axino) wrote :

controller logs on the ERROR, as per bug 1805990

2018-11-30 08:21:22 ERROR juju.apiserver charms.go:479 returning error from POST /model/<uuid>/charms?%3Amodeluuid=<uuid>&revision=0&schema=local&series=xenial: [{github.com/juju/juju/apiserver/charms.go:69: } {github.com/juju/juju/apiserver/charms.go:61: cannot upload charm} {github.com/juju/juju/apiserver/charms.go:104: } {github.com/juju/juju/apiserver/charms.go:256: } {github.com/juju/juju/state/charm.go:678: } {github.com/juju/juju/state/charm.go:169: already exists}]

Revision history for this message
Junien F (axino) wrote :

This bug is still present on 2.4.5.

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: High → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.