-
Notifications
You must be signed in to change notification settings - Fork 55
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
Device unable to connect after restart command #1579
Comments
Thanks @bjoernsauer for the details. We will see if we can reproduce it, otherwise we will reach out for some more details. |
@bjoernsauer After the reboot, could you check if the If you are using systemctl, you can check this via: sudo systemctl status mosquitto.service And it should return something like this $ sudo systemctl status mosquitto.service
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-11-13 23:17:28 CET; 2 days ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 2003 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
Main PID: 546 (mosquitto)
Tasks: 1 (limit: 4915)
CPU: 1min 37.976s
CGroup: /system.slice/mosquitto.service
└─546 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf |
Hi @reubenmiller, I'm using a sysvinit system via a self defined system.toml file. |
@bjoernsauer Could you please post your The restart command should invoke |
Hi @reubenmiller The restart is not the problem manually calling
system.toml [init]
name = "sysv"
is_available = ["/etc/tedge/system_helper.sh", "available"]
restart = ["/etc/tedge/system_helper.sh", "initd", "{}", "restart"]
stop = ["/etc/tedge/system_helper.sh", "initd", "{}", "stop"]
enable = ["/etc/tedge/system_helper.sh", "updaterc", "{}", "enable"]
disable = ["/etc/tedge/system_helper.sh", "updaterc", "{}", "disable"]
is_active = ["/etc/tedge/system_helper.sh", "initd", "{}", "status"] script file system_helper.sh #!/bin/sh
mode=$1
service=$2
arg=$3
systemctl_available () {
command -v systemctl >/dev/null 2>&1;
}
do_check_sysv_is_available () {
if systemctl_available; then
echo "systemd init detected."
exit 1
fi
if [ -L /sbin/init ]; then
if [ $(readlink /sbin/init) = "/sbin/init.sysvinit" ]; then
echo "SysV init detected."
exit 0;
elif [ $(readlink /sbin/init) = "/lib/systemd/systemd" ]; then
echo "systemd init detected."
exit 1
else
echo "No SysV init detected."
exit 2;
fi
# if init is not a symlink we have sysv
elif [ -f /sbin/init ]; then
echo "SysV init detected."
exit 0;
else
echo "No SysV init detected."
exit 3;
fi
}
do_initd_script_call () {
/etc/init.d/${service} $arg
exit $?
}
do_updaterc_call () {
if [ $arg = "enable" ]; then
update-rc.d $service defaults 98 20
update-rc.d $service enable
else
update-rc.d $service disable
fi
exit $?
}
if [ $mode = "available" ]; then
do_check_sysv_is_available
elif [ $mode = "initd" ]; then
do_initd_script_call
elif [ $mode = "updaterc" ]; then
do_updaterc_call
else
exit 1
fi |
The logs are very useful there, could you modify how the For example in systemd this would be editing the service definition (though your usage might differ slightly if you are using sysvinit) File:
|
Hi @reubenmiller, here is the log after the device reboot.
|
Looks like we have found the root cause! Seems to be a problem with the mosquitto regarding a bridge connection in version Looking at the mosquitto logs 1669879960: mosquitto version 2.0.15 running
1669879960: Expiring client Cumulocity due to timeout. Then when rebooting, it works again. Below shows the happy case. But a subsequent reboot would result in the
Here is the ticket from the mosquitto repo eclipse/mosquitto#2634 Recommended fix
|
@bjoernsauer Did downgrading to mosquitto |
Downgraded mosquitto from 2.0.15 to 2.0.11. So far the issue did not occure again. |
We have the same problem at our installations also. We downgraded to 2.0.14 at that solved it. |
Describe the bug
Performing a device restart from cumulocity restarts the device. However the device is not able to connect to the tenant after the restart.
Log output of the tedge-mapper-c8y:
The error repeats until a manual reboot. After the manual reboot the device can connect to cumulocity again without an error.
Log after manual reboot:
To Reproduce
Issue a restart command.
Expected behavior
The device should connect after a restart command.
Environment:
The text was updated successfully, but these errors were encountered: