tigattack/VeeamDiscordNotifications

[BUG] Notifications aren't sent

stefanelul2000 opened this issue ยท 25 comments

Describe the bug
Discords notifications are not being sent by all backup jobs.

To Reproduce
Setup multiple jobs in Veeam and setup them to send notifications.

Expected behavior
Every job should send a notification.

Relevant part of log/debug.log
Don't have it right now, will post it a bit later.

RemoteDesktopManagerFree_9Ql4yxxE3A

This backup sends notifications without any issue.

RemoteDesktopManagerFree_Er5Z4ZssHb

This backup does not send any notification at all.

Hi @stefanelul2000. Once you've attached logs I can take a look into this for you ๐Ÿ‘

debug.log

I have attached the logs. Hopefully they are the right ones as they do not mention from what Veeam backup job they origiate,

debug.log

Another job finished just now. This is the latest log for that job

I saw something in the logs. Line 56 in file "DiscordVeeamAlertSender.ps1" needs to be changed to "Import-Module Veeam.Backup.PowerShell"

Issue is similar to #17

Edit: That didn't do anything.
Another important thing to point out is this
"WARNING: This cmdlet is no longer supported for computer backup jobs. Use "Get-VBRComputerBackupJob" instead.
You cannot call a method on a null-valued expression."

Didn't see your update; good thing to sort anyway though. Thought I sorted that one!

So does this line match yours then? DiscordVeeamAlertSender.ps1#L56
Do you see anything else in the logs after making that change?

I'm aware of the warning, thanks. A lot of this needs a rewrite, I'm just quite short of time. Progress is happening, just quite slowly ๐Ÿ˜„

Yeah, the line matches mine now but it still does not work. I am unsure why.

Do you see anything else in the logs after making that change?

The same errors as before. But without the line with the snappin module missing.

debug.log

This is another log after that change. Still the same errors as before. I am not really sure what is wrong.

Could you try the following and show me the output?

  1. Open PowerShell on your Veeam server
  2. Run Import-Module Veeam.Backup.PowerShell -Verbose

Import-Module-Verbose.txt

I have attached the output of the command.

Please try replacing your DiscordNotificationBootstrap.ps1 with this (make sure the filename isn't changed). Trigger a job and please attach the new debug.log once the script has run.
It seems it's failing to get the session information but this should confirm it.

If that's the case, I'm currently not sure why that would fail, but once it's confirmed I'll see if I can work out what's happening.

I have update it with the provided file. I will report as soon as the next job runs.

debug.log

I have attached the latest logs.

Hello, do you have any update on this?

Apologies, I've been quite busy lately. I'm hoping to look into this some more ASAP as I'm currently unsure why it's failing.

Ok, sure. Let me know if you have any update.

@stefanelul2000 Apologies for the delay, life has been very busy, but I haven't forgotten about this.

A collaborator and I are investigating the issue and I realised I've not actually confirmed which version you're running.
Are you running the latest release or have you cloned one of the branches?

@tigattack

I am running on 1.5 I believe with small modifications. The ones mentioned in this ticket.

Great, thanks Stefan.

I have also checked, since 12.06.2021 There haven't been any notifications sent to my discord even thought the script is still enabled on the veeam server.

veeam-discord-log.txt

This is the latest log.

Ah, that's very useful actually, seems it's failing to get job and session details. Thanks.

I'll spend some more time on this this weekend and hopefully have something for you to try.

@tigattack Do you have any update for me?

Hi @stefanelul2000, could you please try the latest release and let me know if the issue persists?