snapcraft fails if it needs to pull a deb that has an uninstallable version on the system

Bug #1497453 reported by Jamie Strandboge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Sergio Schvezov

Bug Description

I run a wily kernel on a vivid system. I tried to use snapcraft with the following procedure:

$ cd /tmp
$ bzr branch lp:ufw
...
$ cd ./ufw

$ cat > snapcraft.yaml <<EOM
name: ufw
version: 0.35~-1
vendor: Jamie Strandboge <email address hidden>
summary: program for managing a Netfilter firewall
description: Uncomplicated FireWall is a front-end for iptables, to make managing a Netfilter firewall easier. It provides a command line interface with syntax similar to OpenBSD's Packet Filter. It is particularly well-suited as a host-based firewall.
icon: icon.png
parts:
  ufw:
    type: python3-project
    source: .
EOM

$ cp /usr/share/icons/hicolor/64/mimetypes/text-x-apport.png ./icon.png

$ snapcraft stage
Pulling python3
Get:1 dh-python_1.20141111-2ubuntu1_all.deb [65.1 kB]
Fetched 65.1 kB in 0s (0 B/s)
Get:1 libc-dev-bin_2.21-0ubuntu4_amd64.deb [68.6 kB]
Fetched 68.6 kB in 0s (0 B/s)
Get:1 libc6-dev_2.21-0ubuntu4_amd64.deb [1967 kB]
Fetched 1967 kB in 0s (0 B/s)
Get:1 libexpat1_2.1.0-6ubuntu1.1_amd64.deb [70.8 kB]
Fetched 70.8 kB in 0s (0 B/s)
Get:1 libexpat1-dev_2.1.0-6ubuntu1.1_amd64.deb [115 kB]
Fetched 115 kB in 0s (0 B/s)
Get:1 libffi6_3.2.1-2_amd64.deb [17.7 kB]
Fetched 17.7 kB in 0s (0 B/s)
Get:1 libmpdec2_2.4.1-1_amd64.deb [82.7 kB]
Fetched 82.7 kB in 0s (0 B/s)
Get:1 libpython3-dev_3.4.3-1_amd64.deb [7094 B]
Fetched 7094 B in 0s (0 B/s)
Get:1 libpython3-stdlib_3.4.3-1_amd64.deb [6986 B]
Fetched 6986 B in 0s (0 B/s)
Get:1 libpython3.4_3.4.3-3_amd64.deb [1312 kB]
Fetched 1312 kB in 0s (0 B/s)
Get:1 libpython3.4-dev_3.4.3-3_amd64.deb [22.8 MB]
Fetched 22.8 MB in 0s (0 B/s)
Get:1 libpython3.4-minimal_3.4.3-3_amd64.deb [466 kB]
Fetched 466 kB in 0s (0 B/s)
Get:1 libpython3.4-stdlib_3.4.3-3_amd64.deb [2053 kB]
Fetched 2053 kB in 0s (0 B/s)
Get:1 libsqlite3-0_3.8.7.4-1ubuntu0.1_amd64.deb [371 kB]
Fetched 371 kB in 0s (0 B/s)
Get:1 libssl1.0.0_1.0.1f-1ubuntu11.4_amd64.deb [853 kB]
Fetched 853 kB in 0s (0 B/s)
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 33, in <module>
    snapcraft.main.main()
  File "/usr/lib/python3/dist-packages/snapcraft/main.py", line 80, in main
    args.func(args)
  File "/usr/lib/python3/dist-packages/snapcraft/cmds.py", line 326, in cmd
    if not getattr(part, cmd)(force=force):
  File "/usr/lib/python3/dist-packages/snapcraft/plugin.py", line 193, in pull
    self.code.setup_stage_packages()
  File "/usr/lib/python3/dist-packages/snapcraft/__init__.py", line 105, in setup_stage_packages
    ubuntu.get(self.PLUGIN_STAGE_PACKAGES + part_stage_packages)
  File "/usr/lib/python3/dist-packages/snapcraft/repo.py", line 59, in get
    self.apt_cache[pkg].candidate.fetch_binary(destdir=self.download_dir)
  File "/usr/lib/python3/dist-packages/apt/package.py", line 590, in fetch_binary
    self.size, base, destfile=destfile)
TypeError: argument 2 must be str, not None
[1]

Turned out to be <Version: package:'linux-libc-dev' version:'4.0.0-4.6'> was the problem. 3.19.0-28.30 is the only available version on my system. Two things:
 1. snapcraft should use its own sources.list and cache to avoid this sort of thing
 2. the error output didn't indicate the progress well enough for me to know what the problem was (from the above, it looked like libssl1.0.0 was the issue, but it wasn't)

Related branches

Changed in snapcraft:
status: New → Fix Committed
Changed in snapcraft:
milestone: none → 0.2
assignee: nobody → Sergio Schvezov (sergiusens)
Changed in snapcraft:
importance: Undecided → High
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.