Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Not sending Discord notifications (Test works)

Featured Replies

I'm setting up a discord server for my homelab and with unraid, I'm having some issues.

 

image.thumb.png.9e73211fabe975c12ac51c4fda49b5bf.png

 

And here's how I've set the Discord agent:

 

322452121_ScreenShot2022-08-22at6_58_04AM.thumb.png.f3eac3f63ca506bcc36585cf57e815de.png

 

Now, I can receive the test notifications just fine:

 

image.png.d8348ae2c2fef97d0298d17e2bada89b.png

 

But I'm not receiving any other notifications. I only see notifications in the unraid web ui. Even adding my tag id (the numbers) doesn't work. All I see in syslog is

 

Aug 22 06:52:01 Tower Discord.sh: Failed sending notification

 

Is there any way to turn up verbosity of Discord.sh or see why it failed?

Edited by Howboys

Solved by ljm42

  • Author

If `/var/log/notify_Discord`, I see failed attempts to send notification but not actual errors or reasons why. Snippet:

 

Mon Aug 22 06:52:01 PDT 2022
attempt 1 of 4 failed
{"embeds": ["0"]}

 

I also don't see further attempts in logs - just 1 of 4 as above for different notifications.

 

I can do a quick test just fine:

 

bash /boot/config/plugins/dynamix/notifications/agents/Discord.sh

 

And I see the notification in Discord.

 

But when I do a full test:

 

/usr/local/emhttp/webGui/scripts/notify -e "My Event" -s "My Subject" -d "My Description"  -m "My Message" -i "alert" -l "/Dashboard"

 

I only see the notification in the UI and NOT in Discord. Here's the log for that:

 

Mon Aug 22 07:18:13 PDT 2022
attempt 1 of 4 failed
{"embeds": ["0"]}
{
"content": "<@1234>",
"embeds": [
{
"title": "My Event",
"description": "My Subject",
"url": "http://Tower/Dashboard",
"timestamp": "2022-08-22T14:18:12.000Z",
"color": "14821416",
"author": {
"icon_url": "https://craftassets.unraid.net/uploads/logos/[email protected]",
"name": "Tower"
},
"thumbnail": {
"url": "https://craftassets.unraid.net/uploads/discord/notify-alert.png"
},
"fields": [
{
"name": "Description",
"value": "My Description\n\nMy Message"
},
{
"name": "Priority",
"value": "alert",
"inline": true
}
]
}
]
}

 

  • Author

Any help?

Since it's all bash, I'd increase syslog's logging level to debug and re-test, then evaluate based on what you see there.

 

If you haven't attempted rebooting the host yet, that's worth a shot prior to investing the effort into debug - there are times where something in memory isnt updated to reflect config changes, which a reboot would then fix. Not common, but worth a shot.

 

If both of those come up empty (e.g. you find its something network related), you're next bet is unfortunately likely a packet trace (ugh).

 

 

22 minutes ago, Howboys said:

Any help?

 

It's only been about 24 hours, and we're mostly volunteer here - we do what we can, but sometimes it takes us a bit. Little patience goes a long way ❤️

  • Solution

Interesting. So this is another problem related to having a blank "Local TLD". Discord won't accept the submission with this bare url:

"url": "http://Tower/Dashboard",

 

I strongly recommend that you go to Settings -> Management Access and change "Local TLD" from blank to "local" (without the quotes). This will solve this problem with Discord by changing the url to:

http://Tower.local/Dashboard

 

I'd also recommend installing the Fix Common Problems plugin as it would have alerted you to other potential issues related to a blank Local TLD, more info here:
  https://forums.unraid.net/topic/120220-fix-common-problems-more-information/?tab=comments#comment-1099981 

 

  • Author

Ah that fixed it! I actually have Fix Common Problems plugin installed already but I didn't see it there (or get notified of it).

@ljm42Sorry to bug ya with a seemingly unnecessary follow up, but wanted to ask - do you know, or happen to recall, how this was initially sorted out? Debug's annoying, and pktt felt like crazy overkill, but I honestly couldnt think of any other way around it, and am wondering if theres some other simpler method that would've pointed to the answer (initially I mean, prior to it being added to tips and tweaks).

 

Thanks for your time!

3 hours ago, Howboys said:

Ah that fixed it! 

 

Glad to hear it!

 

3 hours ago, BVD said:

Sorry to bug ya with a seemingly unnecessary follow up, but wanted to ask - do you know, or happen to recall, how this was initially sorted out? 

 

Howboys provided the details of their test submission. I submitted that to my Discord server and it failed, so that meant there was a problem with the data. Discord does not give good failure messages so I compared it to a working submission from one of my Unraid servers and narrowed the difference down to the url. Did a few more tests to confirm.

 

BTW, I also submitted a patch for the webgui, hopefully will make it into 6.11:

  https://github.com/limetech/webgui/pull/1153

Basically, if the url does not include a Local TLD, the URL will be removed from the submission to Discord. This will allow notifications to be sent to Discord even if the Local TLD is not defined, but I would still recommend that everyone define a Local TLD on their servers.

  • 11 months later...
On 8/24/2022 at 2:43 AM, ljm42 said:

 

Glad to hear it!

 

 

Howboys provided the details of their test submission. I submitted that to my Discord server and it failed, so that meant there was a problem with the data. Discord does not give good failure messages so I compared it to a working submission from one of my Unraid servers and narrowed the difference down to the url. Did a few more tests to confirm.

 

BTW, I also submitted a patch for the webgui, hopefully will make it into 6.11:

  https://github.com/limetech/webgui/pull/1153

Basically, if the url does not include a Local TLD, the URL will be removed from the submission to Discord. This will allow notifications to be sent to Discord even if the Local TLD is not defined, but I would still recommend that everyone define a Local TLD on their servers.

Have there been any other reports of discord notifications failing?  I'm able to send test notifications just fine, but other notifications aren't working.  The Local TLD was set before I enabled the discord agent.

On 7/29/2023 at 5:50 AM, thewave said:

Have there been any other reports of discord notifications failing?  I'm able to send test notifications just fine, but other notifications aren't working.  The Local TLD was set before I enabled the discord agent.

 

If there are errors, they will be logged in /var/log/notify_Discord . You can view the log with:

cat /var/log/notify_Discord


If you post the info here I may be able to help parse it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.