tutorials.IoT-over-MQTT icon indicating copy to clipboard operation
tutorials.IoT-over-MQTT copied to clipboard

Error Mosquitto Docker

Open IgnacioAnguita opened this issue 4 years ago • 1 comments
trafficstars

Hi,

When running the ./services start command I get the following error on the Mosquitto Container. Is able to start the rest of the containers except the mosquitto one. No errors on services create.

$ ./services start Force removal of mqtt-subscriber mqtt-subscriber not running Stopping containers Stopping fiware-orion ... done Stopping db-mongo ... done Removing fiware-orion ... done Removing db-mongo ... done Removing mosquitto ... done Starting five containers Orion, IoT-Agent, Tutorial, Mosquitto MQTT broker and a MongoDB database.

  • Orion is the context broker
  • IoT-Agent is configured for the UltraLight Protocol
  • Tutorial acts as a series of dummy IoT Sensors over MQTT
  • Mosquitto acts as an MQTT Message BrokerCreating mosquitto ... error Creating db-mongo ...ERROR: for mosquitto Cannot start service mosquitto: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"/c/FIWARE/tutorial_mqtt/tutorials.IoT-over-MQTT/mosquitto/mosquitto.conf\" to rootfs \"/mnt/sda1/var/lib/docker/overlay2/20c863e6a6b2804927e8aa036e2be468e8b983227684bfad09e2dc9ab889f25f/merged\" at \"/mnt/sda1/var/lib/docker/overlay2/20c863e6a6b2804927e8aa036e2be468e8b983227684bfad09e2dc9ab889f25f/merged/mosquitto/config/mosquitto.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the spCreating db-mongo ... done Creating fiware-orion ... doneERROR: for mosquitto Cannot start service mosquitto: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"/c/FIWARE/tutorial_mqtt/tutorials.IoT-over-MQTT/mosquitto/mosquitto.conf\" to rootfs \"/mnt/sda1/var/lib/docker/overlay2/20c863e6a6b2804927e8aa036e2be468e8b983227684bfad09e2dc9ab889f25f/merged\" at \"/mnt/sda1/var/lib/docker/overlay2/20c863e6a6b2804927e8aa036e2be468e8b983227684bfad09e2dc9ab889f25f/merged/mosquitto/config/mosquitto.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type Encountered errors while bringing up the project.

IgnacioAnguita avatar May 29 '21 08:05 IgnacioAnguita

This issue is due to mounting a Docker volume using windows. The relevant docker-compose line is here: https://github.com/FIWARE/tutorials.IoT-over-MQTT/blob/master/docker-compose.yml#L148

 volumes:      
      - ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf

If the existing bash script isn't working with your specific O/S, you will need to change this statement to hard-code your volume location c:\FIWARE\tutorial_mqtt/tutorials.IoT-over-MQTT - try looking at How to Create (and Manage) Docker Volumes on Windows for inspiration.

jason-fox avatar Jun 08 '21 07:06 jason-fox