Fix CentOS 7 CI test job failures from empty /etc/machine-id (!62)

Since August 2020, GitLab Continuous Integration test jobs have been
failing on the CentOS 7 image like this from
tests/test_SupportedFileSystems.log:

    process 6319: D-Bus library appears to be incorrectly set up; failed to read machine uuid: UUID file '/etc/machine-id' should contain a hex string of length 32, not length 0, with no other text
    See the manual page for dbus-uuidgen to correct this issue.
      D-Bus not built with -rdynamic so unable to print a backtrace
    Running main() from test_SupportedFileSystems.cc
    DISPLAY=":99"
    /usr/bin/xvfb-run: line 181:  6319 Aborted                 (core dumped) DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1

Not sure why this has just started failing in the CentOS 7 CI image now,
but the error is widely known [1][2][3][4].  Use
systemd-machine-id-setup to generate a machine ID [5][6]; rather than
dbus-uuidgen [7] as it's designed to integrate into VMs and does the
right thing if a valid machine ID already exists.

[1] Red Hat Bug 598200 - D-Bus library appears to be incorrectly set up;
    failed to read machine uuid: UUID file '/var/lib/dbus/machine-id'
    https://bugzilla.redhat.com/show_bug.cgi?id=598200
[2] Free Desktop Bug 13194 - When machine-id not found, dbus should not
    abort
    https://bugs.freedesktop.org/show_bug.cgi?id=13194
[3] D-Bus library appears to be incorrectly set up
    https://unix.stackexchange.com/questions/117741/d-bus-library-appears-to-be-incorrectly-set-up
[4] Generate uuid for container
    https://xpra.org/trac/wiki/Usage/Docker/CentOS
[5] CentOS / RHEL 7 : How to Change the machine-id
    https://www.thegeekdiary.com/centos-rhel-7-how-to-change-the-machine-id/
[6] man systemd-machine-id-setup
    https://man7.org/linux/man-pages/man1/systemd-machine-id-setup.1.html
[7] man dbus-uuidgen
    https://dbus.freedesktop.org/doc/dbus-uuidgen.1.html

Closes !62 - Fix CentOS 7 CI test job failures because of zero sized
             /etc/machine-id
This commit is contained in:
Mike Fleetwood 2020-09-17 16:44:31 +01:00 committed by Curtis Gedak
parent 174c5e898c
commit 70db3469c5
1 changed files with 1 additions and 0 deletions

View File

@ -18,6 +18,7 @@ stages:
ntfsprogs udftools xfsprogs xfsdump
xorg-x11-server-Xvfb kmod
- cat /etc/os-release
- systemd-machine-id-setup
.ubuntu_image_template: &ubuntu_image_definition
# Use official Ubuntu image https://hub.docker.com/_/ubuntu/.