Docker Devstack can't connect to MySQL

Problem

When trying to start Devstack via "make dev.up" or during "make dev.provision" not all containers will start, or various applications will log errors like "Can't connect to MySQL server on 'edx.devstack.mysql' (111)".

Solution

These problems can be caused by several issues, here are some solutions to try from most to least common:
  1. Check that Docker has enough internally allowed disk space (this is not necessarily related to available disk space on your host computer). Try following the steps outlined here: https://github.com/edx/devstack#no-space-left-on-device to free up space. You may also wish to look at increasing the amount of space Docker allows to be used.

  2. Make sure that you have up-to-date versions of Docker and Docker Compose.

  3. If you are using a VPN try turning it off. Some VPN configurations are known to cause routing issues for the containers. If this fixes the issue for you, you might be able to change the subnet Docker uses to allow Devstack to run while your VPN is active.