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

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

Open
eddiex666 opened this issue Feb 23, 2023 · 10 comments
Open

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

eddiex666 opened this issue Feb 23, 2023 · 10 comments

Comments

@eddiex666
Copy link

eddiex666 commented Feb 23, 2023

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

@toxuin
Copy link
Owner

toxuin commented Feb 26, 2023

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.

@eddiex666
Copy link
Author

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!")
}

@toxuin
Copy link
Owner

toxuin commented Feb 27, 2023

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.

@eddiex666
Copy link
Author

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
Copy link
Author

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

@eddiex666
Copy link
Author

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

:-)

@eddiex666
Copy link
Author

image

@eddiex666
Copy link
Author

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.

@my-bam
Copy link

my-bam commented Jun 22, 2023

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

@Isuru-rana
Copy link

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

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

No branches or pull requests

4 participants