Azure IoT Edge not starting

Sometimes a permission denied is a permission denied 🙁

[INFO] - Starting Azure IoT Edge Security Daemon<br>[INFO] - Version - 1.0.10~rc1<br>[INFO] - Using config file: /etc/iotedge/config.yaml<br>[INFO] - Configuring /var/lib/iotedge as the home directory.<br>[INFO] - Configuring certificates…<br>[INFO] - Transparent gateway certificates not found, operating in quick start mode…<br>[INFO] - Finished configuring provisioning environment variables and certificates.<br>[INFO] - Initializing hsm…<br>[INFO] - Finished initializing hsm.<br>[INFO] - Provisioning edge device…<br>[INFO] - Starting provisioning edge device via manual mode using a device connection string…<br>[INFO] - Manually provisioning device "iotedgedevice" in hub "iothub.azure-devices.net"<br>[INFO] - Finished provisioning edge device.<br>[INFO] - Initializing the module runtime…<br>[INFO] - Initializing module runtime…<br>[INFO] - Using runtime network id azure-iot-edge<br>[WARN] - Could not initialize module runtime<br>[WARN] - caused by: Container runtime error<br>[WARN] - caused by: error trying to connect: Permission denied (os error 13)<br>[ERR!] - The daemon could not start up successfully: Could not initialize module runtime<br>[ERR!] - caused by: Could not initialize module runtime<br>[ERR!] - caused by: Container runtime error<br>[ERR!] - caused by: error trying to connect: Permission denied (os error 13)

This is the output I got viajournalctl -u iotedge -f on a testinstallation.

For troubleshooting purpose I looked at the https://docs.microsoft.com/en-us/azure/iot-edge/troubleshoot guide. But nothing solved my problem. Then I disabled http and mqtt support as of https://docs.microsoft.com/en-us/azure/iot-edge/production-checklist. Still not starting.

Finally I got it up and running by creating a docker group, adding iotedge to it and changed the group ownership of the /var/run/docker.sock file sudo chown root:docker /var/run/docker.sock

This post is meant to be found via search engines if you (or me again) has the same startup problems.

My context: Ubuntu 20.04 with snap installed docker