Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Cannot install node_exporter behind a proxy #9

Open
peppepetra opened this issue Jan 10, 2023 · 0 comments
Open

Cannot install node_exporter behind a proxy #9

peppepetra opened this issue Jan 10, 2023 · 0 comments

Comments

@peppepetra
Copy link

Describe the bug
When installing the charm in an environment behind a proxy, install fails

To Reproduce
Steps to reproduce the behavior:

  1. Configure proxy in the model config
juju model-config juju-https-proxy="http://myproxy:8000"
  1. Deploy prometheus-node-exporter
juju deploy  prometheus-node-exporter
juju relate nova-compute-kvm prometheus-node-exporter
  1. prometheus-node-exporter units go into error state with message hook failed: "install"

Expected behavior
units go into active state with message node-exporter started

Desktop (please complete the following information):

  • OS and Version: Ubuntu 22.04
  • Charm version 5

Additional context
An hot fix at src/charm.py like the following fixed the issue:

    # line 111 
    proxy = request.ProxyHandler({'https': "http://myproxy:8000"})
    opener = request.build_opener(proxy)
    request.install_opener(opener)
    fname, headers = request.urlretrieve(url, output)

Also no-proxy should be set to the same value from juju model-config juju-no-proxy

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

No branches or pull requests

1 participant