`snapcraft cleanbuild` fails due to faulty apt cache

Only cleanbuild fails… anyone know how to debug this?

$ snapcraft cleanbuild --debug --enable-geoip
Creating snapcraft-despondently-gastroenteric-otis
Starting snapcraft-despondently-gastroenteric-otis
Waiting for a network connection...
Network connection established
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [547 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7532 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [232 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [7204 B]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/restricted Translation-en [2152 B]
Get:10 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [365 kB]
Get:11 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [138 kB]
Get:12 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3456 B]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1744 B]
Get:14 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4354 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [838 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [344 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [7556 B]
Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Translation-en [2272 B]
Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [678 kB]
Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [274 kB]
Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.4 kB]
Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8344 B]
Get:25 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [6756 B]
Get:26 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [4180 B]
Get:27 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [7420 B]
Get:28 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [3996 B]
Fetched 15.9 MB in 10s (1491 kB/s)                 
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package squashfuse
Stopping local:snapcraft-despondently-gastroenteric-otis
The following command failed to run: 'apt-get install squashfuse -y' exited with 100

Have you tried again? Sometimes these package installs failing are a temporary network glitch.

What version of snapcraft are you running?

I just tested on my 16.04 (KDE Neon) laptop and all seems well with snapcraft from the stable channel.

alan@KinkPad-K450:~/test$ snapcraft --version
snsnapcraft, version 2.42.1
alan@KinkPad-K450:~/test$ snap info snapcraft
name:      snapcraft
summary:   easily create snaps
publisher: canonical
contact:   snaps@canonical.com
license:   unknown
description: |
  Package, distribute, and update any app for Linux and IoT.
  
  Snaps are containerised software packages that are simple to create and install. They auto-update
  and are safe to run. And because they bundle their dependencies, they work on all major Linux
  systems without modification.
commands:
  - snapcraft
snap-id:      vMTKRaLjnOJQetI78HjntT37VuoyssFE
tracking:     stable
refresh-date: 4 days ago, at 09:52 BST
channels:                                  
  stable:    2.42.1            (1594) 33MB classic
  candidate: 2.43              (1803) 29MB classic
  beta:      ↑                             
  edge:      2.43+git3.160a4a8 (1817) 29MB classic
