From c6709e44af4bee976ab2342145916f001c45f8b1 Mon Sep 17 00:00:00 2001 From: Robin Kluth Date: Sat, 15 Apr 2023 22:08:54 +0200 Subject: [PATCH] Skip empty (mapped rootfs) volumes. Sidenote: They result in empty strings for tar (because of rtrim) but we should actively sort them out anyway. --- src/include/ABHelper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/include/ABHelper.php b/src/include/ABHelper.php index 485b0d3..9bc0a75 100644 --- a/src/include/ABHelper.php +++ b/src/include/ABHelper.php @@ -415,7 +415,11 @@ public static function getContainerVolumes($container) { $volumes = []; foreach ($container['Volumes'] ?? [] as $volume) { - $hostPath = explode(":", $volume)[0]; + $hostPath = rtrim(explode(":", $volume)[0], '/'); + if (empty($hostPath)) { + self::backupLog("This volume is empty (rootfs mapped??)! Ignoring.", self::LOGLEVEL_DEBUG); + continue; + } $volumes[] = rtrim($hostPath, '/'); } return $volumes;