Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Suppress error output when GitHub version check fails #874

Open
rgee0 opened this issue Mar 14, 2021 · 8 comments · May be fixed by #934
Open

[Suggestion] Suppress error output when GitHub version check fails #874

rgee0 opened this issue Mar 14, 2021 · 8 comments · May be fixed by #934

Comments

@rgee0
Copy link
Contributor

rgee0 commented Mar 14, 2021

Expected Behaviour

The faas-cli failing to check whether it is the latest version does not affect the operation of the downloaded binary. If an error is encountered encourage the user to check manually, rather than distracting them with a verbose error message.

Current Behaviour

$ faas version
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  2cec97955a254358de5443987bedf8ceee272cf8
 version: 0.13.9
Unable to find latest version online error: Head "https://github.com/openfaas/faas-cli/releases/latest": dial tcp 127.0.0.1:443: connect: connection refused

This is a forced error, so somewhat contrived, however a screenshot from a user is shown below:
image

Possible Solution

Suppress the error emitted here, or add additional detail to explain that the user can check by browsing to https://github.com/openfaas/faas-cli/releases/latest

return fmt.Errorf("unable to find latest version online error: %s", err.Error())

Context

Supporting a new user on Slack who on seeing the error thought they had encountered an error, effectively on step 1. By providing a more human message this false barrier to entry is removed.

Your Environment

  • FaaS-CLI version ( Full output from: faas-cli version ):
faas version
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  2cec97955a254358de5443987bedf8ceee272cf8
 version: 0.13.9
  • Docker version ( Full output from: docker version ):
    n/a
  • Are you using Docker Swarm (FaaS-swarm ) or Kubernetes (FaaS-netes)?
    n/a
  • Operating System and version (e.g. Linux, Windows, MacOS):
    MacOS
  • Link to your project or a code example to reproduce issue:
    n/a
@alexellis
Copy link
Member

This looks like the error was generated from an incorrectly configured HTTP PROXY? Given the URL is reported as 127.0.0.1?

Should we keep this around and see if anyone else is affected? If you want to silently fail the error, I'm OK with that too, and perhaps set a shorter timeout at the same time.

@superherointj
Copy link

superherointj commented Sep 21, 2022

I'm a nixpkgs maintainer, and I'm struggling to avoid triggering this network error when looking up version of faas-cli package for automated version test. Builds in Nix are only done offline. And the error is causing the version test to fail.

$ faas-cli version --short-version

Unable to find latest version online error: Head "https://github.com/openfaas/faas-cli/releases/latest": dial tcp: lookup github.com on [::1]:53: read udp [::1]:38672->[::1]:53: read: connection refused

If there is a solution to this, I'd like to know. (So I can properly fix the package.)

Thank you.

@alexellis
Copy link
Member

Hi @superherointj would a flag like --quiet work for you?

cc @welteki (who also maintains Nix packages AFAIK)

Alex

@superherointj
Copy link

Thanks for the prompt answer.

Would --quiet print the version still? I need to get the version as output for check.
If it is not too much trouble, can the flag to also opt out of network communication?

@welteki
Copy link
Member

welteki commented Sep 22, 2022

There is already a flag to skip the check.

faas-cli version --short-version --warn-update=false

When this is used there should not be any network communication.

@superherointj
Copy link

There is already a flag to skip the check.

faas-cli version --short-version --warn-update=false

When this is used there should not be any network communication.

I see. Thanks.

@alexellis
Copy link
Member

@rgee0 can we close the issue?

@rgee0
Copy link
Contributor Author

rgee0 commented Sep 22, 2022

Up to you.
I think the original sentiment is still valid - the user is misdirected towards an error situation through what is essentially an informational failure.
A silent failure in this situation would be more user friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants