kpcyrd / rebuilderd

Independent verification of binary packages - reproducible builds
GNU General Public License v3.0
356 stars 26 forks source link

Tails doesn't build anymore :'( #133

Open jvoisin opened 2 years ago

jvoisin commented 2 years ago
$ rebuildctl pkgs sync-profile --sync-config /etc/rebuilderd-sync.conf tails

[…]

Aug 08 16:03:53 rebuilderd rebuilderd-worker[575]: ==> box: Box file was not detected as metadata. Adding it directly...
Aug 08 16:03:53 rebuilderd rebuilderd-worker[575]: ==> box: Adding box 'tails-builder-amd64-bullseye-20220712-fb05d75887' (v0) for provider:
Aug 08 16:03:53 rebuilderd rebuilderd-worker[575]:     box: Unpacking necessary files from: file:///tmp/tails.uOtKYL/tails/tails-builder-amd64-bullseye-20220712-fb05d75887.box
Aug 08 16:03:56 rebuilderd rebuilderd-worker[575]: [239B blob data]
Aug 08 16:03:57 rebuilderd rebuilderd-worker[575]: Bringing machine 'default' up with 'libvirt' provider...
Aug 08 16:03:57 rebuilderd rebuilderd-worker[575]: ==> default: Uploading base box image as volume into Libvirt storage...
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: [47.9K blob data]
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: [24.4K blob data]
Aug 08 16:03:59 rebuilderd libvirtd[32076]: libvirt version: 8.5.0, package: 1 (Andrea Bolognani <eof@kiyuko.org> Sun, 17 Jul 2022 17:12:07 +0200)
Aug 08 16:03:59 rebuilderd libvirtd[32076]: hostname: rebuilderd
Aug 08 16:03:59 rebuilderd libvirtd[32076]: storage volume 'apt-cacher-ng-data.qcow2' exists already
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: Error while creating volume for domain: Call to virStorageVolCreateXML failed: storage volume 'apt-cacher-ng-data.qcow2' exists already
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: rake aborted!
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: VagrantCommandError: 'vagrant ["up", "--provision"]' command failed with exit status 1
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: /tmp/tails.uOtKYL/tails/Rakefile:113:in `rescue in run_vagrant'
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: /tmp/tails.uOtKYL/tails/Rakefile:110:in `run_vagrant'
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: /tmp/tails.uOtKYL/tails/Rakefile:702:in `block (2 levels) in <top (required)>'
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: /usr/share/rubygems-integration/all/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: Caused by:
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: CommandError: command ["vagrant", "up", "--provision"], {:chdir=>"./vagrant"} failed with exit status 1
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: /tmp/tails.uOtKYL/tails/Rakefile:78:in `run_command'
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: /tmp/tails.uOtKYL/tails/Rakefile:111:in `run_vagrant'
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: /tmp/tails.uOtKYL/tails/Rakefile:702:in `block (2 levels) in <top (required)>'
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: /usr/share/rubygems-integration/all/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: Tasks: TOP => build => vm:up
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: (See full trace by running task with --trace)
Aug 08 16:03:59 rebuilderd rebuilderd-worker[575]: + rm -rf -- /tmp/tails.uOtKYL
Aug 08 16:04:00 rebuilderd rebuilderd-worker[575]: [2022-08-08T14:04:00Z INFO  rebuilderd_worker::proc] "/usr/libexec/rebuilderd/rebuilder-tails.sh" exited with exit=exit status: 1, captured 96909 bytes
Aug 08 16:04:00 rebuilderd rebuilderd-worker[575]: [2022-08-08T14:04:00Z INFO  rebuilderd_worker::rebuild] No output artifact found, marking as BAD: "/tmp/rebuilderdER21h5/out/tails-amd64-5.3.1.img"
Aug 08 16:04:00 rebuilderd rebuilderd-worker[575]: [2022-08-08T14:04:00Z INFO  rebuilderd_worker::rebuild] No output artifact found, marking as BAD: "/tmp/rebuilderdER21h5/out/tails-amd64-5.3.1.iso"
Aug 08 16:04:00 rebuilderd rebuilderd-worker[575]: [2022-08-08T14:04:00Z INFO  rebuilderd_worker] Sending build report to rebuilderd...
Aug 08 16:04:00 rebuilderd rebuilderd[578]: [2022-08-08T14:04:00Z INFO  actix_web::middleware::logger] 127.0.0.1:58292 "POST /api/v0/build/report HTTP/1.1" 200 4 "-" "-" 0.050013
Aug 08 16:04:03 rebuilderd rebuilderd-worker[575]: [2022-08-08T14:04:03Z INFO  rebuilderd_worker] Requesting work from rebuilderd...
Aug 08 16:04:03 rebuilderd rebuilderd[578]: [2022-08-08T14:04:03Z INFO  actix_web::middleware::logger] 127.0.0.1:58292 "POST /api/v0/queue/pop HTTP/1.1" 200 9 "-" "-" 0.000366
Aug 08 16:04:03 rebuilderd rebuilderd-worker[575]: [2022-08-08T14:04:03Z INFO  rebuilderd_worker] No pending tasks, sleeping for 180s...
kpcyrd commented 2 years ago

mhm weird, it seems the important part is

Error while creating volume for domain: Call to virStorageVolCreateXML failed: storage volume 'apt-cacher-ng-data.qcow2' exists already

The volume is setup in vagrant/Vagrantfile and has allow_existing set to true:

if ENV['TAILS_PROXY_TYPE'] == 'vmproxy'
  domain.storage(
    :file, size: '15G', allow_existing: true,
    path: 'apt-cacher-ng-data.qcow2'
  )
end

It seems this is a recent regression in vagrant-libvirt, apparently allow_existing works by matching error messages. The anonymous reporter of the issue attached this patch:

From 1ed088924a1560375c353f91f79f4c1cd02de92d Mon Sep 17 00:00:00 2001
From: anonym <anonym@riseup.net>
Date: Wed, 8 Jun 2022 18:21:35 +0000
Subject: [PATCH] Fix allow_existing for disks against newer versions of
 libvirt. (#1507)

When running vagrant-libvirt on an up-to-date Debian unstable with
libvirt 8.4.0 the expected error message doesn't contain the full
path any more.
---
 lib/vagrant-libvirt/action/create_domain.rb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb
index 7899424..9da82d3 100644
--- a/lib/vagrant-libvirt/action/create_domain.rb
+++ b/lib/vagrant-libvirt/action/create_domain.rb
@@ -151,9 +151,11 @@ module VagrantPlugins
             rescue Libvirt::Error => e
               # It is hard to believe that e contains just a string
               # and no useful error code!
-              msg = "Call to virStorageVolCreateXML failed: " +
-                    "storage volume '#{disk[:absolute_path]}' exists already"
-              if e.message == msg and disk[:allow_existing]
+              msgs = [disk[:name], disk[:absolute_path]].map do |name|
+                "Call to virStorageVolCreateXML failed: " +
+                "storage volume '#{name}' exists already"
+              end
+              if msgs.include?(e.message) and disk[:allow_existing]
                 disk[:preexisting] = true
               else
                 raise Errors::FogCreateDomainVolumeError,
-- 
2.36.1