public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] replication: fix uninitalized warning
@ 2023-03-21 12:43 Fabian Grünbichler
  2023-03-21 13:49 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2023-03-21 12:43 UTC (permalink / raw)
  To: pve-devel

if a job has no schedule and is executed via "Schedule now" but fails, the
following will be printed to journal/syslog:

Mar 21 13:05:01 host02 pvescheduler[203343]: send/receive failed, cleaning up snapshot(s)..
Mar 21 13:05:01 host02 pvescheduler[203343]: 100-0: got unexpected replication job error - command 'set -o pipefail && pvesm export local-zfs:vm-100-disk-0 zfs - -with-snapshots 1 -snapshot __replicate_100-0_1679400300__ | /usr/bin/ssh -e none -o 'BatchMode=yes' -o 'HostKeyAlias=host03' root@10.0.74.3 -- pvesm import local-zfs:vm-100-disk-0 zfs - -with-snapshots 1 -snapshot __replicate_100-0_1679400300__ -allow-rename 0' failed: exit code 255
Mar 21 13:05:01 host02 pvescheduler[203343]: Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/PVE/API2/Replication.pm line 107.

defaulting to the fallback schedule '*/15' makes the spurious warning go away.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 PVE/API2/Replication.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Replication.pm b/PVE/API2/Replication.pm
index af77d2f4..d70b4607 100644
--- a/PVE/API2/Replication.pm
+++ b/PVE/API2/Replication.pm
@@ -103,8 +103,10 @@ my sub _handle_job_err {
 
     return if !_should_mail_at_failcount($fail_count);
 
+    my $schedule = $job->{schedule} // '*/15';
+
     my $msg = "Replication job $job->{id} with target '$job->{target}' and schedule";
-    $msg .= " '$job->{schedule}' failed!\n";
+    $msg .= " '$schedule' failed!\n";
 
     $msg .= "  Last successful sync: ";
     if (my $last_sync = $jobstate->{last_sync}) {
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-21 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 12:43 [pve-devel] [PATCH manager] replication: fix uninitalized warning Fabian Grünbichler
2023-03-21 13:49 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal