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

[BUG] panic: runtime error: invalid memory address or nil pointer dereference (on LXC Desktop) #170

Open
GrumpyMeow opened this issue May 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@GrumpyMeow
Copy link

GrumpyMeow commented May 29, 2024

Go Hass Agent Version
Go Hass Agent: v9.2.0

Describe the bug
Upon running go-hass-agent i get this output:

system@desktop2:~$ go-hass-agent run
11:21AM WRN Could not retrieve battery list. Cannot find any existing batteries. error="SystemBus: unable to get data org.freedesktop.UPower.EnumerateDevices from org.freedesktop.UPower: The name org.freedesktop.UPower was not provided by any .service files"
11:21AM WRN Sensor not found in registry. id=agent_version
11:21AM WRN Sensor not found in registry. id=agent_version
11:21AM WRN Sensor not found in registry. id=mountpoint_root
11:21AM WRN Sensor not found in registry. id=mountpoint_root
11:21AM WRN Sensor not found in registry. id=nvme0n1_disk_reads
11:21AM WRN Sensor not found in registry. id=nvme0n1_disk_reads
11:21AM WRN Sensor not found in registry. id=nvme0n1_disk_read_rate
11:21AM WRN Sensor not found in registry. id=nvme0n1_disk_read_rate
11:21AM WRN Sensor not found in registry. id=kernel_version
11:21AM WRN Sensor not found in registry. id=kernel_version
11:21AM WRN Sensor not found in registry. id=cpu_load_average_(15_min)
11:21AM WRN Sensor not found in registry. id=cpu_load_average_(15_min)
11:21AM WRN Sensor not found in registry. id=bytes_sent_throughput
11:21AM WRN Sensor not found in registry. id=bytes_sent_throughput
11:21AM WRN Sensor not found in registry. id=power_state
11:21AM WRN Sensor not found in registry. id=power_state
11:21AM WRN Sensor not found in registry. id=idle
11:21AM WRN Sensor not found in registry. id=idle
11:21AM WRN Sensor not found in registry. id=last_reboot
11:21AM WRN Sensor not found in registry. id=last_reboot
11:21AM WRN Sensor not found in registry. id=current_users
11:21AM WRN Sensor not found in registry. id=current_users
11:21AM WRN Sensor not found in registry. id=uptime
11:21AM WRN Sensor not found in registry. id=uptime
11:21AM WRN Sensor not found in registry. id=lo_connection_state
11:21AM WRN Sensor not found in registry. id=lo_connection_state
11:21AM WRN Sensor not found in registry. id=bytes_sent
11:21AM WRN Sensor not found in registry. id=bytes_sent
11:21AM WRN Sensor not found in registry. id=cpu_load_average_(1_min)
11:21AM WRN Sensor not found in registry. id=cpu_load_average_(1_min)
11:21AM WRN Sensor not found in registry. id=distribution_name
11:21AM WRN Sensor not found in registry. id=distribution_name
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xd487ae]

goroutine 39 [running]:
github.com/joshuar/go-hass-agent/pkg/linux/hwmon.GetAllSensors()
        /home/runner/work/go-hass-agent/go-hass-agent/pkg/linux/hwmon/hwmon.go:394 +0xae
github.com/joshuar/go-hass-agent/internal/linux/system.HWSensorUpdater.func1(0xc000408400?)
        /home/runner/work/go-hass-agent/go-hass-agent/internal/linux/system/hwmon.go:99 +0x25
github.com/joshuar/go-hass-agent/internal/device/helpers.PollSensors.func1()
        /home/runner/work/go-hass-agent/go-hass-agent/internal/device/helpers/polling.go:27 +0x6f
created by github.com/joshuar/go-hass-agent/internal/device/helpers.PollSensors in goroutine 245
        /home/runner/work/go-hass-agent/go-hass-agent/internal/device/helpers/polling.go:25 +0x125

Expected behaviour
I understand the error about not able to find Upower. This as i'm using a virtualized environment. I uninstalled all power-saving stuff (such as upower). Otherwise the environment would controll the whole machine/host.

Desktop (please complete the following information):

  • OS: Linux
  • Distribution: LXC virtualized Debian 12 + Plasma desktop
  • Version: 12
@GrumpyMeow GrumpyMeow added the bug Something isn't working label May 29, 2024
@joshuar
Copy link
Owner

joshuar commented May 31, 2024

Hey there,

That is an odd error. I'm having a bit of trouble trying to reproduce and understand how the code referenced in the stack trace could result in a nil pointer panic. Would you be able to run the agent with debug logging enabled, that might reveal some more details that could help with troubleshooting. You can run the agent with debug with the following command:

go-hass-agent --log-level debug run

Thanks for trying out the agent!

@joshuar
Copy link
Owner

joshuar commented Jun 17, 2024

Hey there, just wanted to follow-up and see if you can provide debug level logging with the command I posted above? Also, there is a new version that is worth trying with as a lot of code was refactored: v9.4.0.

@joshuar
Copy link
Owner

joshuar commented Jun 28, 2024

Hey there, I haven't been able to reproduce this myself. I would need some more information, such as a debug logs I've requested, in order to continue troubleshooting this issue. Would you be able to try the latest release and if the issue is still present, provide debug logs?

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

2 participants