[GH-ISSUE #503] Sender column in cache.db shows invalid IP #382

Closed
opened 2026-05-07 00:23:41 +02:00 by BreizhHardware · 9 comments

Originally created by @binwiederhier on GitHub (Nov 16, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/503

sqlite> select * from messages limit 10
   ...> ;
247|OIvQ1dqYzCYP|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
248|yRmpGNK6Rtnr|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
249|CYfstoAzWhx6|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
250|9bqeSW4eQwL2|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
251|M6jJkh3UpIWo|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
252|EI39IZaXIH3Z|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
253|h8lqfzT4xtrx|1668540106|aa|triggered||0||||||0|0||invalid IP||1|
254|vDrRlh3DdiJx|1668540155|aa|triggered||0||||||0|0||invalid IP||1|
255|SoomY2DjlmXU|1668540155|aa|triggered||0||||||0|0||invalid IP||1|
256|oueH0BOGr0tm|1668540155|aa|triggered||0||||||0|0||invalid IP||1|
Originally created by @binwiederhier on GitHub (Nov 16, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/503 ``` sqlite> select * from messages limit 10 ...> ; 247|OIvQ1dqYzCYP|1668540105|aa|triggered||0||||||0|0||invalid IP||1| 248|yRmpGNK6Rtnr|1668540105|aa|triggered||0||||||0|0||invalid IP||1| 249|CYfstoAzWhx6|1668540105|aa|triggered||0||||||0|0||invalid IP||1| 250|9bqeSW4eQwL2|1668540105|aa|triggered||0||||||0|0||invalid IP||1| 251|M6jJkh3UpIWo|1668540105|aa|triggered||0||||||0|0||invalid IP||1| 252|EI39IZaXIH3Z|1668540105|aa|triggered||0||||||0|0||invalid IP||1| 253|h8lqfzT4xtrx|1668540106|aa|triggered||0||||||0|0||invalid IP||1| 254|vDrRlh3DdiJx|1668540155|aa|triggered||0||||||0|0||invalid IP||1| 255|SoomY2DjlmXU|1668540155|aa|triggered||0||||||0|0||invalid IP||1| 256|oueH0BOGr0tm|1668540155|aa|triggered||0||||||0|0||invalid IP||1| ```
BreizhHardware 2026-05-07 00:23:41 +02:00
Author
Owner

@binwiederhier commented on GitHub (Nov 16, 2022):

Likely related to the work in #429
/cc @karmanyaahm

<!-- gh-comment-id:1316191231 --> @binwiederhier commented on GitHub (Nov 16, 2022): Likely related to the work in #429 /cc @karmanyaahm
Author
Owner

@karmanyaahm commented on GitHub (Nov 16, 2022):

I'll see what I can find

<!-- gh-comment-id:1316461458 --> @karmanyaahm commented on GitHub (Nov 16, 2022): I'll see what I can find
Author
Owner

@karmanyaahm commented on GitHub (Nov 17, 2022):

Are there any patterns (to help me reproduce this)? Is it happening often or rarely; for any content or just "triggered"; with no attachments?

<!-- gh-comment-id:1319076747 --> @karmanyaahm commented on GitHub (Nov 17, 2022): Are there any patterns (to help me reproduce this)? Is it happening often or rarely; for any content or just "triggered"; with no attachments?
Author
Owner

@binwiederhier commented on GitHub (Nov 17, 2022):

sqlite> select count(*) from messages where sender='invalid IP';
count(*)  
----------
137932    
       
sqlite> select count(*) from messages where sender<>'invalid IP';
count(*)  
----------
1239    

Pretty much all messages have this. I may have time to look tonight a little.

<!-- gh-comment-id:1319150272 --> @binwiederhier commented on GitHub (Nov 17, 2022): ``` sqlite> select count(*) from messages where sender='invalid IP'; count(*) ---------- 137932 sqlite> select count(*) from messages where sender<>'invalid IP'; count(*) ---------- 1239 ``` Pretty much all messages have this. I may have time to look tonight a little.
Author
Owner

@binwiederhier commented on GitHub (Nov 17, 2022):

It is worth noting that I'm behind nginx with the config mentioned here: https://docs.ntfy.sh/config/#nginxapache2caddy
Maybe an issue with X-Forwarded-For parsing?

<!-- gh-comment-id:1319151376 --> @binwiederhier commented on GitHub (Nov 17, 2022): It is worth noting that I'm behind nginx with the config mentioned here: https://docs.ntfy.sh/config/#nginxapache2caddy Maybe an issue with X-Forwarded-For parsing?
Author
Owner

@karmanyaahm commented on GitHub (Nov 17, 2022):

I only ever tested with Caddy, so that might be it, I"ll try setting up nginx.

<!-- gh-comment-id:1319223622 --> @karmanyaahm commented on GitHub (Nov 17, 2022): I only ever tested with Caddy, so that might be it, I"ll try setting up nginx.
Author
Owner

@binwiederhier commented on GitHub (Nov 17, 2022):

Don't worry about it. I can probably figure it out. Unless you're eager to learn nginx hehe

<!-- gh-comment-id:1319313921 --> @binwiederhier commented on GitHub (Nov 17, 2022): Don't worry about it. I can probably figure it out. Unless you're eager to learn nginx hehe
Author
Owner

@binwiederhier commented on GitHub (Nov 18, 2022):

https://pkg.go.dev/net/netip#Addr.String

String returns the string form of the IP address ip. It returns one of 5 forms:

  • "invalid IP", if ip is the zero Addr
    ...
<!-- gh-comment-id:1319428078 --> @binwiederhier commented on GitHub (Nov 18, 2022): https://pkg.go.dev/net/netip#Addr.String > String returns the string form of the IP address ip. It returns one of 5 forms: > - "invalid IP", if ip is the zero Addr > ...
Author
Owner

@karmanyaahm commented on GitHub (Nov 24, 2022):

Interesting ... so I should've set the 'invalid IP's to empty strings, and validated them at parse time.

<!-- gh-comment-id:1326033811 --> @karmanyaahm commented on GitHub (Nov 24, 2022): Interesting ... so I should've set the 'invalid IP's to empty strings, and validated them at parse time.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#382
No description provided.