addons icon indicating copy to clipboard operation
addons copied to clipboard

Mosquitto: SIGSEGV on start after update to 6.4.1

Open chatziko opened this issue 1 year ago • 7 comments

Describe the issue you are experiencing

After upgrading to 6.4.1 mosquitto was constantly crashing on start with the following error:

2024-05-28 22:37:39: Warning: Mosquitto should not be run as root/administrator.
2024-05-28 22:37:39: mosquitto version 2.0.18 starting
2024-05-28 22:37:39: Config loaded from /etc/mosquitto/mosquitto.conf.
2024-05-28 22:37:39: Loading plugin: /usr/share/mosquitto/go-auth.so
2024-05-28 22:37:39:  ├── Username/password checking enabled.
2024-05-28 22:37:39:  ├── TLS-PSK checking enabled.
2024-05-28 22:37:39:  └── Extended authentication not enabled.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x7f585db8d102]

goroutine 1 [running]:
github.com/aws/aws-sdk-go/aws/endpoints.init()
	/root/go/pkg/mod/github.com/aws/[email protected]/aws/endpoints/defaults.go:6644 +0x87d02
[19:37:39] INFO: Service restart after closing
[22:37:40] INFO: Starting mosquitto MQTT broker...

My config:

logins: []
require_certificate: false
certfile: local-chained.crt
keyfile: local.key
customize:
  active: false
  folder: mosquitto

The problem disapeared after downgrading to 6.4.0 via a backup. No time to dig deeper at this moment, I had to revert to a stable system.

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

Mosquitto broker

What is the version of the add-on?

6.4.1

Steps to reproduce the issue

  1. Upgrade to 6.4.1

System Health information

System Information

version core-2024.5.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.29-haos
arch x86_64
timezone Europe/Athens
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.34.0
Stage running
Available Repositories 1402
Downloaded Repositories 23
HACS Data ok
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 12.3
update_channel stable
supervisor_version supervisor-2024.05.1
agent_version 1.6.0
docker_version 25.0.5
disk_total 30.8 GB
disk_used 17.0 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons AppDaemon (0.16.6), ESPHome (2024.4.2), NGINX Home Assistant SSL proxy (3.9.0), Let's Encrypt (5.0.18), Piper (1.5.0), Whisper (2.1.0), Advanced SSH & Web Terminal (18.0.0), Frigate (0.13.2), File editor (5.8.0), openWakeWord (1.10.0), Mosquitto broker (6.4.0), porcupine (1.1.0), porcupine1 (1.2.0), Music Assistant (2.0.4)
Dashboards
dashboards 5
resources 10
views 24
mode storage
Recorder
oldest_recorder_run May 21, 2024 at 19:28
current_recorder_run May 28, 2024 at 22:07
estimated_db_size 386.94 MiB
database_engine sqlite
database_version 3.44.2
Spotify
api_endpoint_reachable ok

Anything in the Supervisor logs that might be useful for us?

2024-05-28 22:34:31.034 ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto

Anything in the add-on logs that might be useful for us?

No response

Additional information

No response

chatziko avatar May 28 '24 19:05 chatziko

Please let us know if you figure out the root cause.

For reference there wasn't any code changes in 6.4.1, only a configuration setting

https://github.com/home-assistant/addons/pull/3615/files

bdraco avatar May 29 '24 04:05 bdraco

After update from 6.4.0 to 6.4.1 all my Zigbee devices got unavailable, then rebooted HA two times to finally find out that mosquitto was not properly started. Downgraded to 6.4.0 solved the issue. Unfortunately, I have not taken any screenshot from the log but the CLI interface was full with some kind of pipe error messages.

mawi2684 avatar May 30 '24 15:05 mawi2684

I'm still on Core 2024.5.4, OS 12.1 as I've not seen changes in latest releases affecting my setup so I omitted updates on them. In the log I only could find a not very helpful message: 2024-05-30 16:36:18.995 ERROR (MainThread) [homeassistant.components.mqtt.client] Failed to connect to MQTT server due to exception: [Errno -5] Name has no usable address

mawi2684 avatar May 30 '24 15:05 mawi2684

Zigbee2MQTT Log: [2024-05-30 16:41:05] info: z2m: Starting zigbee-herdsman (0.46.6) [2024-05-30 16:41:06] info: zh:zstack:znp: Opening SerialPort with {"path":"/dev/ttyUSB0","baudRate":115200,"rtscts":false,"autoOpen":false} [2024-05-30 16:41:06] info: zh:zstack:znp: Serialport opened [2024-05-30 16:41:06] info: z2m: zigbee-herdsman started (resumed) [2024-05-30 16:41:06] info: z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20210708,"transportrev":2},"type":"zStack3x0"}' [2024-05-30 16:41:06] info: z2m: Currently 7 devices are joined: [2024-05-30 16:41:06] info: z2m: ....... Smart plug (with power monitoring) (Router) [2024-05-30 16:41:06] info: z2m: ....... Aqara Door and window sensor (EndDevice) [2024-05-30 16:41:06] info: z2m: ....... Aqara Door and window sensor (EndDevice) [2024-05-30 16:41:06] info: z2m: ....... Aqara Door and window sensor (EndDevice) [2024-05-30 16:41:06] info: z2m: ....... Contact sensor (EndDevice) [2024-05-30 16:41:06] info: z2m: ....... Zigbee two way smart switch (Router) [2024-05-30 16:41:06] info: z2m: ....... Aqara Door and window sensor (EndDevice) [2024-05-30 16:41:06] info: z2m: Zigbee: disabling joining new devices. [2024-05-30 16:41:07] info: z2m: Connecting to MQTT server at mqtt://core-mosquitto:1883 [2024-05-30 16:41:07] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:07] error: z2m: MQTT failed to connect, exiting... [2024-05-30 16:41:07] info: z2m: Stopping zigbee-herdsman... [2024-05-30 16:41:08] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:09] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:14] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:15] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:16] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:18] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:19] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:23] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto [2024-05-30 16:41:25] error: z2m: MQTT error: getaddrinfo ENOTFOUND core-mosquitto

mawi2684 avatar May 30 '24 15:05 mawi2684

same for me ; i rollback to 6.4.0 with the backup

dan9494 avatar Jun 04 '24 19:06 dan9494

This looks similar to https://github.com/eclipse/mosquitto/issues/1419 but that was mentioned as fixed in 1.6.8

bdraco avatar Jun 04 '24 19:06 bdraco

If you can get a core dump, it would be great if you could submit an issue at https://github.com/eclipse/mosquitto/issues/new as this is something that will need to be fixed upstream

bdraco avatar Jun 04 '24 19:06 bdraco

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 04 '24 20:07 github-actions[bot]