digitalocean / digitalocean/doctl
"auth init" failed with "Error: mkdir $HOME/.config: file exists"
- Dominant language
- Go
- Stars
- 3.4k
- Forks
- 496
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
**Describe the Issue:**
The command "doctl auth init" failed for me, with the error message "Error: mkdir $HOME/.config: file exists". It might be relevant that my ".config" is a symlink to another directory, not a directory itself. I re-ran the script with sudo, and then it seemed to work OK. If the cure is to always run with "auth init" under sudo, please make the error message more clear than just "file exists". Also, by installing with sudo, the doctl command now requires sudo for every invocation. I'm not sure if that's intended.
> ### # doctl auth init
> Please authenticate doctl for use with your DigitalOcean account [...]
> Enter your access token:
(Entered token)
> Validating token... OK
>
> Error: mkdir /home/wdye/.config: file exists
>
> ### # ls -la .config
> lrwxrwxrwx 1 wdye wdye 12 Oct 4 2019 .config -> .dot/.config`
**Environment:**
- doctl version: 1.52.0-release
- OS: Linux Mint 19 Tara
- Installation method: snap
**Additional Details:**
> ### # doctl auth init --trace
> Please authenticate doctl for use with your DigitalOcean account.
> You can generate a token in the control panel at
> https://cloud.digitalocean.com/account/api/tokens
>
> Enter your access token:
> Validating token...
>
> doctl: 2020/11/10 17:26:25 -> "GET /v2/account HTTP/1.1\r\nHost: api.digitalocean.com\r\n
> User-Agent: doctl/1.52.0-release (linux amd64) godo/1.52.0\r\n
> Accept: application/json\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n"
> OK
> doctl: 2020/11/10 17:26:26 <- "HTTP/2.0 200 OK\r\nCf-Cache-Status: DYNAMIC\r\n
> Cf-Ray: 5f0389d4cb10ec76-DFW\r\nCf-Request-Id: 06561478fb0000ec761fa7a000000001\r\n
> Content-Type: application/json; charset=utf-8\r\nDate: Tue, 10 Nov 2020 23:26:26 GMT\r\n
> Expect-Ct: max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/
> expect-ct\"\r\nRatelimit-Limit: 5000\r\nRatelimit-Remaining: 4995\r\n
> Ratelimit-Reset: 1605050103\r\nServer: cloudflare\r\nSet-Cookie:__cfduid=
[...]
> "email_verified\":true,\"status\":\"active\",\"status_message\":\"\"}}\n"
>
> Error: mkdir /home/wdye/.config: file exists
Contributor guide
Assessment
This issue has not been assessed yet.