PVE sending email notifications on successful backup jobs

tlex

Member
Mar 9, 2021
103
14
23
43
So I have this small issue where pve is sending email notifications when backup jobs are successful even if "On failure only" is checked for the "notify"" field. (and job detail logs confirm this as well with "--mailnotification failure". Also, I get double notifications since one notification get sends to root (dunno why) and the other one is sent to the recipient set under "send email to:" field in each backup jobs. Any idea why I get notifications when the jobs are successful ?
Also, is there a way to make the notification sent only to recipient defined in the "send email to:" field ?

Code:
INFO: starting new backup job: vzdump 105 --notes-template '{{cluster}}, {{guestname}}, {{node}}, {{vmid}}' --mailnotification failure --quiet 1 --storage pbs-1 --prune-backups 'keep-last=1' --node pve --mode snapshot --compress zstd --mailto XXX@XXX.com
INFO: Starting Backup of VM 105 (lxc)
INFO: Backup started at 2023-11-20 13:00:02
INFO: status = running
INFO: CT Name: Fileserver
INFO: including mount point rootfs ('/') in backup
INFO: including mount point mp0 ('/RZ2-1_1-4_4TB_Fileserver_Data') in backup
INFO: excluding volume mount point mp1 ('/RZ2-1_1-4_4TB_MBP_BKP') from backup (disabled)
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: suspend vm to make snapshot
INFO: create storage snapshot 'vzdump'
INFO: resume vm
INFO: guest is online again after <1 seconds
INFO: creating Proxmox Backup Server archive 'ct/105/2023-11-20T18:00:02Z'
INFO: run: lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- /usr/bin/proxmox-backup-client backup --crypt-mode=none pct.conf:/var/tmp/vzdumptmp1289901_105/etc/vzdump/pct.conf root.pxar:/mnt/vzsnap0 --include-dev /mnt/vzsnap0/./ --include-dev /mnt/vzsnap0/./RZ2-1_1-4_4TB_Fileserver_Data --skip-lost-and-found --exclude=/tmp/?* --exclude=/var/tmp/?* --exclude=/var/run/?*.pid --backup-type ct --backup-id 105 --backup-time 1700503202 --repository admin@pbs@xxx.xxx.com:EVO-TEMP
INFO: Starting backup: ct/105/2023-11-20T18:00:02Z
INFO: Client name: pve
INFO: Starting backup protocol: Mon Nov 20 13:00:02 2023
INFO: Downloading previous manifest (Fri Nov 17 18:33:57 2023)
INFO: Upload config file '/var/tmp/vzdumptmp1289901_105/etc/vzdump/pct.conf' to 'admin@pbs@xxx.xxx.com:8007:EVO-TEMP' as pct.conf.blob
INFO: Upload directory '/mnt/vzsnap0' to 'admin@pbs@xxx.xxx.com:8007:EVO-TEMP' as root.pxar.didx
INFO: root.pxar: had to backup 131.94 MiB of 35.163 GiB (compressed 62.096 MiB) in 275.17s
INFO: root.pxar: average backup speed: 490.991 KiB/s
INFO: root.pxar: backup was done incrementally, reused 35.034 GiB (99.6%)
INFO: Uploaded backup catalog (1.687 MiB)
INFO: Duration: 275.41s
INFO: End Time: Mon Nov 20 13:04:37 2023
INFO: adding notes to backup
INFO: prune older backups with retention: keep-last=1
INFO: running 'proxmox-backup-client prune' for 'ct/105'
INFO: pruned 1 backup(s) not covered by keep-retention policy
INFO: cleanup temporary 'vzdump' snapshot
INFO: Finished Backup of VM 105 (00:04:37)
INFO: Backup finished at 2023-11-20 13:04:39
INFO: Backup job finished successfully
INFO: notified via target `<mail-to-XXX@XXX.com>`
INFO: notified via target `mail-to-root`
TASK OK
 
  • Like
Reactions: logiczny and larsen
So I have this small issue where pve is sending email notifications when backup jobs are successful even if "On failure only" is checked for the "notify"" field. (and job detail logs confirm this as well with "--mailnotification failure". Also, I get double notifications since one notification get sends to root (dunno why) and the other one is sent to the recipient set under "send email to:" field in each backup jobs. Any idea why I get notifications when the jobs are successful ?
Also, is there a way to make the notification sent only to recipient defined in the "send email to:" field ?

Code:
INFO: starting new backup job: vzdump 105 --notes-template '{{cluster}}, {{guestname}}, {{node}}, {{vmid}}' --mailnotification failure --quiet 1 --storage pbs-1 --prune-backups 'keep-last=1' --node pve --mode snapshot --compress zstd --mailto XXX@XXX.com
INFO: Starting Backup of VM 105 (lxc)
INFO: Backup started at 2023-11-20 13:00:02
INFO: status = running
INFO: CT Name: Fileserver
INFO: including mount point rootfs ('/') in backup
INFO: including mount point mp0 ('/RZ2-1_1-4_4TB_Fileserver_Data') in backup
INFO: excluding volume mount point mp1 ('/RZ2-1_1-4_4TB_MBP_BKP') from backup (disabled)
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: suspend vm to make snapshot
INFO: create storage snapshot 'vzdump'
INFO: resume vm
INFO: guest is online again after <1 seconds
INFO: creating Proxmox Backup Server archive 'ct/105/2023-11-20T18:00:02Z'
INFO: run: lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- /usr/bin/proxmox-backup-client backup --crypt-mode=none pct.conf:/var/tmp/vzdumptmp1289901_105/etc/vzdump/pct.conf root.pxar:/mnt/vzsnap0 --include-dev /mnt/vzsnap0/./ --include-dev /mnt/vzsnap0/./RZ2-1_1-4_4TB_Fileserver_Data --skip-lost-and-found --exclude=/tmp/?* --exclude=/var/tmp/?* --exclude=/var/run/?*.pid --backup-type ct --backup-id 105 --backup-time 1700503202 --repository admin@pbs@xxx.xxx.com:EVO-TEMP
INFO: Starting backup: ct/105/2023-11-20T18:00:02Z
INFO: Client name: pve
INFO: Starting backup protocol: Mon Nov 20 13:00:02 2023
INFO: Downloading previous manifest (Fri Nov 17 18:33:57 2023)
INFO: Upload config file '/var/tmp/vzdumptmp1289901_105/etc/vzdump/pct.conf' to 'admin@pbs@xxx.xxx.com:8007:EVO-TEMP' as pct.conf.blob
INFO: Upload directory '/mnt/vzsnap0' to 'admin@pbs@xxx.xxx.com:8007:EVO-TEMP' as root.pxar.didx
INFO: root.pxar: had to backup 131.94 MiB of 35.163 GiB (compressed 62.096 MiB) in 275.17s
INFO: root.pxar: average backup speed: 490.991 KiB/s
INFO: root.pxar: backup was done incrementally, reused 35.034 GiB (99.6%)
INFO: Uploaded backup catalog (1.687 MiB)
INFO: Duration: 275.41s
INFO: End Time: Mon Nov 20 13:04:37 2023
INFO: adding notes to backup
INFO: prune older backups with retention: keep-last=1
INFO: running 'proxmox-backup-client prune' for 'ct/105'
INFO: pruned 1 backup(s) not covered by keep-retention policy
INFO: cleanup temporary 'vzdump' snapshot
INFO: Finished Backup of VM 105 (00:04:37)
INFO: Backup finished at 2023-11-20 13:04:39
INFO: Backup job finished successfully
INFO: notified via target `<mail-to-XXX@XXX.com>`
INFO: notified via target `mail-to-root`
TASK OK
Same problem here after latest updates. Will try to reboot to see if it get solved.
 
Last edited:
I’m also seeing this issue. Didn’t seem to be resolved by editing the default watcher to notify only on warning or error. Looking to have backup tasks notify only on backup task failures, but receive other error notifications from the system when they occur.
 
Last edited:
Same here, waiting for a fix. Don't want to mess up the settings in "Datacenter > Notifications" as it is unclear to me what should be done there.
 
Hi,
this should be fixed with Proxmox VE 8.1. You can choose if you want to use the new mode or legacy now. See here for documentation about notification settings: https://pve.proxmox.com/pve-docs/chapter-notifications.html
Is it possible to implement the same "on-failure/always" setting for mail notification within the new system? With the legacy one I can choose within each backup definition if I want to send a mail every time the backup job runs or only on failure, now should I move the logic in the notifications' definition page, matching somehow the name of the backup task that invokes the notification framework?
 
Yes, and I still do not see how to say "for backups X, Y, Z send mail every time they run, for backups A,B,C send backups only if they fail" since from the backup configuration page I can not specify on-faylure/always anymore if I select to use the new notification framework and from the notification framework page I can not see how to implement this logic. Maybe it is possible to match the backup names to implement this logic but it would be much more straightforward to be able to specify on-failure/always on the backups themselves.
 
Hi,
Yes, and I still do not see how to say "for backups X, Y, Z send mail every time they run, for backups A,B,C send backups only if they fail" since from the backup configuration page I can not specify on-faylure/always anymore if I select to use the new notification framework and from the notification framework page I can not see how to implement this logic. Maybe it is possible to match the backup names to implement this logic but it would be much more straightforward to be able to specify on-failure/always on the backups themselves.
for the moment, you can still select the legacy notification mode for backup jobs. But likely with Proxmox VE 9, that will be gone and you would really need to match via backup job names or similar. IMHO doing that is a sensible approach that fits with the design of the new notification system. But feel free to open an enhancement request where it can be discussed whether it's worth keeping a per-job setting for that (and being able to match explicitly on that): https://bugzilla.proxmox.com/
 
  • Like
Reactions: MightySlaytanic
Hi,

for the moment, you can still select the legacy notification mode for backup jobs. But likely with Proxmox VE 9, that will be gone and you would really need to match via backup job names or similar. IMHO doing that is a sensible approach that fits with the design of the new notification system. But feel free to open an enhancement request where it can be discussed whether it's worth keeping a per-job setting for that (and being able to match explicitly on that): https://bugzilla.proxmox.com/
Is "matching via backup job names" something that I can already do (how?) or is it something that will be implemented in the future? Thanks for the support!
 
Is "matching via backup job names" something that I can already do (how?) or is it something that will be implemented in the future? Thanks for the support!
Ah sorry, I think there is no such field for the notification matcher yet (only hostname and type currently). I'd recommend to use the legacy mode for now. Please open a feature request so this doesn't get lost: https://bugzilla.proxmox.com/
 
I am on 8.1.4 and this is still not fixed. I have notifications on my backup job set to Default (Auto) and 'On Failure Only' and I am still getting notified on every single successful backup.

vzdump 100 105 106 107 108 110 112 113 117 118 120 142 143 144 --storage ProxBackup01 --notes-template '{{guestname}}' --mode snapshot --quiet 1 --mailnotification failure

pve-manager/8.1.4/ec5affc9e41f1d79 (running kernel: 6.5.11-8-pve)
 
Last edited:
Some fixes were proposed on the development mailing list, but not applied/shipped yet.

https://lists.proxmox.com/pipermail/pve-devel/2023-November/060801.html
https://lists.proxmox.com/pipermail/pve-devel/2024-February/061778.html

I am on 8.1.4 and this is still not fixed. I have notifications on my backup job set to Default (Auto) and 'On Failure Only' and I am still getting notified on every single successful backup.
The 'Always/Failure Only' only affects the 'Legacy Sendmail' option, or "Auto", if no mail address is entered. If using the new notification system, you have to create/edit the notification matchers to influence the behavior. Per-backup job matching will be possible once the proposed patches are applied.
 
Hi there,

I have i think similar problem.

I have 2 nodes. I just mirgate a VM from first node to second node one week ago.

I have one backup job with "only on failure" option.

Everything was working nice before the migration => now i receive email success every day...

PVE 8.0.4 / pve-6.2.16-12

prox.jpg

I receive 2 mails every day from the second node (root@pve2) and i cannot see in the table the others backuped VM. (but backup is OK)

VM 120 is the only one that has backup enable on the second node.

I saw in the previous post that the update does not resolve the problem, so i will make it right now.

Don't even now if it's related.

Sorry if i needed to create new subject i was not sure.

Is there a way to resolve this simply ?

Regards
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!