[GH-ISSUE #1085] which key?? #761

Closed
opened 2026-05-07 00:27:16 +02:00 by BreizhHardware · 5 comments

Originally created by @simpsonetti on GitHub (Apr 9, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1085

When i type this here at command prompt:
ntfy serve
i get this:
yaml: line 21: did not find expected key

In line 21 there is only a #

19 # To listen on all interfaces, you may omit the IP address, e.g. ":443".
20 # To disable HTTP, set "listen-http" to "-".
21 #
22 listen-http: ":80"
23 listen-https: ":443"
24
25 # Listen on a Unix socket, e.g. /var/lib/ntfy/ntfy.sock
26 # This can be useful to avoid port issues on local systems, and to simplify permissions.
27 #
28 # listen-unix:
29 # listen-unix-mode: <linux permissions, e.g. 0700>
30
31 # Path to the private key & cert file for the HTTPS web server. Not used if "listen-https" is not set.
32 #
33 key-file: "/home/rzadmin/cert/ntfy.key"
34 cert-file: "/home/rzadmin/cert/ntfy.crt"
35

so which key does is mean?
Thanks and regards

Originally created by @simpsonetti on GitHub (Apr 9, 2024). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1085 When i type this here at command prompt: ntfy serve i get this: yaml: line 21: did not find expected key In line 21 there is only a # 19 # To listen on all interfaces, you may omit the IP address, e.g. ":443". 20 # To disable HTTP, set "listen-http" to "-". 21 # 22 listen-http: ":80" 23 listen-https: ":443" 24 25 # Listen on a Unix socket, e.g. /var/lib/ntfy/ntfy.sock 26 # This can be useful to avoid port issues on local systems, and to simplify permissions. 27 # 28 # listen-unix: <socket-path> 29 # listen-unix-mode: <linux permissions, e.g. 0700> 30 31 # Path to the private key & cert file for the HTTPS web server. Not used if "listen-https" is not set. 32 # 33 key-file: "/home/rzadmin/cert/ntfy.key" 34 cert-file: "/home/rzadmin/cert/ntfy.crt" 35 so which key does is mean? Thanks and regards
Author
Owner

@W1BTR commented on GitHub (May 23, 2024):

also having this issue on a fresh install with cache enabled.

<!-- gh-comment-id:2127187635 --> @W1BTR commented on GitHub (May 23, 2024): also having this issue on a fresh install with cache enabled.
Author
Owner

@wunter8 commented on GitHub (May 23, 2024):

Check your server.yml syntax here: yamllint.com

<!-- gh-comment-id:2127196579 --> @wunter8 commented on GitHub (May 23, 2024): Check your server.yml syntax here: yamllint.com
Author
Owner

@W1BTR commented on GitHub (May 23, 2024):

Check your server.yml syntax here: yamllint.com

I dont have any yamllint.com in my config. The error goes away when I remove my base-url from the config.

Also worth noting I am behind an apache proxy

<!-- gh-comment-id:2127204214 --> @W1BTR commented on GitHub (May 23, 2024): > Check your server.yml syntax here: yamllint.com I dont have any yamllint.com in my config. The error goes away when I remove my base-url from the config. Also worth noting I am behind an apache proxy
Author
Owner

@W1BTR commented on GitHub (May 23, 2024):

Apparently yaml files need spaces before each line. I did not have a space before any line in the server.yml file.

Simply adding a single space fixed all the issues.

<!-- gh-comment-id:2127220281 --> @W1BTR commented on GitHub (May 23, 2024): Apparently yaml files need spaces before each line. I did not have a space before any line in the server.yml file. Simply adding a single space fixed all the issues.
Author
Owner

@wunter8 commented on GitHub (May 23, 2024):

Glad it's working now!

(I will say, though, yaml files don't need a space before each line. BUT the whitespace does need to be consistent throughout the file. So if your first line had a space before it, all the others would need one, too. It should still work if you remove the leading space from every line, so that none of them have a leading space)

<!-- gh-comment-id:2127302055 --> @wunter8 commented on GitHub (May 23, 2024): Glad it's working now! (I will say, though, yaml files don't need a space before each line. BUT the whitespace does need to be consistent throughout the file. So if your first line had a space before it, all the others would need one, too. It should still work if you remove the leading space from every line, so that none of them have a leading space)
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#761
No description provided.