Docker cannot link to a non running container - fixed with a reboot
<p>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. </p>

<p>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:</p>

<pre><code>Cannot link to a non running container: /elasticsearch AS /logstash/elasticsearch
</code></pre>

<p>Full list of commands are:</p>

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

<p>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.</p>

<p>The logstash container is configured with the following link:</p>

<pre><code>/elasticsearch:/logstash/elasticsearch
</code></pre>

<p>Docker version info:</p>

<pre><code>$ docker version
Client:
 Version:      1.11.0
 API version:  1.23

$docker --version    
Docker version 1.11.0, build 4dc5990
</code></pre>

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

<p>Whilst not the end of the world, I'd really rather avoid having to reboot to resolve this issue.</p>

<p>Any ideas?</p>