Each user has environment variables.
XDG_RUNTIME_DIR is most likely not defined in root user's environment or is being overwritten as empty.
To fix it in your current shell (temporarily), login as root and type
To fix it every time root logs in you can define it in
Just add the line
export XDG_RUNTIME_DIR="/run/user/1000" at the bottom of the file. Then either
source ~/.profile or logout & login again.
You can verify which environment variables are defined in the current shell, type
env, or a specific one with
env | grep XDG_RUNTIME_DIR