[GH-ISSUE #579] Error 500 Code 50001 but message delivered #441

Closed
opened 2026-05-07 00:24:09 +02:00 by BreizhHardware · 4 comments

Originally created by @DarkChyper on GitHub (Jan 12, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/579

Hello,

I install this project on my own server, i don't know if the error i found is an issue or a bad setting.

I install on a VPS debian, apache 2 with a proxy (because there are many vhosts on my server).

i secure sending message with a unique admin user and when i send a message i receive this :

{"code":50001,"http":500,"error":"internal server error"}

But i receive the message on the webapp and android app.

I don't know where logs are, i did not found them in /var/log.

My server settings:

listen-http: "127.0.0.1:2586"
behind-proxy: true
cache-file: "/var/cache/ntfy/cache.db"
attachment-cache-dir: "/var/cache/ntfy/attachments"
keepalive-interval: "45s"
auth-file: "/var/lib/ntfy/user.db"
auth-default-access: "deny-all"

My vhost config :

<VirtualHost *:80>
    ServerName ntfy.mydomain.com

    # Proxy connections to ntfy (requires "a2enmod proxy")
    ProxyPass / http://127.0.0.1:2586/
    ProxyPassReverse / http://127.0.0.1:2586/

    SetEnv proxy-nokeepalive 1
    SetEnv proxy-sendchunked 1

    # Higher than the max message size of 4096 bytes
    LimitRequestBody 102400

    # Enable mod_rewrite (requires "a2enmod rewrite")
    RewriteEngine on

    # Redirect HTTP to HTTPS, but only for GET topic addresses, since we want 
    # it to work with curl without the annoying https:// prefix 
    RewriteCond %{REQUEST_METHOD} GET
    RewriteRule ^/([-_A-Za-z0-9]{0,64})$ https://%{SERVER_NAME}/$1 [END,NE,R=permanent]
</VirtualHost>

and vhost https :

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName ntfy.mydomain.com

    # Proxy connections to ntfy (requires "a2enmod proxy")
    ProxyPass / http://127.0.0.1:2586/
    ProxyPassReverse / http://127.0.0.1:2586/

    SetEnv proxy-nokeepalive 1
    SetEnv proxy-sendchunked 1

    # Higher than the max message size of 4096 bytes
    LimitRequestBody 102400

    # Enable mod_rewrite (requires "a2enmod rewrite")
    RewriteEngine on

    # WebSockets support (requires "a2enmod rewrite proxy_wstunnel")
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "ws://127.0.0.1:2586/$1" [P,L]

SSLCertificateFile /etc/letsencrypt/live/ntfy.mydomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ntfy.mydomain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

I believe the problem is between my chair and my keyboard but i need help to understand :)

Originally created by @DarkChyper on GitHub (Jan 12, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/579 Hello, I install this project on my own server, i don't know if the error i found is an issue or a bad setting. I install on a VPS debian, apache 2 with a proxy (because there are many vhosts on my server). i secure sending message with a unique admin user and when i send a message i receive this : `{"code":50001,"http":500,"error":"internal server error"}` But i receive the message on the webapp and android app. I don't know where logs are, i did not found them in /var/log. My server settings: ```base-url: "https://ntfy.mydomain.com" listen-http: "127.0.0.1:2586" behind-proxy: true cache-file: "/var/cache/ntfy/cache.db" attachment-cache-dir: "/var/cache/ntfy/attachments" keepalive-interval: "45s" auth-file: "/var/lib/ntfy/user.db" auth-default-access: "deny-all" ``` My vhost config : ``` <VirtualHost *:80> ServerName ntfy.mydomain.com # Proxy connections to ntfy (requires "a2enmod proxy") ProxyPass / http://127.0.0.1:2586/ ProxyPassReverse / http://127.0.0.1:2586/ SetEnv proxy-nokeepalive 1 SetEnv proxy-sendchunked 1 # Higher than the max message size of 4096 bytes LimitRequestBody 102400 # Enable mod_rewrite (requires "a2enmod rewrite") RewriteEngine on # Redirect HTTP to HTTPS, but only for GET topic addresses, since we want # it to work with curl without the annoying https:// prefix RewriteCond %{REQUEST_METHOD} GET RewriteRule ^/([-_A-Za-z0-9]{0,64})$ https://%{SERVER_NAME}/$1 [END,NE,R=permanent] </VirtualHost> ``` and vhost https : ``` <IfModule mod_ssl.c> <VirtualHost *:443> ServerName ntfy.mydomain.com # Proxy connections to ntfy (requires "a2enmod proxy") ProxyPass / http://127.0.0.1:2586/ ProxyPassReverse / http://127.0.0.1:2586/ SetEnv proxy-nokeepalive 1 SetEnv proxy-sendchunked 1 # Higher than the max message size of 4096 bytes LimitRequestBody 102400 # Enable mod_rewrite (requires "a2enmod rewrite") RewriteEngine on # WebSockets support (requires "a2enmod rewrite proxy_wstunnel") RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule ^/?(.*) "ws://127.0.0.1:2586/$1" [P,L] SSLCertificateFile /etc/letsencrypt/live/ntfy.mydomain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/ntfy.mydomain.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> ``` I believe the problem is between my chair and my keyboard but i need help to understand :)
Author
Owner

@binwiederhier commented on GitHub (Jan 12, 2023):

See https://github.com/binwiederhier/ntfy/issues/448

Or other tickets you can find by searching closed issues.

<!-- gh-comment-id:1380340542 --> @binwiederhier commented on GitHub (Jan 12, 2023): See https://github.com/binwiederhier/ntfy/issues/448 Or other tickets you can find by searching closed issues.
Author
Owner

@DarkChyper commented on GitHub (Jan 12, 2023):

OK thanks, i did a search but not with the good hit words...

I see there nothing in this ticket to help me and i have a new information

There is no problem when i lauch service with the command line ntfy serve but when the commend is launch on server startup, i receive the error.

I will try to send logs into a file to catch them.

<!-- gh-comment-id:1380354641 --> @DarkChyper commented on GitHub (Jan 12, 2023): OK thanks, i did a search but not with the good hit words... I see there nothing in this ticket to help me and i have a new information There is no problem when i lauch service with the command line `ntfy serve` but when the commend is launch on server startup, i receive the error. I will try to send logs into a file to catch them.
Author
Owner

@binwiederhier commented on GitHub (Jan 12, 2023):

Enable debug or trace logs in the server, and that should tell you what's wrong.

<!-- gh-comment-id:1380355918 --> @binwiederhier commented on GitHub (Jan 12, 2023): Enable debug or trace logs in the server, and that should tell you what's wrong.
Author
Owner

@DarkChyper commented on GitHub (Jan 12, 2023):

I increase level log of vhost but it was not better.

i used a file in /etc/init to launch service on startup, i change to @reboot job in crontab and it works !

<!-- gh-comment-id:1380391237 --> @DarkChyper commented on GitHub (Jan 12, 2023): I increase level log of vhost but it was not better. i used a file in /etc/init to launch service on startup, i change to @reboot job in crontab and it works !
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#441
No description provided.