joshuar / go-hass-agent

A Home Assistant, native app for desktop/laptop devices.
MIT License
128 stars 9 forks source link

[BUG] #200

Closed swjpilot closed 1 month ago

swjpilot commented 1 month ago

Go Hass Agent Version

johns@theo:~$ go-hass-agent version
7:28AM INF Go Hass Agent: v9.5.0

Describe the bug Agent won't start when MQTT is configured on Ubuntu 24.04

To Reproduce Steps to reproduce the behaviour:

  1. Configure and enable MQTT Settings
  2. Restart Agent
  3. Bob's your Uncle....
  4. See error.

Expected behaviour I expect the agent to start and connect to my HA MQTT Server

Screenshots

johns@theo:~$ go-hass-agent run
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xd6548d]

goroutine 162 [running]:
github.com/jfreymuth/pulse/proto.(*Client).error(0xc000636b60, {0x120c2c0, 0x18ae3e0})
    /home/joshua/go/pkg/mod/github.com/jfreymuth/pulse@v0.1.1/proto/client.go:229 +0x20d
github.com/jfreymuth/pulse/proto.(*Client).readLoop(0xc000636b60)
    /home/joshua/go/pkg/mod/github.com/jfreymuth/pulse@v0.1.1/proto/client.go:128 +0x86e
created by github.com/jfreymuth/pulse/proto.(*Client).Open in goroutine 116
    /home/joshua/go/pkg/mod/github.com/jfreymuth/pulse@v0.1.1/proto/client.go:54 +0x125

Logs

johns@theo:~$ go-hass-agent --log-level debug run
7:33AM DBG Debug logging enabled.
7:33AM DBG Setting language to [en-US].
7:33AM DBG Read sensor registry from disk.
7:33AM DBG Agent already registered.
7:33AM DBG Listening for notifications.
7:33AM DBG Could not find any script files.
7:33AM WRN Unable to connect to Pulseaudio. Volume control will be unavailable. error="could not connect to pulseaudio: EOF"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xd6548d]

goroutine 109 [running]:
github.com/jfreymuth/pulse/proto.(*Client).error(0xc000126d00, {0x120c2c0, 0x18ae3e0})
    /home/joshua/go/pkg/mod/github.com/jfreymuth/pulse@v0.1.1/proto/client.go:229 +0x20d
github.com/jfreymuth/pulse/proto.(*Client).readLoop(0xc000126d00)
    /home/joshua/go/pkg/mod/github.com/jfreymuth/pulse@v0.1.1/proto/client.go:128 +0x86e
created by github.com/jfreymuth/pulse/proto.(*Client).Open in goroutine 104
    /home/joshua/go/pkg/mod/github.com/jfreymuth/pulse@v0.1.1/proto/client.go:54 +0x125
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xdd344f]

goroutine 104 [running]:
github.com/joshuar/go-hass-agent/internal/agent.(*linuxMQTTDevice).Subscriptions(0xc00031a380)
    /home/joshua/git/go-hass-agent/internal/agent/mqtt_linux.go:43 +0x22f
github.com/joshuar/go-hass-agent/internal/agent.runMQTTWorker({0x1215008, 0xc000406270}, {0xc000320280, 0x42})
    /home/joshua/git/go-hass-agent/internal/agent/runners.go:257 +0x149
github.com/joshuar/go-hass-agent/internal/agent.(*Agent).Run.func2.4()
    /home/joshua/git/go-hass-agent/internal/agent/agent.go:122 +0xde
created by github.com/joshuar/go-hass-agent/internal/agent.(*Agent).Run.func2 in goroutine 33
    /home/joshua/git/go-hass-agent/internal/agent/agent.go:118 +0x2c5

Ubuntu Linux 24.04

joshuar commented 1 month ago

Oh dear, I really need some test code to catch these. I can see what the problem is and I've merged what I hope will fix it. Can you try it out with one of the artifacts on this page (scroll to the bottom). These are the latest builds with the fix merged. Please choose one of the build-linux-* archives (whatever is the architecture you need). Inside the archive will be all the packages for all distros. Let me know if this fixes the issue!

swjpilot commented 1 month ago

Started right up that seems to work fine now.......

swjpilot commented 1 month ago

closeing