running "kubectl-eks.kubectl" failed: cannot create transient scope: DBus error "org.freedesktop.systemd1.TransactionIsDestructive"

Hi, there

Not sure if this is the right place to ask, I have a systemd service in eks node, which is used to drain node on EC2 shutdown, here’s the systemd unit:

# cat /etc/systemd/system/aws-shutdown.service
[Unit]
Description=AWS Shutdown Service
After=multi-user.target
Before=shutdown.target reboot.target halt.target
Requires=network-online.target network.target

[Service]
KillMode=none
ExecStart=/bin/true
ExecStop=/usr/local/bin/drain-node
RemainAfterExit=yes
Type=oneshot
TimeoutStopSec=300

[Install]
WantedBy=multi-user.target

Content in /usr/local/bin/drain-node:

# cat /usr/local/bin/drain-node
#!/usr/bin/env bash

# Script to drain a node when node is shutting down

set -o errexit
set -o pipefail

/snap/bin/kubectl --kubeconfig /var/lib/kubelet/kubeconfig \
    drain $(/usr/local/share/eks/imds /latest/meta-data/hostname) \
    --ignore-daemonsets \
    --delete-emptydir-data

I got error when shutting down EC2:

internal error, please report: running "kubectl-eks.kubectl" failed: cannot create transient scope: DBus error "org.freedesktop.systemd1.TransactionIsDestructive": [Transaction for snap.kubectl-eks.kubectl-323cec7a-aa56-4e5f-8764-36638bbcb776.scope/start is destructive (systemd-poweroff.service has 'start' job queued, but 'stop' is included in transaction).]

Please help, thanks.