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

charm having latest code, ignoring revision #260

Open
honghan-wong opened this issue Jun 6, 2024 · 1 comment
Open

charm having latest code, ignoring revision #260

honghan-wong opened this issue Jun 6, 2024 · 1 comment

Comments

@honghan-wong
Copy link
Contributor

in one of the cloud, the hardware observer is refreshed to rev 59.
when charm is performing the install hooks, it got stuck in some error.

one weird symptom is the code is not respecting the proxy setting, we can curl to github fine on curl and in python on the same node.
juju model-config's apt-http(s)-proxy, juju-http(s)-proxy and snap-http(s)-proxy are all set with the working proxy.
however the requests function in the code is using the proxy to download.
after we manually add the following code and run juju resolve hardware-observer/0, the install hook got unblocked.

        proxies = {
          "http": "http://<redact>:8000",
          "https": "http://<redact>:8000",
        }

        resp = requests.get(self._release, timeout=60, proxies=proxies)

Error:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/./src/charm.py", line 300, in <module>
    ops.main(HardwareObserverCharm)  # type: ignore
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/ops/main.py", line 555, in __call__
    return main(charm_class, use_juju_for_storage=use_juju_for_storage)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/ops/main.py", line 544, in main
    manager.run()
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/ops/main.py", line 520, in run
    self._emit()
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/ops/main.py", line 509, in _emit
    _emit_charm_event(self.charm, self.dispatcher.event_name)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/ops/main.py", line 143, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/ops/framework.py", line 350, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/ops/framework.py", line 849, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/ops/framework.py", line 939, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/./src/charm.py", line 156, in _on_install_or_upgrade
    exporter_install_ok = exporter.install()
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/src/service.py", line 166, in install
    install_resource_success = self.install_resources()
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/src/service.py", line 300, in install_resources
    self.strategy.install()
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/src/hw_tools.py", line 409, in install
    resp = requests.get(self._release, timeout=60)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/var/lib/juju/agents/unit-hardware-observer-0/charm/venv/requests/adapters.py", line 610, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /prometheus-community/smartctl_exporter/releases/download/v0.12.0/smartctl_exporter-0.12.0.linux-amd64.tar.gz (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f2be7562b60>, 'Connection to github.com timed out. (connect timeout=60)'))

While we worked around on the above code, we found out the hardware observer is on rev 59 latest/stable revision.
hardware-observer error 3 hardware-observer latest/stable 59 no hook failed: "upgrade-charm"

however the piece of code is just merged into main branch, #242
we are not sure why the charm is using latest code instead of rev 59 code.

@aieri
Copy link

aieri commented Nov 7, 2024

it looks like we only use requests to interact with redfish; I'll discuss in the coming weeks with Paul if the redfish is even providing value - if we were to deprecate it we could close this bug without any further action.

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

2 participants