After implementing system UUID detection (
PT-1487), it's not possible to clean install percona-toolkit at least on Ubuntu and Debian systems running under VM. It's related to lack of access to /sys/class/dmi/id/product_uuid along with broken fallback.
[email protected]:~# cat /sys/class/dmi/id/product_uuid cat: /sys/class/dmi/id/product_uuid: Permission denied
Setting up percona-toolkit (3.0.7-1.jessie) ... cat: /sys/class/dmi/id/product_uuid: Permission denied dpkg: error processing package percona-toolkit (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: percona-toolkit [master b6bb73c] committing changes in /etc after apt run 2 files changed, 2 insertions(+) create mode 100644 percona-toolkit/.percona.toolkit.uuid E: Sub-process /usr/bin/dpkg returned an error code (1)
Issue exists in both: config/deb/postinst and config/rpm/percona-toolkit.spec. Example broken debian package code:
if [ -e /sys/class/dmi/id/product_uuid ]; then cat /sys/class/dmi/id/product_uuid > /etc/percona-toolkit/.percona.toolkit.uuid else perl -e 'printf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;' > /etc/percona-toolkit/.percona.toolkit.uuid fi
We can't assume file existence equals read permission. After using `cat` on product_uuid file, script simply fails. Best solution is to check if file is readable -r instead of only checking it's existence -e.
- if [ -e /sys/class/dmi/id/product_uuid ]; then + if [ -r /sys/class/dmi/id/product_uuid ]; then
As a workaround, following commit should be rolled back + package rebuild - https://github.com/percona/percona-toolkit/commit/92fc23d7b802637831200b07552bae9038ff5a46
Issue is confirmed on lxd and linux-vserver by the reporter but possible under Xen (in paravirt mode), Virtuozzo/OpenVZ.
Docker is not affected as file is freely accessible there (at least under OSX).