[pbs-devel] [PATCH proxmox-backup] proxy: avoid logging every minute that a datastore is not mounted

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Nov 11 11:54:15 CET 2025


On October 14, 2025 9:55 am, Hannes Laimer wrote:
> `lookup_datastore` fails if a removable datastore is not mounted,
> which is fine. But for job scheduling which happens every minute
> we don't want the lookup to fail and fill the syslogs with unnecesarry
> entries, so we check the mount status before we do the lookup to avoid
> that.
> 
> Reported-by: https://forum.proxmox.com/threads/sicherung-auf-usb.167291/post-808237
> Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>

couldn't we also rework this to first check if GC should be started in
the first place according to the schedule, and move the lookup and
garbage_collection_running call further below?

that would already reduce the amount of warnings a lot, and warning if
the mounted status and GC schedule don't line up and we are missing GC
executions that should take place seems valid? though whether warning
every minute makes sense is a different matter (as is whether doing
time-based GC scheduling for removable datastores makes sense)

> ---
>  src/bin/proxmox-backup-proxy.rs | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
> index cfd93f92..762b5736 100644
> --- a/src/bin/proxmox-backup-proxy.rs
> +++ b/src/bin/proxmox-backup-proxy.rs
> @@ -22,7 +22,7 @@ use proxmox_router::{RpcEnvironment, RpcEnvironmentType};
>  use proxmox_sys::fs::CreateOptions;
>  use proxmox_sys::logrotate::LogRotate;
>  
> -use pbs_datastore::DataStore;
> +use pbs_datastore::{DataStore, get_datastore_mount_status};
>  
>  use proxmox_rest_server::{
>      cleanup_old_tasks, cookie_from_header, rotate_task_log_archive, ApiConfig, Redirector,
> @@ -516,7 +516,7 @@ async fn schedule_datastore_garbage_collection() {
>              }
>          };
>  
> -        let event_str = match store_config.gc_schedule {
> +        let event_str = match store_config.gc_schedule.as_ref() {
>              Some(event_str) => event_str,
>              None => continue,
>          };
> @@ -530,6 +530,12 @@ async fn schedule_datastore_garbage_collection() {
>          };
>  
>          {
> +            if let Some(false) = get_datastore_mount_status(&store_config) {
> +                // lookup_datastore would fail correctly, but we don't want log entries every
> +                // minute for a not mounted removable datastore
> +                continue;
> +            }
> +
>              // limit datastore scope due to Op::Lookup
>              let datastore = match DataStore::lookup_datastore(&store, Some(Operation::Lookup)) {
>                  Ok(datastore) => datastore,
> @@ -588,7 +594,7 @@ async fn schedule_datastore_garbage_collection() {
>              job,
>              datastore,
>              auth_id,
> -            Some(event_str),
> +            Some(event_str.into()),
>              false,
>          ) {
>              eprintln!("unable to start garbage collection job on datastore {store} - {err:#}");
> -- 
> 2.47.3
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 




More information about the pbs-devel mailing list