diff --git a/incusd/storage/drivers/driver_zfs_utils.go b/incusd/storage/drivers/driver_zfs_utils.go index db922531e54..30dd04821ee 100644 --- a/incusd/storage/drivers/driver_zfs_utils.go +++ b/incusd/storage/drivers/driver_zfs_utils.go @@ -285,7 +285,7 @@ func (d *zfs) version() (string, error) { // This function is only really ever relevant on Ubuntu as the only // distro that ships out of sync tools and kernel modules out, err := shared.RunCommand("dpkg-query", "--showformat=${Version}", "--show", "zfsutils-linux") - if err == nil { + if out != "" && err == nil { return strings.TrimSpace(string(out)), nil } diff --git a/shared/version/version.go b/shared/version/version.go index b4bfc0db970..48becdd907c 100644 --- a/shared/version/version.go +++ b/shared/version/version.go @@ -56,7 +56,7 @@ func Parse(s string) (*DottedVersion, error) { matches := r.FindStringSubmatch(s) if len(matches) == 0 { - return nil, fmt.Errorf("Can't parse a version") + return nil, fmt.Errorf("Can't parse a version: %s", s) } return NewDottedVersion(matches[1])