Bug 1575640

Summary: virt-builder: error: host cpu (x86_64) and guest arch (unknown) are not compatible
Product: [Fedora] Fedora Reporter: Martin Pitt <mpitt>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: dmitrykuzn, marcandre.lureau, mgoldman, rjones
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.38.2-1.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1590517 (view as bug list) Environment:
Last Closed: 2018-05-25 15:05:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1590517    

Description Martin Pitt 2018-05-07 13:53:45 UTC
Description of problem: Since upgrading from Fedora 27 to 28, virt-builder is broken for me:


❱❱❱ virt-builder ubuntu-18.04  --output /tmp/x.qcow2 --format qcow2  --root-password password:foobar  --run-command 'whoami'
[   0,8] Downloading: http://libguestfs.org/download/builder/ubuntu-18.04.xz
[   1,6] Planning how to build this image
[   1,6] Uncompressing
[  15,6] Converting raw to qcow2
[  16,7] Opening the new disk
[  30,9] Setting a random seed
virt-builder: warning: random seed could not be set for this type of guest
[  30,9] Running: whoami
virt-builder: error: host cpu (x86_64) and guest arch (unknown) are not 
compatible, so you cannot use command line options that involve running 
commands in the guest.  Use --firstboot scripts instead.

Same result with an explicit --arch=x86_64. It also does not depend on the image, it fails the same way with "fedora-27" or others.

Version-Release number of selected component (if applicable):

libguestfs-tools-c-1.38.0-1.fc28.x86_64


How reproducible: Always

Additional info: In case you can't reproduce this, I'm happy to attach a -v -x output

Comment 1 Pino Toscano 2018-05-07 14:04:34 UTC
Let me guess: the output of e.g. `file -b /bin/bash` shows "pie executable", right? (If not /bin/bash, one of /bin/ls, /bin/echo, or /bin/rm.)

Comment 2 Pino Toscano 2018-05-07 14:28:05 UTC
(In reply to Pino Toscano from comment #1)
> Let me guess: the output of e.g. `file -b /bin/bash` shows "pie executable",
> right? (If not /bin/bash, one of /bin/ls, /bin/echo, or /bin/rm.)

Sorry, this was a false hint.
The output of `file` changed, but instead there seems to be no comma between the type (e.g. "executable", "shared object", etc), and the architecture.

I'm already working on it.

Comment 3 Martin Pitt 2018-05-07 14:54:28 UTC
Confirmed, on Fedora 28 the comma went away. So I take it you can reproduce it? 

Thanks for the "file" hint - I tried to grep for the place where it gets called, to do a quick local workaround. Didn't find it yet, but I'll keep looking.

Comment 4 Pino Toscano 2018-05-07 15:21:16 UTC
(In reply to Martin Pitt from comment #3)
> Confirmed, on Fedora 28 the comma went away. So I take it you can reproduce
> it?

Yes, and I noticed that in the Debian/unstable VM in the CI on ci.centos.org.

> Thanks for the "file" hint - I tried to grep for the place where it gets
> called, to do a quick local workaround.

It's in the OCaml implementation of the guestfsd daemon:
- daemon/file.ml has the File.file function to run `file` (with some checks)
- daemon/filearch.ml has the actual detection

I just posted a patch for this:
https://www.redhat.com/archives/libguestfs/2018-May/msg00043.html

Comment 5 Pino Toscano 2018-05-09 08:18:21 UTC
Fixed upstream with
https://github.com/libguestfs/libguestfs/commit/3151d5e92741a297830bca717e0b93a5e130abd6
which is in libguestfs >= 1.39.5.

Comment 6 Richard W.M. Jones 2018-05-15 08:09:19 UTC
I'll do a 1.38.2 release including this and a few other pure
bugfixes today.

Comment 7 Richard W.M. Jones 2018-05-16 09:35:54 UTC
*** Bug 1576683 has been marked as a duplicate of this bug. ***

Comment 8 Fedora Update System 2018-05-16 13:34:49 UTC
libguestfs-1.38.2-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-6c4322c3d5

Comment 9 Martin Pitt 2018-05-16 14:33:17 UTC
That build works fine, thank you!

Comment 10 Fedora Update System 2018-05-17 15:26:52 UTC
libguestfs-1.38.2-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-6c4322c3d5

Comment 11 Fedora Update System 2018-05-25 15:05:44 UTC
libguestfs-1.38.2-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.