After reboot Linux system edge runtime should run as expected
IoT Edge runtime is not working .workload.sock & mgmt.sock file missing after reboot my Linux.
RHEL 7.5
amd64
Linux container
1.0.1
iot edge 1.0.1
mcr.microsoft.com/azureiotedge-agent:1.0.1
mcr.microsoft.com/azureiotedge-hub:1.0.1
Docker version 18.09.0-dev, build 021bf39d
Edge runtime faild to start
The same thing happens to us as well on RHEL 7.5. It works fine on Ubuntu, Debian and Windows.
Thanks, @pbiswas-kol, @Jan-Olof
I will take a look. Do you have logs from iotedged (with any PII removed) you would be willing to share?
Thanks,
Dave
I had 3 problems upon a reboot:
sudo systemctl start docker
sudo mkdir /var/run/iotedge
sudo chown iotedge.iotedge /var/run/iotedge
sudo systemctl restart iotedge
sudo chmod 660 /var/run/iotedge/mgmt.sock
sudo chmod 666 /var/run/iotedge/workload.sock
Are these the same issues you had?
I am still investigating why all this happened.
@darobs Yes, that pretty much sums up our problem. Great that you are able to recreate this.
By the way, we can get rid of the Moby problem by running this once:
sudo systemctl enable docker
@jan-Olof Yes you are correct. We can rid of mody restart problem on reboot by just enable the docker.
@darobs yes , this the issue that we are facing.
I reinstall edge runtime and configure config.yml again after reboot. It works. I will try your workaround. When we expect a permanent solution for this issue?
With distributions where systemd doesn't manage the sockets, we made a strategic error in placing the socket files in /var/run/iotedge - a directory that doesn't survive a reboot.
The plan going forward is for distributions like RHEL 7.5 is to move the location of a socket file to a different directory: /var/lib/iotedge - a directory we already create at installation and survives a reboot.
Right now, to emulate what we're planning to change (NOTE - this requires you to stop and restart iotedge):
sudo systemctl enable docker iotedge
sudo touch /var/lib/iotedge/mgmt.sock
sudo touch /var/lib/iotedge/workload.sock
sudo chown iotedge:iotedge /var/run/iotedge/mgmt.sock
sudo chown iotedge:iotedge /var/run/iotedge/workload.sock
sudo chmod 660 /var/run/iotedge/mgmt.sock
sudo chmod 666 /var/run/iotedge/workload.sock
sudo docker rm -f $(sudo docker ps -aq -f "label=net.azure-devices.edge.owner=Microsoft.Azure.Devices.Edge.Agent") && sudo systemctl stop iotedge
management_uri: "unix:///var/lib/iotedge/mgmt.sock"
workload_uri: "unix:///var/lib/iotedge/workload.sock"
sudo systemctl restart iotedge
You should see a PR for this in a day or two - If I'm lucky, we can get this into the next release.
I have a PR out, testing it now. #271
@darobs
Command you mentioned here should be like this.
sudo touch /var/lib/iotedge/mgmt.sock
sudo touch /var/lib/iotedge/workload.sock
sudo chown iotedge:iotedge /var/lib/iotedge/mgmt.sock
sudo chown iotedge:iotedge /var/lib/iotedge/workload.sock
sudo chmod 660 /var/lib/iotedge/mgmt.sock
sudo chmod 666 /var/lib/iotedge/workload.sock
So after doing all the steps "iotedge list" commands are not working
An error in the management http client occurred.
caused by: Hyper error
caused by: Connection refused (os error 111)
And "iotedge logs XXModule" commands also not working
A module runtime error occurred.
But if we run systemctl status iotedge . I can see IoT Edge runtime is running
iotedge.service - Azure IoT Edge daemon
Loaded: loaded (/usr/lib/systemd/system/iotedge.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2018-09-14 10:51:30 CEST; 12min ago
Docs: man:iotedged(8)
Main PID: 26420 (iotedged)
Tasks: 6
Memory: 3.6M
CGroup: /system.slice/iotedge.service
鈹斺攢26420 /usr/bin/iotedged -c /etc/iotedge/config.yamlSep 14 11:03:38 xxx iotedged[26420]: 2018-09-14T09:03:38Z [INFO] - [mgmt] - - - [2018-09-14 09:03:38.301188814 UTC] "GET /modules?api-version=2018...pid(26446)
Sep 14 11:03:38 xxx iotedged[26420]: 2018-09-14T09:03:38Z [INFO] - [work] - - - [2018-09-14 09:03:38.302829177 UTC] "POST /modules/%24edgeAgent/ge...pid(26446)
Sep 14 11:03:43 xxx iotedged[26420]: 2018-09-14T09:03:43Z [INFO] - [mgmt] - - - [2018-09-14 09:03:43.326107588 UTC] "GET /modules?api-version=2018...pid(26446)
Sep 14 11:03:43 xxx iotedged[26420]: 2018-09-14T09:03:43Z [INFO] - [work] - - - [2018-09-14 09:03:43.327485648 UTC] "POST /modules/%24edgeAgent/ge...pid(26446)
Sep 14 11:03:48 xxx iotedged[26420]: 2018-09-14T09:03:48Z [INFO] - [mgmt] - - - [2018-09-14 09:03:48.349399179 UTC] "GET /modules?api-version=2018...pid(26446)
Sep 14 11:03:48 xxx iotedged[26420]: 2018-09-14T09:03:48Z [INFO] - [work] - - - [2018-09-14 09:03:48.351180321 UTC] "POST /modules/%24edgeAgent/ge...pid(26446)
Sep 14 11:03:53 xxx iotedged[26420]: 2018-09-14T09:03:53Z [INFO] - [mgmt] - - - [2018-09-14 09:03:53.376399686 UTC] "GET /modules?api-version=2018...pid(26446)
Sep 14 11:03:53 xxx iotedged[26420]: 2018-09-14T09:03:53Z [INFO] - [work] - - - [2018-09-14 09:03:53.378147913 UTC] "POST /modules/%24edgeAgent/ge...pid(26446)
Sep 14 11:03:58 xxx iotedged[26420]: 2018-09-14T09:03:58Z [INFO] - [mgmt] - - - [2018-09-14 09:03:58.400162022 UTC] "GET /modules?api-version=2018...pid(26446)
Sep 14 11:03:58 xxx iotedged[26420]: 2018-09-14T09:03:58Z [INFO] - [work] - - - [2018-09-14 09:03:58.400864174 UTC] "POST /modules/%24edgeAgent/ge...pid(26446)
Hint: Some lines were ellipsized, use -l to show in full.
The error you're seeing is because the default socket for the iotedge command is unix:///var/run/iotedge/mgmt.sock
Try iotedge list --host unix:///var/lib/iotedge/mgmt.sock
In the 1.0.2 version of the iotedged, the rpm and deb packages have been updated with the changes @darobs describes above. Please upgrade to 1.0.2. Closing this issue for now, but feel free to reopen. Thanks.
Most helpful comment
The error you're seeing is because the default socket for the iotedge command is
unix:///var/run/iotedge/mgmt.sockTry
iotedge list --host unix:///var/lib/iotedge/mgmt.sock