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

HTTPS error 50001 / http:500 / internal server error #1110

Open
usbrpa opened this issue May 17, 2024 · 6 comments
Open

HTTPS error 50001 / http:500 / internal server error #1110

usbrpa opened this issue May 17, 2024 · 6 comments
Labels
question This is a question

Comments

@usbrpa
Copy link

usbrpa commented May 17, 2024

Sorry if this is due to my ignorance, but I can't be sorting out a small issue:

I set up everything and ntfy is listening on ports 80 http and 444 https (have another server running using port 443 on same machine).

I can connect to both servers from the android app, no issue. Systemctl shows all correctly, running and listening to the right ports.

When I send a message from cli, form wherever, I get a message:

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

If I disable http and only let https run, I get a message that I am trying to send a message to a https server.

Nevertheless, the notifications do work. I receive them in the app in both groups, the one connected to http as well as the one connected to https.

When only using http. I get a feedback after sending the command containing the sent message, which is kind of nice to have.

So everything works, but I can't get {"code":50001,"http":500,"error":"internal server error"} away.

Anyone would happen to have some hints?

Thank you !!!!

@usbrpa usbrpa added the question This is a question label May 17, 2024
@wunter8
Copy link
Contributor

wunter8 commented May 17, 2024

Turn on logging in your server.yml file to see what's going on. "debug" is probably enough, but you could also do "trace"

@usbrpa
Copy link
Author

usbrpa commented May 18, 2024

Hi Wunter,

have done so. I see an error about writing permissions to a DB:

INFO Connection closed with HTTP 500 (ntfy error 50001) (error=attempt to write a readonly database, http_method=POST

ntfy.log

ntfyhttps.log

I also tried the same now only enabling https, commented out http. See log attached.

At the beginning I used to get a message that I was trying to send a message to a https server using http (with curl). This though disappeared.

Thanks.

@usbrpa
Copy link
Author

usbrpa commented May 18, 2024

Sorry, update:

I did comment out http, which was wrong. After putting http to "" instead of commenting it out, I get the following:

root@vps2432639:/var# curl -d "test" x.x.x.x/alerts
Client sent an HTTP request to an HTTPS server.

I also changed server.yml cache db entry to a different file name hoping it would be recreated, maybe with right permissions. Didn't work.

Thanks.

@usbrpa
Copy link
Author

usbrpa commented May 18, 2024

I guess I solved it doing a chown ntfy on the cache db file... is that a good thing?

:-)

@wunter8
Copy link
Contributor

wunter8 commented May 18, 2024

It makes sense that chown on the cache.db file fixed things. You could still send and receive messages (as you saw) without a working cache.

Did you get the http and https stuff figured out? If so, I think we can probably close this!

@usbrpa
Copy link
Author

usbrpa commented May 18, 2024

Yes, it can all be closed. I figured pretty much everything out, it really works like a charm. To be honest, one of the most useful discoveries I've made in years. In my case (home lab / hobby guy) I extremely appreciate being able to get notification from Cron when a job did run etc. I truthfully am delighted by this solution, and havn't explored even 1% of its capabilites. A big THANKS.

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

No branches or pull requests

2 participants