alarmserver icon indicating copy to clipboard operation
alarmserver copied to clipboard

panic: Both MQTT and Webhook buses are disabled. Nothing to do!

Open eddiex666 opened this issue 2 years ago • 10 comments

2023-02-23T12:38:22.793747923Z panic: Both MQTT and Webhook buses are disabled. Nothing to do! 2023-02-23T12:38:22.793881085Z 2023-02-23T12:38:22.793885081Z goroutine 1 [running]: 2023-02-23T12:38:22.794528495Z github.com/toxuin/alarmserver/config.(*Config).Load(0x8?) 2023-02-23T12:38:22.794644780Z /tmp/app/config/config.go:160 +0xe8b 2023-02-23T12:38:22.794730582Z main.main() 2023-02-23T12:38:22.794974695Z /tmp/app/main.go:25 +0x35

Any ideas?

config file is:

debug: true

hikvision: enabled: true cams: myCam: address: 192.168.1.19 https: false username: admin password: admin rawTcp: true

mqtt: enabled: true username: alarmserver password: "assword" port: 1883 server: "192.168.1.20" topicroot: camera-alerts

testet config file name = config.yml and config.yaml

Running on Ubuntu, Docker

Eddie

eddiex666 avatar Feb 23 '23 12:02 eddiex666

The config snippet that you posted does not format as a valid YAML. I suspect the indentation in your config is not correct, resulting in invalid configuration. If you can, please pot your formatted config or you can use gist to save your config and share the link to it here in the issue.

toxuin avatar Feb 26 '23 22:02 toxuin

I found the error:

the check file , config.go checks for both mqtt and webservices.

Do we need both?

if !myConfig.Mqtt.Enabled && !myConfig.Webhooks.Enabled {
	panic("Both MQTT and Webhook buses are disabled. Nothing to do!")
}

eddiex666 avatar Feb 27 '23 07:02 eddiex666

This line checks for when both webhooks and MQTT are disabled. This means there is nothing for this software to do - it needs at least one of those enabled. Please provide your config in original format including indentation.

toxuin avatar Feb 27 '23 07:02 toxuin

https://gist.github.com/eddiex666/d8a7014ba66e125582def940bf1a3220

I tryed to copy the sample file and remove webhooks and camera. the sample file is using "tab" from CMD. I also testet to edit inside Blusfish and Notepad++

I just need 1 camera and mqtt for the test

debug: true

hikvision: enabled: true cams: myCam: address: 192.168.1.17 https: false username: admin password: admin rawTcp: true

mqtt: enabled: true username: alarmserver password: "assword" port: 1883 server: "192.168.1.4" topicroot: camera-alerts

eddiex666 avatar Feb 27 '23 07:02 eddiex666

i just copy and paste the sample config file into my config.yaml file and i still get the error...

eddiex666 avatar Feb 27 '23 14:02 eddiex666

Maybe someone can send me a valid dummy config file? with mqtt and 1 camera... that works...

:-)

eddiex666 avatar Mar 01 '23 07:03 eddiex666

image

eddiex666 avatar Mar 01 '23 18:03 eddiex666

we found the BUG.

The config file is not reading from correct path. it should be ./config.yml/config.yaml

but in GO file its referating to ./config/config.yaml

However the default config file it been generated into the docker container patch, under DIFF, and this file is been read correct.

eddiex666 avatar Mar 02 '23 09:03 eddiex666

Hi guys. I have the same problem. I still don't understand how to fix it?

my-bam avatar Jun 22 '23 10:06 my-bam

Hi, @eddiex666 have you solved this problem? Changing location didn't work for me.

Isuru-rana avatar Sep 22 '23 03:09 Isuru-rana