Bug #17530
closed[arvados-client] when ARVADOS_API_HOST/TOKEN are not set, error out quickly
Description
arvados-client then tries to connect to an empyt ARVADOS_API_HOST and times out after 30s.
What it should do is error out immediately with an appropriate message.
Updated by Lucas Di Pentima over 3 years ago
- Assigned To set to Lucas Di Pentima
Updated by Lucas Di Pentima over 3 years ago
- Assigned To changed from Lucas Di Pentima to Nico César
Updated by Nico César over 3 years ago
- Status changed from New to In Progress
Is this a current ticket? I compiled arvadsos-client from e46caaf835e32106e2da5aa7f895435bd4718da6
I tried with
unset ARVADOS_API_HOST unset ARVADOS_API_TOKEN ./arvados-client get zzzzz-somej-12345678901234 ARVADOS_API_HOST and/or ARVADOS_API_TOKEN environment variables are not set
and
export ARVADOS_API_TOKEN="" export ARVADOS_API_HOST="" ./arvados-client get zzzzz-somej-12345678901234 ARVADOS_API_HOST and/or ARVADOS_API_TOKEN environment variables are not set
both of them failed fast
Updated by Nico César over 3 years ago
- Assigned To changed from Nico César to Ward Vandewege
- Status changed from In Progress to Feedback
Ward Vandewege, Can you describe how to reproduce this error?
Updated by Ward Vandewege over 3 years ago
Nico César wrote:
Ward Vandewege, Can you describe how to reproduce this error?
Maybe it's specific to certain subcommands, e.g. (from current head):
$ ./arvados-client costanalyzer ce8i5-xvhdp-83iel786l8dkxv4 2021/04/14 15:57:14 error reading "/etc/arvados/ca-certificates.crt": open /etc/arvados/ca-certificates.crt: permission denied 2021/04/14 15:57:26 WARNING: Error retrieving services list: Get "https:///arvados/v1/keep_services/accessible": http: no Host in request URL (retrying in 3s) 2021/04/14 15:57:35 WARNING: Error retrieving services list: Get "https:///arvados/v1/keep_services/accessible": http: no Host in request URL (retrying in 3s) 2021/04/14 15:57:44 WARNING: Error retrieving services list: Get "https:///arvados/v1/keep_services/accessible": http: no Host in request URL (retrying in 3s) 2021/04/14 15:57:53 WARNING: Error retrieving services list: Get "https:///arvados/v1/keep_services/accessible": http: no Host in request URL (retrying in 3s) 2021/04/14 15:58:02 WARNING: Error retrieving services list: Get "https:///arvados/v1/keep_services/accessible": http: no Host in request URL (retrying in 3s) 2021/04/14 15:58:11 WARNING: Error retrieving services list: Get "https:///arvados/v1/keep_services/accessible": http: no Host in request URL (retrying in 3s) error creating Keep object: timed out while getting initial list of keep services
Maybe it only happens when the keep Go sdk is used?
Updated by Nico César over 3 years ago
Commit:841a23635 17530-arvados-client-fastfail
Updated by Nico César over 3 years ago
d6c8a79b073cb000c7914e3ef07bf4d95350ae4f 17530-arvados-client-fastfail-take2
Updated by Ward Vandewege over 3 years ago
Additional fix in e758989ebd80f3365baa56be2079d72e286c9cf5 on branch 17530-arvados-client-fastfail-take2, ready for a look.
Updated by Ward Vandewege over 3 years ago
- Assigned To changed from Ward Vandewege to Nico César
Updated by Tom Clegg over 3 years ago
I think it would be better to make (*arvadosclient.ArvadosClient)Call() fail fast on an empty host. That will cover a lot more cases, and then the extra fail-fast in keepclient.New() will be superfluous.
Also, keep in mind it's not an error to get the discovery doc or keep_services with an empty token. We should only be checking for blank host here. Let the server decide whether "no token" is an error.
Another bit of feedback: "API server is not configured" seems like a misdirection, since it's the client we're talking about, not the server... how about "Arvados client is not configured (target API host is not set). Maybe env var [...]" or something like that?
Updated by Tom Clegg over 3 years ago
Sorry, I think I was unclear. When I said "better to make ... Call()" I meant "...better than the extra fail-fast in keepclient.New()" (see note 9).
We still need the fail-fast in discoverServices().
So in summary, I think we need a total of two changes:- discoverServices() should return an error before adding an entry to svcListCache, starting a poll loop, etc. if host is empty
- CallRaw in arvadosclient should return an error instead of trying http calls if host is empty
Updated by Nico César over 3 years ago
Squashed at 1f1c71924 17530-arvados-client-fastfail-take2
Updated by Tom Clegg over 3 years ago
Other than the commit message being a little confusing (it seems to use future tense to describe the old behavior of CallRaw() which is no longer true)... LGTM, thanks!
Updated by Anonymous over 3 years ago
- % Done changed from 0 to 100
- Status changed from Feedback to Resolved
Applied in changeset arvados|b7c424bbeb586619f1fc65c42f7caa79a19d9ae2.