Docker cannot link to a non running container – fixed with a reboot

I have an ELK stack running on docker on Ubuntu. Occasionally the elasticsearch container will terminate due to a bad query or bad message which is expected behaviour in our development environment.

The issue we have is that after the ES container terminates, it is not possible to restart the Logstash container due to the following error:

  • Default elasticsearch configuration for docker container
  • Docker. How to get bash\ssh inside runned container (run -d)?
  • Issue with docker compose: container command not found
  • How to remove old docker images in continuous integration to save disk space
  • docker container exits immediately even with Console.ReadLine() in a .net core console application
  • Enter into docker container after shell script execution is complete
  • Cannot link to a non running container: /elasticsearch AS /logstash/elasticsearch

    Full list of commands are:

    $ sudo docker stop logstash
    $ sudo docker start elasticsearch
    $ sudo docker start logstash
     Cannot link to a non running container: /elasticsearch AS /logstash/elasticsearch

    I have verified that the ES container does indeed come back up and I can connect to ES via curl but the logstash container will not start.

    The logstash container is configured with the following link:


    Docker version info:

    $ docker version
     Version:      1.11.0
     API version:  1.23
    $docker --version    
    Docker version 1.11.0, build 4dc5990

    Rebooting the entire VM resolves the issues and allows me to correctly restart all the containers and everything is good, until ES terminates again.

    Whilst not the end of the world, I’d really rather avoid having to reboot to resolve this issue.

    Any ideas?

  • Kubernetes node Device port (USB) maping to POD? Or Swarm service --device mapping
  • can't run docker container with simple node app example in bluemix
  • Create a development environment for Laravel in Docker
  • How to register a mesos-slave with docker containerizer option?
  • Install Docker Toolbox on a Mac via command line
  • docker-compose env_file available in script but not directy in run command
  • One Solution collect form web for “Docker cannot link to a non running container – fixed with a reboot”

    It also happens me sometimes, last time was today. You can avoid the reboot by running just

    sudo service docker restart

    (or similar command depending on your OS)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.