title: Cannot update snap namespace: cannot create symlink in "/etc/docker": existing file in the way
body: <p>The Docker command is not working after restarting (using <code>sudo reboot</code>) the Ubuntu (20.04) server.</p>
  <p>Now, for any command with docker, it gives me an error. For example,</p>
  <pre><code>$ docker --help
  cannot update snap namespace: cannot create symlink in &quot;/etc/docker&quot;: existing file in the way
  snap-update-ns failed with code 1
  </code></pre>
  <p>When I manually check, there is a file called <code>key.json</code> in the <code>/etc/docker</code> folder which has a json dictionary.</p>
  <p>Before restarting, I have had few docker containers running in the background with volume connected. When I run <code>systemctl start docker</code> as mentioned in one StackOverflow answer, I am getting</p>
  <pre><code>Failed to start docker.service: Unit docker.service not found.
  </code></pre>
  <p>It would be great at least to recover the docker images that were there before restarting.</p>
  <p>-- Edit --</p>
  <p>For some reason, docker is working now. I have restarted once again after the initial restart which resulted in the error. But there was no improvement. However, it is working fine now. I do not know what solved the issue, maybe the cmd <code>journalctl -u docker.service</code> (as suggested in a comment) help in some way, or some other reason.</p>
  <p>So, It would be great if someone can answer what was the initial reason for the trouble? It might help us to avoid this in the future.</p>