snapcraft container builds with snap try

Bug #1729069 reported by Sergio Schvezov on 2017-10-31
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Medium
Unassigned

Bug Description

If you `snap try prime` in the snapcraft directory when container builds are enabled, a cp traceback is raised as the code is expecting a file copy instead of a directory, we should error out correctly (unsupported) and/or support it.

Making snapcraft_x4.snap user-accessible
cp: -r not specified; omitting directory '/var/lib/snapd/snaps/snapcraft_x4.snap'
Stopping local:snapcraft-hooks
Traceback (most recent call last):
  File "/snap/snapcraft/x4/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.34', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/x4/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/snap/snapcraft/x4/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/snap/snapcraft/x4/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/snap/snapcraft/x4/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/snapcraft/cli/__main__.py", line 19, in <module>
    run(prog_name='snapcraft')
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/snapcraft/cli/__init__.py", line 118, in run
    ctx.forward(lifecyclecli.commands['snap'])
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/click/core.py", line 553, in forward
    return self.invoke(cmd, **kwargs)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 137, in snap
    container_config, output, directory)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_containers.py", line 51, in containerbuild
    metadata=config.get_metadata()).execute(step, args)
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 131, in execute
    self._inject_snapcraft()
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 203, in _inject_snapcraft
    self._inject_snap('snapcraft')
  File "/snap/snapcraft/x4/lib/python3.6/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 246, in _inject_snap
    subprocess.check_call(['sudo', 'cp', installed, filepath])
  File "/snap/snapcraft/x4/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', 'cp', '/var/lib/snapd/snaps/snapcraft_x4.snap', '/home/sergiusens/snap/lxd/common/snapcraftflm_wnwd/snapcraft_x4.snap']' returned non-zero exit status 1.

tags: added: cleanbuild
tags: added: container
removed: cleanbuild
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers