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

send apprise alert #4928

Closed
2 tasks done
pczhang opened this issue Jul 10, 2024 · 8 comments
Closed
2 tasks done

send apprise alert #4928

pczhang opened this issue Jul 10, 2024 · 8 comments
Labels

Comments

@pczhang
Copy link

pczhang commented Jul 10, 2024

⚠️ Please verify that this question has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

Hello,

I am trying to set up apprise notification on uptime kuma. When I do

apprise --body="Test Message" apprises://host/config_id/?tags=all

I can receive the notification.
However, when I put apprises://host/config_id/?tags=all to uptime kuma and click test, I got the error.
would you please let me know what I did wrong. thank you!

📝 Error Message(s) or Log

date	stream	content
2024/07/10 11:46:07	stderr	}
2024/07/10 11:46:07	stderr	  stderr: ''
2024/07/10 11:46:07	stderr	    '2024-07-10 11:46:07,023 - ERROR - There are no service(s) to notify\n', 
2024/07/10 11:46:07	stderr	    '2024-07-10 11:46:07,023 - ERROR - Could not load Apprise API URL: apprises://a...e/2...9/?tags=all\n' + 
2024/07/10 11:46:07	stderr	  stdout: '2024-07-10 11:46:07,023 - WARNING - The Apprise API token specified (27c180dd723b67931458f95c6b4c7726e7e98d2f6657475b97546c77958da249) is invalid.\n' + 
2024/07/10 11:46:07	stderr	  signal: null, 
2024/07/10 11:46:07	stderr	  code: 1, 
2024/07/10 11:46:07	stderr	    at ChildProcess._handle.onexit (node:internal/child_process:303:5) {
2024/07/10 11:46:07	stderr	    at maybeClose (node:internal/child_process:1098:16)
2024/07/10 11:46:07	stderr	    at ChildProcess.emit (node:events:517:28)
2024/07/10 11:46:07	stderr	    at ChildProcess.done (/app/node_modules/promisify-child-process/index.cjs:70:19)
2024/07/10 11:46:07	stderr	Error: Process exited with code 1

🐻 Uptime-Kuma Version

1.23.13

💻 Operating System and Arch

Synology NAS

🌐 Browser

Brave

🖥️ Deployment Environment

  • Runtime: Docker version 20.10.23, build 876964a
  • Database: N/A
  • Filesystem used to store the database on: N/A
  • number of monitors: 3
@pczhang pczhang added the help label Jul 10, 2024
@CommanderStorm
Copy link
Collaborator

The Apprise API token specified (27c180dd723b67931458f95c6b4c7726e7e98d2f6657475b97546c77958da249) is invalid

Maybe there is a typo in the API token. Have you double-checked this?

@pczhang
Copy link
Author

pczhang commented Jul 11, 2024

i am certain that is the correct one. and using the same token "apprise --body="Test Message" apprises://host/token/?tags=all" can send message.

@pczhang
Copy link
Author

pczhang commented Jul 11, 2024

btw: in apprise API page, they call it "config ID", but you call it token. They mean to be the same thing, right?

@CommanderStorm
Copy link
Collaborator

Cannot confirm. What page did you look at?
https://github.com/caronc/apprise/wiki/Notify_apprise_api does only specify tokens, no ids

@pczhang
Copy link
Author

pczhang commented Jul 11, 2024

Screenshot-2
I referred to the apprise setup page. they called it "config id". I assume this is the token in the wiki link you sent.

@CommanderStorm
Copy link
Collaborator

I don't see how to get the needed parameter from the docs or from https://hub.docker.com/r/caronc/apprise.
=> Please reopen an issue with https://github.com/caronc/apprise-api instead. I have no idea how this software works and digging through that code is not very productive at 4:00 am

@louislam
Copy link
Owner

TL;DR;

Define your apprise config name by https://host/{custom config id}.

{custom config id}'s length must be 32 or below.

For example:
http://unraid:8000/cfg/12345678901234567890123456789012

Reasons

This should be an upstream issue. The issue had been fixed in Apprise CLI 1.8.0, but Uptime Kuma's docker image came with Apprise CLI 1.6.0.

https://github.com/caronc/apprise/releases/tag/v1.8.0

Update Apprise API (apprise//) token length by @isometimescode in caronc/apprise#1120

Before Apprise CLI 1.8.0, it accepts token length < 32 only.

Also, before Apprise API 0.9.6, the config id is always defined by custom input, but now the config id is auto-generated with length 64, which length size cannot fit into any older versions of Apprise CLI.

https://github.com/caronc/apprise-api/releases/tag/v0.9.6

New Configuration Generator button added to make it easier to create obfuscated (and non-guessable) unique configuration keys.

My suggestion to Apprise API would be changing the auto-generated key length to 32 instead of 64 for better backward compatibility

cc: @caronc (in case you are not aware of this)

@pczhang
Copy link
Author

pczhang commented Jul 11, 2024

Thanks, @louislam ! That was exactly the problem. Changing to 32-length token solves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants