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

yaml: line 23: did not find expected key #106

Closed
zombiehoffa opened this issue Jul 14, 2024 · 3 comments
Closed

yaml: line 23: did not find expected key #106

zombiehoffa opened this issue Jul 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@zombiehoffa
Copy link

zombiehoffa commented Jul 14, 2024

Describe the bug
I followed the instructions for the config but no matter what I try I can't get it to load the config file with my ntfy server enabled. I kind of expect the problem to be me doing something boneheaded but I can't figure it out so I am posting here.

Expected behavior
yaml doesn't fail to load config on a did not find expected key error and the software starts up and runs

To Reproduce
start up frigate-notify with my config.yml

Versions:

  • Frigate NVR: 0.14.0-beta4
  • Frigate-Notify: docker latest v0.3.2

Frigate-Notify Config:

frigate:
  server: http://frigatestable:5000
  ignoressl: true

  startup_check:
    attempts: 5
    interval: 30
  webapi:
    enabled: true
    interval: 30
alerts:
  general:
    title: Frigate Alert
    timeformat: Mon, 02 Jan 2006 15:04:05 MST
    nosnap: allow
  zones:
    unzoned: drop
    allow:
      - frontdoorpeops
  ntfy:
    enabled: true
    server: https://ntfy.mahserver.com
    topic: frigateyyc
    ignoressl: false
    headers:
      - Authorization: Bearer tk_ihwgccyeaqpe086fzra0ymg9z7ffe
    template: {{ .Camera }} spotted {{ .Label }}

This works if I comment out ntfy: and everything below.

Frigate-Notify Logs:

2024/07/14 08:33:15 -0600 DBG main.go:48 > Debug logging enabled
2024/07/14 08:33:15 -0600 INF main.go:51 > Frigate Notify - v0.3.2
2024/07/14 08:33:15 -0600 INF main.go:52 > Starting...
2024/07/14 08:33:15 -0600 DBG config/config.go:186 > Attempting to load config file: /app/config/config.yml
2024/07/14 08:33:15 -0600 FTL config/config.go:201 > Failed to load config from file! error="yaml: line 20: did not find expected key"

Additional context
If I disable ntfy: and below it works. line 20 is ntfy: according to nano. I really do think I am just doing something wrong here but I've tried a whole bunch of stuff and I can't figure out what I am doing wrong so I am posting as a bug in case it is a bug with the ntfy code.
Screenshots
If applicable, add screenshots to help explain your problem.

@zombiehoffa zombiehoffa added the bug Something isn't working label Jul 14, 2024
@zombiehoffa
Copy link
Author

This does appear to be a bug. template: can't appear to start with { otherwise it errors out and the error message was pretty useless because the problem wasn't line 23, it was serveral lines down.

@freefd
Copy link
Contributor

freefd commented Jul 15, 2024

Dear @zombiehoffa, could you try to define the pattern in the following notation?

alerts:
  ...
  ntfy:
    ...
    template: |
      {{ .Camera }} spotted {{ .Label }}

@0x2142
Copy link
Owner

0x2142 commented Aug 14, 2024

Just released v0.3.3, and I included a note in the docs to mention this. Using the multi-line format above works, or alternatively just quote the single-line template and that should be fine too

@0x2142 0x2142 closed this as completed Aug 14, 2024
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

3 participants