[pbs-devel] [PATCH proxmox-backup] datastore: add additional context for get_owner parsing error

Christian Ebner c.ebner at proxmox.com
Tue Jan 9 18:13:05 CET 2024


By this it becomes clear that the error stems from a parsing error when
getting the backup group owner.

See also: https://forum.proxmox.com/threads/139482/

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 pbs-datastore/src/datastore.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index 41c9f4f2..a78f44aa 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -602,7 +602,12 @@ impl DataStore {
     ) -> Result<Authid, Error> {
         let full_path = self.owner_path(ns, backup_group);
         let owner = proxmox_sys::fs::file_read_firstline(full_path)?;
-        owner.trim_end().parse() // remove trailing newline
+        owner
+            .trim_end() // remove trailing newline
+            .parse()
+            .map_err(|err| {
+                format_err!("parsing owner for {backup_group} failed: {err}")
+            })
     }
 
     pub fn owns_backup(
-- 
2.39.2





More information about the pbs-devel mailing list