digitalocean / doctl

The official command line interface for the DigitalOcean API.
https://docs.digitalocean.com/reference/doctl/
Apache License 2.0
3.24k stars 385 forks source link

"auth init" failed with "Error: mkdir $HOME/.config: file exists" #915

Open DarthFudd opened 3 years ago

DarthFudd commented 3 years ago

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:

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

zenhob commented 3 years ago

I am having the same problem. I also have .config symlinked to another directory inside my home dir. This is very perplexing and prevents me from using doctl EDIT it doesn't prevent this, i downloaded the binary directly