Unit docker-nnn.scope already exists.

Sometimes when starting a stopped docker container on CoreOS, an error is thrown:

Error response from daemon: Cannot start container sane: [8] System error: Unit docker-166be344aa25c9c1abc17daa2a14bb3d02cf10adc88e3ec795480a60c11a8e78.scope already exists.

It is usually caused by ‘.scope’ files that are not cleaned up by ‘systemd’. To fix the problem run this command, replacing the scope filename with yours:

sudo systemctl stop docker-166be344aa25c9c1abc17daa2a14bb3d02cf10adc88e3ec795480a60c11a8e78.scope