When trying to stop or restart a docker container I'm getting the following error message:

```
$ docker restart 5ba0a86f36ea
Error response from daemon: Cannot restart container 5ba0a86f36ea: [2] Container does not exist: container destroyed
Error: failed to restart containers: [5ba0a86f36ea]

```

But when I run

```
$ docker logs -f 5ba0a86f36ea

```

I can see the logs, so obviously the container does exist. Any ideas?

**Edit:**

sorry, I forgot to mention this:

When I run `docker ps -a` I see the container as up and running. However the application inside it is malfunctioning so I want to restart it, or just get a fresh version of that application online. But when I can't stop and remove the container, I also can't get a new application up and running, which would be listening to the same port.