Closed ghost closed 4 years ago
Wow, this is a really weird one.
What version of apprise
got installed into your environment?
You should be able to run:
apprise -V
Next i'd be curious if these notifications work from the command line. You can even use the webhook url too:
apprise -vvv -b "test" https://discord.com/api/webhooks/{WebhookID}/{WebhookToken}
Let me know your results!
Apprise Version
apprise -V
apprise v0.8.6
Copyright (C) 2020 Chris Caron <lead2gold@gmail.com>
This code is licensed under the MIT License.
The other request works:
apprise -vvv -b "test" https://discord.com/api/webhooks/{WebhookID}/{WebhookToken}
2020-09-09 16:50:31,642 - DEBUG - Loaded URL: discord://{WebhookID}/{WebhookToken}/?format=text&overflow=upstream&tts=no&avatar=yes&footer=no&footer_logo=yes&image=no&verify=yes
2020-09-09 16:50:31,643 - DEBUG - Discord POST URL: https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken} (cert_verify=True)
2020-09-09 16:50:31,643 - DEBUG - Discord Payload: {'tts': False, 'wait': True, 'content': 'test', 'avatar_url': 'https://github.com/caronc/apprise/raw/master/apprise/assets/themes/default/apprise-info-256x256.png'}
2020-09-09 16:50:31,825 - INFO - Sent Discord notification.
Strange,
So the apprise backend that Notify.py
wraps is working great. Its the Notify.py script that isn't passing back the information correctly.
I'll investigate this further and see what i can find. Does the TEST
notification work at all (from within NZBGet)?
Make sure that in the same directory as the Notify.py
script that there isn't a directory called Notify
. There could be an environment confict where Notify.py
isn't actually using the global apprise
library that you proved to work.
Does the TEST notification work at all (from within NZBGet)?
It returns success, but also displays the error.
I reset the webhook so that url is no longer valid
Make sure that in the same directory as the Notify.py script that there isn't a directory called Notify.
Indeed that Notify folder is present in the same place
I just pushed a small fix that will make the logging a little better (source).
Maybe you could try upgrading your copy of NZBGet using the new master branch with this small change? I'm hoping the NZB-Notify logs will reveal a bit more information to help us debug this one. Delete the old Notify
directory too (just in-case something is lingering in there causing any issues before you re-checkout the master branch.
Basically your commands like the following should be a bit more revealing (i hope):
python Notify.py -t 'Hello' -b 'World' -s pbul://{access_token} -D
python Notify.py -t 'Hello' -b 'World' -s discord://{WebhookID}/{WebhookToken} -D
i get the same error msg using nzbget and notify with telegram msg configured
So now there are two errors in the outputs:
I will just reset the tokens when we have this figured out so you can see the actual token values which may be important to troubleshooting.
python Notify.py -t 'Hello' -b 'World' -s pbul://o.7UmHe3EaV7rdBNXGbIJ0FOGRXLlFUYKP -D
2020-09-10 09:58:02,027 - 14430 - DEBUG - Script Mode: shell
2020-09-10 09:58:02,028 - 14430 - DEBUG - Python v3.8.5
2020-09-10 09:58:02,031 - 14430 - DEBUG - OS: Linux 5.4.0-26-generic
2020-09-10 09:58:02,031 - 14430 - DEBUG - get(default) SERVERS=None
2020-09-10 09:58:02,032 - 14430 - DEBUG - set(config) SERVERS="pbul://o.7UmHe3EaV7rdBNXGbIJ0FOGRXLlFUYKP"
2020-09-10 09:58:02,032 - 14430 - DEBUG - set(environment) SERVERS="pbul://o.7UmHe3EaV7rdBNXGbIJ0FOGRXLlFUYKP"
2020-09-10 09:58:02,032 - 14430 - DEBUG - get(default) TITLE=None
2020-09-10 09:58:02,032 - 14430 - DEBUG - set(config) TITLE="Hello"
2020-09-10 09:58:02,032 - 14430 - DEBUG - set(environment) TITLE="Hello"
2020-09-10 09:58:02,032 - 14430 - DEBUG - get(default) BODY=None
2020-09-10 09:58:02,032 - 14430 - DEBUG - set(config) BODY="World"
2020-09-10 09:58:02,032 - 14430 - DEBUG - set(environment) BODY="World"
2020-09-10 09:58:02,032 - 14430 - DEBUG - get(default) INCLUDEIMAGE=None
2020-09-10 09:58:02,033 - 14430 - DEBUG - get(config) SERVERS="pbul://o.7UmHe3EaV7rdBNXGbIJ0FOGRXLlFUYKP"
2020-09-10 09:58:02,033 - 14430 - DEBUG - get(config) TITLE="Hello"
2020-09-10 09:58:02,033 - 14430 - DEBUG - get(config) BODY="World"
2020-09-10 09:58:02,033 - 14430 - DEBUG - get(default) THEME="general"
2020-09-10 09:58:02,033 - 14430 - DEBUG - get(default) NOTIFICATIONTYPE="info"
2020-09-10 09:58:02,033 - 14430 - DEBUG - get(config) SERVERS="pbul://o.7UmHe3EaV7rdBNXGbIJ0FOGRXLlFUYKP"
2020-09-10 09:58:02,034 - 14430 - ERROR - Unparseable URL pbul://o.7UmHe3EaV7rdBNXGbIJ0FOGRXLlFUYKP.
2020-09-10 09:58:02,034 - 14430 - ERROR - Could not initialize pbul://o.7UmHe3EaV7rdBNXGbIJ0FOGRXLlFUYKP instance.
2020-09-10 09:58:02,034 - 14430 - DEBUG - Exiting with return code: 0
python Notify.py -t 'Hello' -b 'World' -s discord://753395368342978631/cdcbR8bfX-Xiy45k8NF7A64eaIPadJerv5_UgkuFzbvfEBazsdeNitUdDxO1i5wIHbre -D
2020-09-10 10:04:54,514 - 15223 - DEBUG - Script Mode: shell
2020-09-10 10:04:54,514 - 15223 - DEBUG - Python v3.8.5
2020-09-10 10:04:54,517 - 15223 - DEBUG - OS: Linux 5.4.0-26-generic
2020-09-10 10:04:54,518 - 15223 - DEBUG - get(default) SERVERS=None
2020-09-10 10:04:54,518 - 15223 - DEBUG - set(config) SERVERS="discord://753395368342978631/cdcbR8bfX-Xiy45k8NF7A64eaIPadJerv5_UgkuFzbvfEBazsdeNitUdDxO1i5wIHbre"
2020-09-10 10:04:54,518 - 15223 - DEBUG - set(environment) SERVERS="discord://753395368342978631/cdcbR8bfX-Xiy45k8NF7A64eaIPadJerv5_UgkuFzbvfEBazsdeNitUdDxO1i5wIHbre"
2020-09-10 10:04:54,518 - 15223 - DEBUG - get(default) TITLE=None
2020-09-10 10:04:54,518 - 15223 - DEBUG - set(config) TITLE="Hello"
2020-09-10 10:04:54,518 - 15223 - DEBUG - set(environment) TITLE="Hello"
2020-09-10 10:04:54,518 - 15223 - DEBUG - get(default) BODY=None
2020-09-10 10:04:54,518 - 15223 - DEBUG - set(config) BODY="World"
2020-09-10 10:04:54,519 - 15223 - DEBUG - set(environment) BODY="World"
2020-09-10 10:04:54,519 - 15223 - DEBUG - get(default) INCLUDEIMAGE=None
2020-09-10 10:04:54,519 - 15223 - DEBUG - get(config) SERVERS="discord://753395368342978631/cdcbR8bfX-Xiy45k8NF7A64eaIPadJerv5_UgkuFzbvfEBazsdeNitUdDxO1i5wIHbre"
2020-09-10 10:04:54,519 - 15223 - DEBUG - get(config) TITLE="Hello"
2020-09-10 10:04:54,519 - 15223 - DEBUG - get(config) BODY="World"
2020-09-10 10:04:54,519 - 15223 - DEBUG - get(default) THEME="general"
2020-09-10 10:04:54,519 - 15223 - DEBUG - get(default) NOTIFICATIONTYPE="info"
2020-09-10 10:04:54,519 - 15223 - DEBUG - get(config) SERVERS="discord://753395368342978631/cdcbR8bfX-Xiy45k8NF7A64eaIPadJerv5_UgkuFzbvfEBazsdeNitUdDxO1i5wIHbre"
2020-09-10 10:04:54,520 - 15223 - ERROR - Unparseable URL discord://753395368342978631/cdcbR8bfX-Xiy45k8NF7A64eaIPadJerv5_UgkuFzbvfEBazsdeNitUdDxO1i5wIHbre.
2020-09-10 10:04:54,520 - 15223 - ERROR - Could not initialize discord://753395368342978631/cdcbR8bfX-Xiy45k8NF7A64eaIPadJerv5_UgkuFzbvfEBazsdeNitUdDxO1i5wIHbre instance.
2020-09-10 10:04:54,520 - 15223 - DEBUG - Exiting with return code: 0
Your issue are incredibly environment specific; i spent an hour now on this and i just can't reproduce it :slightly_frowning_face: .
Would you mind sharing the docker container and/or config you're pulling so i can work with that environment and try to debug this further for you guys? I see you mentioned Alpine Linux 3.12 (on Docker)? hence:
# instructions to get the docker-compose.yml file... ...
# docker container and startup?
This should have everything you need.
@davidatrean This is perfect! i was able to reproduce your problem immediately. It's definitely an environment issue! apprise
is not correctly installed inside it. I had to do the following to fix it:
# With respect to your attached configuration:
docker-compose exec nzbget sh
Then from within the container:
# get pip
apk add py3-pip
# ... say yes when prompted; let it add it and dependencies
# Remove hosed copy of apprise that exists in this container
pip uninstall apprise
# Then just re-add it
pip install apprise
Then everything works great again
I was able to update the NzbGet.Dockerfile and get positive results. Thank you for all your help!
FROM linuxserver/nzbget
RUN apk add py3-chardet && \
apk add py3-pip && \
pip uninstall -y apprise && \
pip install apprise
And for all the little script-kiddies, the tokens have all been reset, so you are just wasting your time.
:beetle: Describe the bug Attempting to integrate Notify.py with NzbGet and no matter which notification provider I use, I get an error message stating that it "Could not initialize ... instance."
:bulb: Screenshots and Logs Executing Notify.py with -D reveals:
Trying PushBullet:
:computer: Your System Details:
:crystal_ball: Additional context I am able to curl the webhook url, which is: https://discord.com/api/webhooks/{WebhookID}/{WebhookToken} where I get JSON back