It is not possible to install a build-snap with the default track

Bug #1716054 reported by Leo Arias on 2017-09-08
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
High
Sergio Schvezov

Bug Description

When the track is not specified, latest is used. For example, it is possible to install with:

sudo snap install u1test-snap-with-tracks --channel edge

which would be the same as:

sudo snap install u1test-snap-with-tracks --channel edge

However, when using build-snaps in snapcraft, if I write:

build-snaps: [u1test-snap-with-tracks/edge]

it will fail with:

Traceback (most recent call last):
  File "/home/ubuntu/venv/snapcraft/bin/snapcraft", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/ubuntu/workspace/canonical/snapcraft/bin/snapcraft", line 36, in <module>
    obj=dict(project=snapcraft.ProjectOptions()))
  File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/cli/__init__.py", line 110, in run
    ctx.forward(lifecyclecli.commands['snap'])
  File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 553, in forward
    return self.invoke(cmd, **kwargs)
  File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/cli/lifecycle.py", line 132, in snap
    project_options, directory=directory, output=output)
  File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/lifecycle.py", line 349, in snap
    execute('prime', project_options)
  File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/lifecycle.py", line 120, in execute
    repo.snaps.install_snaps(config.build_snaps)
  File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/repo/snaps.py", line 167, in install_snaps
    snap_pkg.install()
  File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/repo/snaps.py", line 136, in install
    if self.is_classic():
  File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/repo/snaps.py", line 119, in is_classic
    return store_channels[self.channel]['confinement'] == 'classic'
KeyError: 'edge'

To reproduce, build using the snapcraft.yaml from http://paste.ubuntu.com/25492423/ with the latest unreleased snapcraft.

It works when the track is specified:

build-snaps: [u1test-snap-with-tracks/latest/edge]

Changed in snapcraft:
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 2.34
importance: Undecided → High
status: New → Triaged
Changed in snapcraft:
milestone: 2.34 → 2.35
Changed in snapcraft:
status: Triaged → Fix Released
status: Fix Released → Triaged
milestone: 2.35 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers