doctl
doctl copied to clipboard
Error: neither $XDG_CONFIG_HOME nor $HOME are defined
Describe the Issue:
Attempt to run doctl and all it will do is return:
Error: neither $XDG_CONFIG_HOME nor $HOME are defined
Environment:
doctl version Error: neither $XDG_CONFIG_HOME nor $HOME are defined (v1.48.0 installed as latest/stable according to 'snap info doctl')
- OS: openSUSE 15.2
- Installation method: Snap package
Additional Details:
$XDG_CONFIG_HOME returns null $HOME returns my home directory My default shell is zsh. Running doctl in bash yields the same result. I use other snap apps regularly, with Spotify seeing daily use.
Thanks for the report. To help get to the bottom of this, can you provide some additional details? First, what is the output of:
snap connections doctl
Next, run the following to get a shell inside of the snap environment:
snap run --shell doctl
Then report back the output of:
env | grep 'HOME\|XDG\|SNAP'
snap connections doctl
| Interface | Plug | Slot | Notes |
|---|---|---|---|
| home | doctl:home | :home | - |
| network | doctl:network | :network | - |
| personal-files | doctl:doctl-config | :personal-files | - |
| personal-files | doctl:dot-docker | - | - |
| personal-files | doctl:kube-config | - | - |
| ssh-keys | doctl:ssh-keys | - | - |
snap run --shell doctl I have no name!@hundred-pacer:/home/link> env | grep 'HOME|XDG|SNAP' SNAP_REVISION=362 XDG_CONFIG_DIRS=/etc/xdg XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1 SNAP_REAL_HOME=/home/link SNAP_USER_COMMON=/home/link/snap/doctl/common JAVA_HOME=/usr/lib64/jvm/jre-11-openjdk JRE_HOME=/usr/lib64/jvm/java-11-openjdk-11 SNAP_INSTANCE_KEY= XDG_SEAT=seat0 XDG_SESSION_DESKTOP=KDE XDG_SESSION_TYPE=x11 SNAP_CONTEXT=wKF7c2JV606KV90gxKkLlbknDfFsv7w6KRptD6b1m0T9 HOME=/home/link/snap/doctl/362 XDG_CURRENT_DESKTOP=KDE PROFILEHOME= SNAP_ARCH=amd64 SNAP_INSTANCE_NAME=doctl SNAP_USER_DATA=/home/link/snap/doctl/362 XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 SNAP_REEXEC= XDG_SESSION_CLASS=user SNAP=/snap/doctl/362 SNAP_COMMON=/var/snap/doctl/common SNAP_VERSION=v1.48.0 SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void SNAP_COOKIE=wKF7c2JV606KV90gxKkLlbknDfFsv7w6KRptD6b1m0T9 XDG_VTNR=7 XDG_SESSION_ID=2 SNAP_DATA=/var/snap/doctl/362 XDG_RUNTIME_DIR=/run/user/5001/snap.doctl SNAP_NAME=doctl XDG_DATA_DIRS=/home/link/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
I am facing the exact same problem here, expect I am running on Ubuntu 18.04 Output of the three commands look the same like linkp's. A fix would be highly appreciated. Thank you =)
Hi, same problem here.
Environment:
- Installed with snap:
sudo snap install doctl - OS: Ubuntu 20.04.1 LTS
Outputs:
snap connections doctl
| Interface | Plug | Slot | Notes |
|---|---|---|---|
| home | doctl:home | :home | - |
| network | doctl:network | :network | - |
| personal-files | doctl:doctl-config | :personal-files | - |
| personal-files | doctl:dot-docker | - | - |
| personal-files | doctl:kube-config | - | - |
| ssh-keys | doctl:ssh-keys | - | - |
$ snap run --shell doctl
$ env | grep 'HOME\|XDG\|SNAP'
SNAP_REVISION=366
SNAP_REAL_HOME=/home/felipe
SNAP_USER_COMMON=/home/felipe/snap/doctl/common
SNAP_INSTANCE_KEY=
XDG_SESSION_TYPE=tty
SNAP_CONTEXT=GwDgPhhbzdstT0BNrPD-aN9An2u2Sg0_4vtAUP1EPwfTx8sjKwiH
HOME=/home/felipe/snap/doctl/366
SNAP_ARCH=amd64
SNAP_INSTANCE_NAME=doctl
SNAP_USER_DATA=/home/felipe/snap/doctl/366
SNAP_REEXEC=
XDG_SESSION_CLASS=user
SNAP=/snap/doctl/366
SNAP_COMMON=/var/snap/doctl/common
SNAP_VERSION=v1.48.1
SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void
SNAP_COOKIE=GwDgPhhbzdstT0BNrPD-aN9An2u2Sg0_4vtAUP1EPwfTx8sjKwiH
XDG_SESSION_ID=424
SNAP_DATA=/var/snap/doctl/366
XDG_RUNTIME_DIR=/run/user/985400001/snap.doctl
SNAP_NAME=doctl
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
Hi, I have the same issue. Have you found any solution for this?
Same issue here. On Ubuntu 18.04.5.
Worked around it by following the instructions to download and install from Github instead :shrug: it's a single binary file so not a big hassle.
Hi there, another workaround is using the official docker-image provided by the DO-team: https://hub.docker.com/r/digitalocean/doctl
Installing Docker to run a single 24.5 MB binary seems like overkill along the lines using an atom bomb to swat a gnat. Downloading the gzipped tar with the binary makes more sense, but loses the benefit of automatic updates provided by a snap install. I suppose if I had the time, the "right way" (FSVO right way) to fix this would be to clone this to my own GitHub repo, and figure out how to integrate it into SUSE's OpenBuild Service to build RPM and DEB packages and just make my own personal apt & zypper repos. (That sounds like an awful lot of work for a tool that I have never even used due to this open issue.)
Fair point, an already installed local container runtime environment is helpful in this case. However, since "doctl" is a tool from a cloud service provider, an already installed container runtime environment seemed very likely to me. On top of that, the current container image is just about 18MB in size. With a simple alias, it is possible to achieve a comparable user experience in this way with a very reasonable amount of time. For these reasons, I think the atomic bomb comparison is a bit exaggerated. Best regards, bdb
I've seen a similar thing. It works just fine when I run my bash script directly (as a user, or as root). But when triggered by systemctl it is failing.
My solution to it was:
# When running the script from the systemd service, it weirdly doesn't allocate a $HOME variable, which the doctl tool requires.
# Assuming we running as root, but really dont need to (but what other default account should we set the service to use?)
[[ -z "$HOME" ]] && export HOME=/root
adding that at the top of my script fixed the problem and it was able to work fine after that.
(I should also mention, it was running fine as a systemctl service on my original server, but only had this problem on a new replacement server... so assuming something else might be missing on the new server but haven't been able to identify it... everything else working just fine so far, just this oddity)
Your issue is completely different. This report concerns the Snap app failing to run when called interactively from the shell. I have no idea if this problem still exists since I gave up on doctl three years ago when I submitted this report.