[pve-devel] Unit 240.scope already exists.

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Sep 12 10:19:41 CEST 2018

On Wed, Sep 12, 2018 at 08:29:02AM +0200, Stefan Priebe - Profihost AG wrote:
> Hello,
> i don't know whether this is a known bug but since Proxmox V5 i have
> seen the following error message several times while trying to start a
> vm after shutdown:
> ERROR: start failed:
> org.freedesktop.systemd1.UnitExists: Unit 240.scope already exists

We've seen this happen. I'm inclined to consider it a systemd issue
since we perform a `systemctl stop` on the scope at startup. And
particularly when the qemu process is already gone it's weird that this
command returns before the scope is actually gone.
To me this looks like a timing issue. (And the systemctl command line
tool also doesn't give us a lot of choices regarding synchronization,
eg. I wish there was a 'systemctl wait' to wait for a job to finish...).

Since the explicit unconditional `systemctl stop` doesn't seem to be
doing the trick we may just have to talk to systemd more via dbus at
We already use dbus to create the scope in the first place, but waiting
for jobs we don't know exist anymore after trying to make sure they
actually don't hasn't felt too appealing to us...

> I had a similiar problem under our ubuntu 18.04 workstations where the
> only solution was to tun:
> rm -fv /run/systemd/transient/$name.scope
> systemctl daemon-reload

When it's not a timing issue, a `systemctl stop $name.scope` should work
as well. If it doesn't, I'd very much like to know why (and why
systemctl doesn't tell you about it...).

More information about the pve-devel mailing list