installed:   2.42.1            (1594) 33MB classic
alan@KinkPad-K450:~/test$ snapcraft init
Created snap/snapcraft.yaml.
Edit the file to your liking or run `snapcraft` to get started
aalan@KinkPad-K450:~/test$ snapcraft cleanbuild
Creating snapcraft-indefatigably-covinous-isiah
Starting snapcraft-indefatigably-covinous-isiah
Waiting for a network connection...
Network connection established
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                             
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]                                    
Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]       
Get:5 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7532 kB]             
Get:6 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [547 kB]        
Get:7 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4354 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [232 kB] 
Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [365 kB]              
Get:10 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [138 kB]      
Get:11 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]                      
Get:12 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3456 B]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [838 kB]
Get:15 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1744 B]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [344 kB]   
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [678 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [274 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.4 kB]
Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8344 B]
Get:21 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [6756 B]
Get:22 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [4180 B]
Get:23 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [7420 B]
Get:24 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [3996 B]
Fetched 15.9 MB in 3s (4298 kB/s)                               
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  squashfuse
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 17.4 kB of archives.
After this operation, 54.3 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 squashfuse amd64 0.1.100-0ubuntu1~ubuntu16.04.1 [17.4 kB]
Fetched 17.4 kB in 0s (236 kB/s)   
Selecting previously unselected package squashfuse.
(Reading database ... 25666 files and directories currently installed.)
Preparing to unpack .../squashfuse_0.1.100-0ubuntu1~ubuntu16.04.1_amd64.deb ...
Unpacking squashfuse (0.1.100-0ubuntu1~ubuntu16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up squashfuse (0.1.100-0ubuntu1~ubuntu16.04.1) ...
error: no changes of type "auto-refresh" found
Looking up assertion ['account-key', 'public-key-sha3-384=BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul']
Looking up assertion ['snap-declaration', 'snap-name=core']
Looking up assertion ['snap-revision', 'snap-revision=5145', 'snap-id=99T7MUlRhtI3U0QFgl5mXXESAiSwt776']
Adding assertion core_5145.assert                                                                                                     
Installing /run/core_5145.snap                                                                                                    
2018-08-25T20:37:18Z INFO Waiting for restart...
core 16-2.34.3 from 'canonical' installed
Looking up assertion ['account-key', 'public-key-sha3-384=BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul']
Looking up assertion ['snap-declaration', 'snap-name=snapcraft']
Looking up assertion ['snap-revision', 'snap-revision=1594', 'snap-id=vMTKRaLjnOJQetI78HjntT37VuoyssFE']
Adding assertion snapcraft_1594.assert                                                                                                          
Installing /run/snapcraft_1594.snap                                                                                                         
snapcraft 2.42.1 from 'canonical' installed
Setting up container with project assets
./                                                                                                                                                
./snap/
./snap/snapcraft.yaml
Preparing to pull my-part 
Pulling my-part 
Preparing to build my-part 
Building my-part 
Staging my-part 
Priming my-part 
Snapping 'my-snap-name' |                                                                                                                                                     
Snapped my-snap-name_0.1_amd64.snap
Retrieved my-snap-name_0.1_amd64.snap
Stopping local:snapcraft-indefatigably-covinous-isiah

I’m currently suspecting there’s a faulty transparent proxy that causes the issue as the issue isn’t reproduced on another ISP’s network.

1 Like

This time the similar problem is reproduced with --enable-geoip's local mirror:

$ snapcraft cleanbuild --enable-geoip --debug
Creating snapcraft-saccharinely-unbrushed-shantae
Starting snapcraft-saccharinely-unbrushed-shantae
Waiting for a network connection...
Network connection established
Hit:1 http://tw.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://tw.archive.ubuntu.com/ubuntu xenial-updates InRelease
Get:3 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Hit:4 http://tw.archive.ubuntu.com/ubuntu xenial-security InRelease
Get:5 http://tw.archive.ubuntu.com/ubuntu xenial/main Sources [868 kB]
Get:6 http://tw.archive.ubuntu.com/ubuntu xenial/restricted Sources [4808 B]
Get:7 http://tw.archive.ubuntu.com/ubuntu xenial/universe Sources [7728 kB]
Get:8 http://tw.archive.ubuntu.com/ubuntu xenial/multiverse Sources [179 kB]      
Get:9 http://tw.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7532 kB]
Get:10 http://tw.archive.ubuntu.com/ubuntu xenial/universe Translation-en [4354 kB]
Get:11 http://tw.archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Get:12 http://tw.archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
Ign:13 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main Sources
Get:14 http://tw.archive.ubuntu.com/ubuntu xenial-updates/restricted Sources [2528 B]
Ign:15 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe Sources
Get:16 http://tw.archive.ubuntu.com/ubuntu xenial-updates/multiverse Sources [8408 B]
Ign:17 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
Ign:18 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en
Get:19 http://tw.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.4 kB]
Get:20 http://tw.archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8344 B]
Get:21 http://tw.archive.ubuntu.com/ubuntu xenial-backports/main Sources [4488 B]
Get:22 http://tw.archive.ubuntu.com/ubuntu xenial-backports/universe Sources [6740 B]
Get:23 http://tw.archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [6756 B]
Get:24 http://tw.archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [4180 B]
Get:25 http://tw.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [7420 B]
Get:26 http://tw.archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [3996 B]
Ign:27 http://tw.archive.ubuntu.com/ubuntu xenial-security/main Sources
Get:28 http://tw.archive.ubuntu.com/ubuntu xenial-security/restricted Sources [2116 B]
Ign:29 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe Sources
Get:30 http://tw.archive.ubuntu.com/ubuntu xenial-security/multiverse Sources [2088 B]
Ign:31 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
Ign:32 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe Translation-en
Get:33 http://tw.archive.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3456 B]
Get:34 http://tw.archive.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1744 B]
Get:13 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main Sources [319 kB]
Err:13 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main Sources
  Hash Sum mismatch
Get:15 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe Sources [219 kB]
Err:15 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe Sources
  
Get:17 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [681 kB]
Err:17 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
  
Get:18 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [275 kB]
Err:18 http://tw.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en
  
Get:27 http://tw.archive.ubuntu.com/ubuntu xenial-security/main Sources [132 kB]
Err:27 http://tw.archive.ubuntu.com/ubuntu xenial-security/main Sources
  Hash Sum mismatch
Get:29 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe Sources [72.8 kB]
Err:29 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe Sources
  
Get:31 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [369 kB]
Err:31 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
  
Get:32 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe Translation-en [140 kB]
Err:32 http://tw.archive.ubuntu.com/ubuntu xenial-security/universe Translation-en
  
Fetched 23.3 MB in 5s (3955 kB/s)                              
Reading package lists... Done
E: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/source/Sources.xz  Hash Sum mismatch
E: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/source/Sources.xz  
E: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/binary-amd64/Packages.xz  
E: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/i18n/Translation-en.xz  
E: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-security/main/source/Sources.xz  Hash Sum mismatch
E: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-security/universe/source/Sources.xz  
E: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-amd64/Packages.xz  
E: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-security/universe/i18n/Translation-en.xz  
E: Some index files failed to download. They have been ignored, or old ones used instead.
Stopping local:snapcraft-saccharinely-unbrushed-shantae
The following command failed to run: 'apt-get update' exited with 100

Only reproduced in cleanbuild LXD container, don’t know exactly why.