Howboys Posted August 22, 2022 Share Posted August 22, 2022 (edited) I'm setting up a discord server for my homelab and with unraid, I'm having some issues. And here's how I've set the Discord agent: Now, I can receive the test notifications just fine: 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 August 22, 2022 by Howboys Quote Link to comment
Howboys Posted August 22, 2022 Author Share Posted August 22, 2022 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 } ] } ] } Quote Link to comment
BVD Posted August 23, 2022 Share Posted August 23, 2022 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 ❤️ Quote Link to comment
Solution ljm42 Posted August 23, 2022 Solution Share Posted August 23, 2022 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 Quote Link to comment
Howboys Posted August 24, 2022 Author Share Posted August 24, 2022 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). Quote Link to comment
BVD Posted August 24, 2022 Share Posted August 24, 2022 @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! Quote Link to comment
ljm42 Posted August 24, 2022 Share Posted August 24, 2022 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. 2 Quote Link to comment
thewave Posted July 29, 2023 Share Posted July 29, 2023 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. Quote Link to comment
ljm42 Posted July 31, 2023 Share Posted July 31, 2023 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. Quote Link to comment
Recommended Posts
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.