Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't send the notification to Discord #61

Closed
EvilQoo opened this issue Sep 6, 2023 · 4 comments · Fixed by #62
Closed

Can't send the notification to Discord #61

EvilQoo opened this issue Sep 6, 2023 · 4 comments · Fixed by #62
Assignees
Labels
bug Something isn't working

Comments

@EvilQoo
Copy link

EvilQoo commented Sep 6, 2023

What happened?

It won't send the notification to Discord.

Running post-job script Executing custom command [powershell.exe], arguments [ -ExecutionPolicy ByPass -Command " try {& 'C:\VeeamScripts\VeeamNotify\Bootstrap.ps1' -ErrorAction Stop } catch { exit 1 } "]
Post-job script completed successfully

I'm using B&R version 12.

Thanks.

Steps To Reproduce

No response

VeeamNotify version

v1.0

PowerShell version

5.1

Veeam Backup & Replication build number

12.0.0.1420 P20230412

Relevant log output

{
    "services":  {
                     "discord":  {
                                     "webhook":  "https://discord.com/api/webhooks/xxx",
                                     "user_id":  "123456789"
                                 },
                     "slack":  {
                                   "webhook":  "SlackWebhook",
                                   "user_id":  "A1B2C3D4E5"
                               },
                     "teams":  {
                                   "webhook":  "TeamsWebhook",
                                   "user_id":  "user@domain.tld",
                                   "user_name":  "Your Name"
                               }
                 },
    "mentions":  {
                     "on_failure":  false,
                     "on_warning":  false
                 },
    "notifications":  {
                          "on_success":  true,
                          "on_failure":  true,
                          "on_warning":  true
                      },
    "logging":  {
                    "enabled":  true,
                    "level":  "info",
                    "max_age_days":  7
                },
    "update":  {
                   "notify":  true,
                   "auto_update":  false,
                   "auto_update_comment":  "auto_update will NOT work. Leave as \u0027false\u0027"
               },
    "thumbnail":  "https://raw.githubusercontent.com/tigattack/VeeamDiscordNotifications/master/asset/thumb01.png"
}

**********************
Windows PowerShell transcript start
Start time: 20230906101409
Username: DNX\SYSTEM
RunAs User: DNX\SYSTEM
Configuration Name: 
Machine: DNX-HH-VEEAM (Microsoft Windows NT 10.0.20348.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\VeeamScripts\VeeamNotify\Bootstrap.ps1
Process ID: 39800
PSVersion: 5.1.20348.1850
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.20348.1850
BuildVersion: 10.0.20348.1850
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
2023-09-06T02:14:09.343Z [INFO] Transcript is being logged to 'C:\VeeamScripts\VeeamNotify\log\2023-09-06_10.14.09_Bootstrap.log'.
2023-09-06T02:14:09.453Z [INFO] Version: v1.0
2023-09-06T02:14:09.781Z [INFO] Getting VBR job details
2023-09-06T02:14:17.593Z [INFO] Getting VBR session information
2023-09-06T02:14:17.843Z [INFO] Bootstrap script for Veeam job 'VM WORKGROUP Guests with DATA Partitions Only' (job d28502ac-80a6-414d-86aa-5680312a7ed5 session c4e79571-de21-45a1-8883-c01f5793f534) - Session & job detection complete.
2023-09-06T02:14:17.859Z [INFO] Launching AlertSender.ps1...
2023-09-06T02:14:17.921Z [INFO] AlertSender.ps1 launched successfully.
2023-09-06T02:14:17.953Z [INFO] Stopping transcript logging.
**********************
Windows PowerShell transcript end
End time: 20230906101417
**********************
**********************
Windows PowerShell transcript start
Start time: 20230906101421
Username: XXX\SYSTEM
RunAs User: XXX\SYSTEM
Configuration Name: 
Machine: DNX-HH-VEEAM (Microsoft Windows NT 10.0.20348.0)
Host Application: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -file C:\VeeamScripts\VeeamNotify\AlertSender.ps1 -JobName VM WORKGROUP Guests with DATA Partitions Only -Id c4e79571-de21-45a1-8883-c01f5793f534 -JobType EpAgentBackup -Config {
  "services": {
           "discord": {
                   "webhook": "https://discord.com/api/webhooks/xxx",
                   "user_id": "123456789"
                 },
           "slack": {
                  "webhook": "SlackWebhook",
                  "user_id": "A1B2C3D4E5"
                },
           "teams": {
                  "webhook": "TeamsWebhook",
                  "user_id": "user@domain.tld",
                  "user_name": "Your Name"
                }
         },
  "mentions": {
           "on_failure": false,
           "on_warning": false
         },
  "notifications": {
             "on_success": true,
             "on_failure": true,
             "on_warning": true
           },
  "logging": {
          "enabled": true,
          "level": "info",
          "max_age_days": 7
        },
  "update": {
          "notify": true,
          "auto_update": false,
          "auto_update_comment": "auto_update will NOT work. Leave as \u0027false\u0027"
        },
  "thumbnail": "https://raw.githubusercontent.com/tigattack/VeeamDiscordNotifications/master/asset/thumb01.png"
}
 -Logfile C:\VeeamScripts\VeeamNotify\log\2023-09-06_10.14.09-VM_WORKGROUP_Guests_with_DATA_Partitions_Only.log
Process ID: 42764
PSVersion: 5.1.20348.1850
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.20348.1850
BuildVersion: 10.0.20348.1850
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
2023-09-06T02:14:21.468Z [INFO] Transcript is being logged to 'C:\VeeamScripts\VeeamNotify\log\2023-09-06_10.14.09-VM_WORKGROUP_Guests_with_DATA_Partitions_Only.log'.
PS>TerminatingError(Get-VBRSessionInfo): "Exception calling "GetByOriginalSessionId" with "1" argument(s): "Object reference not set to an instance of an object.""
2023-09-06T02:14:22.406Z [ERROR] A terminating error occured:
2023-09-06T02:14:22.421Z [INFO] Stopping transcript logging.
**********************
Windows PowerShell transcript end
End time: 20230906101422
**********************
@tigattack
Copy link
Owner

tigattack commented Sep 6, 2023

Hey @EvilQoo, this should be resolved by 49a659c. Please give it a go let me know if you have any further issues.

You can download the fixed file from here and save to C:\VeeamScripts\VeeamNotify\resources\VBRSessionInfo.psm1.

If this does indeed resolve the issue for you, I'll create a new release with the fix included.

@tigattack tigattack reopened this Sep 6, 2023
@EvilQoo
Copy link
Author

EvilQoo commented Sep 7, 2023 via email

@tigattack
Copy link
Owner

Thanks for letting me know. I'll create a new release shortly.

@EvilQoo
Copy link
Author

EvilQoo commented Sep 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants