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

Please add a timeout for requests.get() calls #609

Open
3 tasks done
xavpaice opened this issue Jun 13, 2021 · 0 comments
Open
3 tasks done

Please add a timeout for requests.get() calls #609

xavpaice opened this issue Jun 13, 2021 · 0 comments

Comments

@xavpaice
Copy link

Checklist

  • Confirmed this is an issue with charm-tools, not charmstore-client
  • Provide versions of tools used
  • Described the feature or ways to replicate the issue

What version am I running?

I ran the following command: snap info charm and got the following output:

name:      charm
summary:   charm and charm-tools
publisher: Canonical✓
store-url: https://snapcraft.io/charm
contact:   https://discourse.juju.is/c/charming
license:   unset
description: |
  charmstore-client and charm-tools
commands:
  - charm
snap-id:      2Rryoc2ylScfbFl4eQtpntHD9iuZuMvt
tracking:     latest/stable
refresh-date: 2021-02-02
channels:
  latest/stable:    2.8.2               2021-02-01 (609) 119MB classic
  latest/candidate: 2.8.2               2021-02-01 (609) 119MB classic
  latest/beta:      2.8.2               2021-02-01 (609) 119MB classic
  latest/edge:      2.8.3+git-1-736b1ad 2021-02-23 (620) 119MB classic
installed:          2.8.2                          (609) 119MB classic

I am using: Ubuntu 21.04

Issue/Feature

I expect/expected the following

When network issues prevent access to the charm layer index, I expect to see a timeout and an error message explaining what was wrong.

What I got

If I do not set appropriate environment variables (for proxy):

build: Unable to locate layer:apt. Do you need to set CHARM_LAYERS_DIR?

If I set the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, instead of that message the build (with debug enabled) hangs at:

charmtools.build.fetchers: Checking layer index: https://juju.github.io/layer-index/layers/apt.json

Regardless of the difficulties with network access, it would be good if the build step could add a timeout and more clear exception handling at

result = requests.get(uri)
as that would aid charm developers trying to fix their build environment.

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

No branches or pull requests

1 participant