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

Cannot send notifications to custom ntfy server #2

Closed
sethforprivacy opened this issue Apr 22, 2024 · 10 comments
Closed

Cannot send notifications to custom ntfy server #2

sethforprivacy opened this issue Apr 22, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@sethforprivacy
Copy link
Contributor

Bug Description
When setting a custom ntfy server, notifications never go through, but there is no logging from Sentrum to indicate what is happening.

To Reproduce
Set a custom ntfy server via HTTPS, trigger notifications, notice none are received.

Environment
Running in Docker via a custom sentrum.toml.

@sethforprivacy sethforprivacy added the bug Something isn't working label Apr 22, 2024
@sethforprivacy
Copy link
Contributor Author

Note that sending notifications via the same server using curl etc. work without any issues.

@sethforprivacy
Copy link
Contributor Author

Tested both with access control and without and both seem to not work at all. Is there any way I can enable more logging to see exactly where the issue is happening on the Sentrum side? I don't see anything in ntfy logs.

@sommerfelddev
Copy link
Owner

Weird,it works on my personal ntfy server.

You can set the RUST_LOG=debug environment variable to enable more verbose logging both in sentrum and in the ntfy library.

Are you proxying your ntfy server behind cloudflare, nginx or something? If nginx, do you see any relevant logs there?

I'll do some extra tests later just to be sure.

@sethforprivacy
Copy link
Contributor Author

It's quite possible its on my end (I just deployed the ntfy server for this) but everything else I am testing with works without issues, including curl, mobile app test notifications, and web app test notifications.

ntfy is running in Docker, proxied by Traefik, websockets work properly, etc.

@sommerfelddev
Copy link
Owner

sommerfelddev commented Apr 23, 2024

Can you try the latest release [https://github.com/sommerfelddev/sentrum/releases/tag/v0.1.4) with RUST_LOG=debug sentrum --test? I would really like to get this fixed

@sethforprivacy
Copy link
Contributor Author

Yes testing now!

@sethforprivacy
Copy link
Contributor Author

Full log, nothing stands out as there is no logging after the initial connection:

root@e7337b0e3144:/# RUST_LOG=debug /usr/local/bin/sentrum --test
 INFO  sentrum::config > reading configuration from './sentrum.toml'
 DEBUG sentrum::actions > registering action 'terminal_print'
 INFO  sentrum::actions > registered action 'terminal_print'
 DEBUG sentrum::actions > registering action 'ntfy'
 INFO  sentrum::actions > registered action 'ntfy'
 INFO  sentrum          > running test actions
 DEBUG sentrum::actions > running 'terminal_print' action
 DEBUG sentrum::actions > running 'ntfy' action
[{wallet}] new transaction
net: {tx_net} sats, balance: {total_balance} sats, txid: {txid_short}

 DEBUG ntfy::dispatcher > Payload { topic: "sentrum_alerts", message: "net: {tx_net} sats, balance: {total_balance} sats, txid: {txid_short}", title: Some("[{wallet}] new transaction"), tags: Some(["rotating_light"]), priority: Default, actions: None, click: Some(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("mempool.space")), port: None, path: "/tx/%7Btxid%7D", query: None, fragment: None }), attach: None, filename: None, delay: None, email: None, markdown: false }
 DEBUG reqwest::connect > starting new connection: https://ntfy.example.com/
 DEBUG hyper::client::connect::dns > resolving host="ntfy.example.com"
 DEBUG hyper::client::connect::http > connecting to 1.2.3.4:443
 DEBUG hyper::client::connect::http > connected to 1.2.3.4:443

@sommerfelddev
Copy link
Owner

I'm getting more stuff than you after "connected":

 DEBUG reqwest::connect > starting new connection: https://ntfy.example.com/
 DEBUG hyper::client::connect::dns > resolving host="ntfy.example.com"
 DEBUG hyper::client::connect::http > connecting to 1.2.3.4:443
 DEBUG hyper::client::connect::http > connected to 1.2.3.4:443
 DEBUG hyper::proto::h1::io         > flushed 489 bytes
 DEBUG hyper::proto::h1::io         > parsed 11 headers
 DEBUG hyper::proto::h1::conn       > incoming body is content-length (301 bytes)
 DEBUG hyper::proto::h1::conn       > incoming body completed
 DEBUG hyper::client::pool          > pooling idle connection for ("https", ntfy.example.com)

In today's build, I fixed the error message not showing up in the logs when the nfty action fails. This is what it looks like when I remove the required credentials in sentrum.toml for my personal ntfy server:

 ERROR sentrum::actions             > [wallet][txid][ntfy] could not run action: Forbidden

Is it possible this is docker related (maybe network capabilities are restriced)? Can you reproduce it with sentrum running outside docker?

@sethforprivacy
Copy link
Contributor Author

Finally got an error!

 ERROR sentrum::actions             > [wallet][txid][ntfy] could not run action: Reqwest error: error sending request for url (https://ntfy.example.com/): error trying to connect: error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file, error:80000002:system library:file_open:reason(2):../providers/implementations/storemgmt/file_store.c:267:calling stat(/usr/lib/ssl/certs), error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file, error:80000002:system library:file_open:reason(2):../providers/implementations/storemgmt/file_store.c:267:calling stat(/usr/lib/ssl/certs), error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file, error:80000002:system library:file_open:reason(2):../providers/implementations/storemgmt/file_store.c:267:calling stat(/usr/lib/ssl/certs), error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1889: (unable to get local issuer certificate)

I think it can be fixed in the Docker image, testing now.

@sethforprivacy
Copy link
Contributor Author

Fixed in #5

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

No branches or pull requests

2 participants