snapcraft kernel: Failed to download 'ubuntu-core/edge'

Bug #1569734 reported by Gunther Laure
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Sergio Schvezov

Bug Description

Using the "kernel" plugin the snapcraft always tries to download an os image using the store api.

Often this step fail with "Failed to download 'ubuntu-core/edge'"

snapcraft -v
2.7

Revision history for this message
Gunther Laure (gunther-laure-e) wrote :

snapcraft -d pull
Loaded local plugin for kernel
Preparing to pull kernel
Pulling kernel
From git://kernel.ubuntu.com/ubuntu/ubuntu-xenial
 * branch HEAD -> FETCH_HEAD
Already up-to-date.
Getting details for 'ubuntu-core/edge'
Encoding URI, headers and body to utf-8.
Downloading 'ubuntu-core/edge'
Encoding URI, headers and body to utf-8.
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 31, in <module>
    snapcraft.main.main()
  File "/usr/lib/python3/dist-packages/snapcraft/main.py", line 126, in main
    commands.load(cmd).main(argv=args['ARGS'])
  File "/usr/lib/python3/dist-packages/snapcraft/commands/pull.py", line 39, in main
    lifecycle.execute('pull', args['PART'])
  File "/usr/lib/python3/dist-packages/snapcraft/lifecycle.py", line 53, in execute
    _Executor(config).run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/lifecycle.py", line 81, in run
    self._run_step(step, part, part_names, dirty, recursed)
  File "/usr/lib/python3/dist-packages/snapcraft/lifecycle.py", line 116, in _run_step
    getattr(part, step)()
  File "/usr/lib/python3/dist-packages/snapcraft/pluginhandler.py", line 270, in pull
    self.code.pull()
  File "/home/glaure/Mercurial/ubuntu-xenial/parts/plugins/x-kernel.py", line 306, in pull
    'ubuntu-core/edge', self.os_snap, config, self._target_arch['deb'])
  File "/usr/lib/python3/dist-packages/snapcraft/storeapi/_download.py", line 56, in download
    raise RuntimeError('Failed to download {!r}'.format(snap))
RuntimeError: Failed to download 'ubuntu-core/edge'

description: updated
Revision history for this message
Gunther Laure (gunther-laure-e) wrote :

Sorry do not be confused with x-kernel.py. I copied kernel.py from /usr/lib/python3/dist-packages/snapcraft/plugins to patch the initrd decompression from gzip to xz.
Everything else is completely unchanged

Revision history for this message
Gunther Laure (gunther-laure-e) wrote :

My proposal to solve such issues:

    - kernel-os-snap:
      (string, optional)
      provide a local os.snap file. If provided no os.snap has to be downloaded during the pull phase.

kernel.py:

    def pull(self):
        super().pull()
        config = load_config()

        if self.options.kernel_os_snap:
            logger.info('local os image: {0}, os={1}'.format(
                self.options.kernel_os_snap, self.os_snap))
            if os.path.exists(self.options.kernel_os_snap):
                shutil.copyfile(self.options.kernel_os_snap, self.os_snap)
        else:
            logger.info('storeapi os image: channel={0}, os={1}, arch={2}'.format(
            'ubuntu-core/edge', self.os_snap, self._target_arch['deb']))

            storeapi.download(
                'ubuntu-core/edge', self.os_snap, config, self._target_arch['deb'])

Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: New → In Progress
importance: Undecided → Medium
importance: Medium → High
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 2.8.1
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
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.