Amulet breaks when inspecting the relation-sentry regarding charms not in charmstore

Bug #1319437 reported by Liam Young
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Amulet
Fix Released
High
Unassigned

Bug Description

Release: Trusty
Providor: LXC
amulet 1.5.0-0ubuntu1~ubuntu14.04.1~ppa1
juju-core 1.18.3-0ubuntu1~14.04.1~juju1
juju-deployer 0.3.6-0ubuntu2
juju-local 1.18.3-0ubuntu1~14.04.1~juju1
juju-mongodb 2.4.9-0ubuntu3

When I interrogate the relation sentry for charms which are not yet in the charm store I'm getting a "request failed with: 404" and it seems to be trying to query https://manage.jujucharms.com/api/3/charm/...

I have tried with charms stored on local filesystem and in lp. Below is an example:

>>> import amulet
>>> d = amulet.Deployment(series='trusty', juju_env='local',)
>>> d.add('nova-cell', charm='lp:~gnuoy/charms/precise/nova-cell/trunk')
>>> d.add('nova-cloud-controller', charm='lp:~gnuoy/charms/precise/nova-cloud-controller/cell-support')
>>> d.relate('nova-cell:cell', 'nova-cloud-controller:cell')
>>> d.configure('nova-cell', {'cell_name': 'api', 'cell_type': 'api'})
>>> d.setup()
2014-05-14 15:53:00 Starting deployment of local
2014-05-14 15:53:11 Deploying services...
2014-05-14 15:53:11 Deploying service nova-cell using local:trusty/nova-cell
2014-05-14 15:53:12 Deploying service nova-cell-sentry using local:trusty/nova-cell-sentry
2014-05-14 15:53:13 Deploying service nova-cloud-controller using local:trusty/nova-cloud-controller
2014-05-14 15:53:14 Deploying service nova-cloud-controller-sentry using local:trusty/nova-cloud-controller-sentry
2014-05-14 15:53:14 Deploying service relation-sentry using local:trusty/relation-sentry
2014-05-14 15:53:20 Config specifies num units for subordinate: nova-cell-sentry
2014-05-14 15:53:20 Config specifies num units for subordinate: nova-cloud-controller-sentry
<fix relation-sentry install error>
2014-05-14 15:56:24 Adding relations...
2014-05-14 15:56:25 Adding relation nova-cell:juju-info <-> nova-cell-sentry:juju-info
2014-05-14 15:56:25 Adding relation nova-cloud-controller:juju-info <-> nova-cloud-controller-sentry:juju-info
2014-05-14 15:56:25 Adding relation relation-sentry:provides-nova-cell_cell-nova-cloud-controller_cell <-> nova-cell:cell
2014-05-14 15:56:25 Adding relation relation-sentry:requires-nova-cell_cell-nova-cloud-controller_cell <-> nova-cloud-controller:cell
2014-05-14 15:57:25 Exposing service 'nova-cell-sentry'
2014-05-14 15:57:25 Exposing service 'nova-cloud-controller-sentry'
2014-05-14 15:57:25 Exposing service 'relation-sentry'
2014-05-14 15:57:25 Deployment complete in 74.66 seconds
>>> cell_unit = d.sentry.unit['nova-cell/0']
>>> rel_info = cell_unit.relation('cell','nova-cloud-controller:cell')
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/charmworldlib/charm.py", line 178, in _fetch
    revision=revision))
  File "/usr/lib/python3/dist-packages/charmworldlib/api.py", line 19, in get
    return self.fetch_json(endpoint, params, 'get')
  File "/usr/lib/python3/dist-packages/charmworldlib/api.py", line 27, in fetch_json
    raise Exception('Request failed with: %s' % r.status_code)
Exception: Request failed with: 404

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/amulet/sentry.py", line 112, in relation
    rel_data = get_relation(self.info['service'], from_rel)
  File "/usr/lib/python3/dist-packages/amulet/charm.py", line 16, in get_relation
    c = get_charm(charm)
  File "/usr/lib/python3/dist-packages/amulet/charm.py", line 115, in get_charm
    return Charm(charm_path)
  File "/usr/lib/python3/dist-packages/charmworldlib/charm.py", line 148, in __init__
    self._fetch(charm_id)
  File "/usr/lib/python3/dist-packages/charmworldlib/charm.py", line 181, in _fetch
    raise CharmNotFound('API request failed: %s' % str(e))
charmworldlib.charm.CharmNotFound: API request failed: Request failed with: 404
>>>

Liam Young (gnuoy)
summary: - Amulet breaks when insepcting relation-sentry regarding charms not in
- charmstore
+ Amulet breaks when inspecting the relation-sentry regarding charms not
+ in charmstore
Marco Ceppi (marcoceppi)
Changed in amulet:
status: New → Confirmed
milestone: none → 1.5.1
importance: Undecided → High
status: Confirmed → Triaged
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Fixed as of amulet 1.8, in which sentries were rewritten:

>>> import amulet
>>> d = amulet.Deployment(series='trusty', juju_env='local',)
>>> d.add('nova-cell', charm='lp:~gnuoy/charms/precise/nova-cell/trunk')
>>> d.add('nova-cloud-controller', charm='lp:~gnuoy/charms/precise/nova-cloud-controller/cell-support')
>>> d.relate('nova-cell:cell', 'nova-cloud-controller:cell')
>>> d.configure('nova-cell', {'cell_name': 'api', 'cell_type': 'api'})
>>> d.setup()
2014-12-18 11:25:01 Starting deployment of local
2014-12-18 11:25:02 Deploying services...
2014-12-18 11:25:02 Deploying service nova-cell using local:trusty/nova-cell
2014-12-18 11:25:06 Deploying service nova-cloud-controller using local:trusty/nova-cloud-controller
2014-12-18 11:27:58 Adding relations...
2014-12-18 11:27:58 Adding relation nova-cell:cell <-> nova-cloud-controller:cell
2014-12-18 11:28:59 Deployment complete in 238.08 seconds
>>> cell_unit = d.sentry.unit['nova-cell/0']
>>> rel_info = cell_unit.relation('cell','nova-cloud-controller:cell')
>>>

Changed in amulet:
status: Triaged → 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.