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

Catch TimeoutError in retry for snap install #359

Open
carlcsaposs-canonical opened this issue Nov 28, 2023 · 2 comments
Open

Catch TimeoutError in retry for snap install #359

carlcsaposs-canonical opened this issue Nov 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@carlcsaposs-canonical
Copy link
Contributor

https://github.com/canonical/mysql-operator/actions/runs/7020160835/job/19103783474?pr=357#step:14:242

retry=retry_if_exception_type(snap.SnapError),

probably should be fixed on snap lib—the exception we're getting is a socket timeouterror, not an exception from the snap lib

also probably affects router

@carlcsaposs-canonical carlcsaposs-canonical added the bug Something isn't working label Nov 28, 2023
@carlcsaposs-canonical
Copy link
Contributor Author

carlcsaposs-canonical commented Nov 28, 2023

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-mysql-0/charm/./src/charm.py", line 783, in <module>
    main(MySQLOperatorCharm)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/ops/main.py", line 436, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/ops/framework.py", line 340, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/ops/framework.py", line 842, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/ops/framework.py", line 931, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-mysql-0/charm/./src/charm.py", line 180, in _on_install
    if self.install_workload():
  File "/var/lib/juju/agents/unit-mysql-0/charm/./src/charm.py", line 564, in install_workload
    for attempt in Retrying(
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/tenacity/__init__.py", line 347, in __iter__
    do = self.iter(retry_state=retry_state)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/tenacity/__init__.py", line 314, in iter
    return fut.result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/var/lib/juju/agents/unit-mysql-0/charm/./src/charm.py", line 571, in install_workload
    MySQL.install_and_configure_mysql_dependencies()
  File "/var/lib/juju/agents/unit-mysql-0/charm/src/mysql_vm_helpers.py", line 148, in install_and_configure_mysql_dependencies
    charmed_mysql = cache[CHARMED_MYSQL_SNAP_NAME]
  File "/var/lib/juju/agents/unit-mysql-0/charm/lib/charms/operator_libs_linux/v1/snap.py", line 795, in __getitem__
    self._snap_map[snap_name] = self._load_info(snap_name)
  File "/var/lib/juju/agents/unit-mysql-0/charm/lib/charms/operator_libs_linux/v1/snap.py", line 843, in _load_info
    info = self._snap_client.get_snap_information(name)
  File "/var/lib/juju/agents/unit-mysql-0/charm/lib/charms/operator_libs_linux/v1/snap.py", line 751, in get_snap_information
    return self._request("GET", "find", ***"name": name***)[0]
  File "/var/lib/juju/agents/unit-mysql-0/charm/lib/charms/operator_libs_linux/v1/snap.py", line 708, in _request
    response = self._request_raw(method, path, query, headers, data)
  File "/var/lib/juju/agents/unit-mysql-0/charm/lib/charms/operator_libs_linux/v1/snap.py", line 729, in _request_raw
    response = self.opener.open(request, timeout=self.timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/var/lib/juju/agents/unit-mysql-0/charm/lib/charms/operator_libs_linux/v1/snap.py", line 645, in http_open
    return self.do_open(_UnixSocketConnection, req, socket_path=self.socket_path)
  File "/usr/lib/python3.10/urllib/request.py", line 1352, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
    response.begin()
  File "/usr/lib/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.10/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.10/socket.py", line 705, in readinto
    return self._sock.recv_into(b)
TimeoutError: timed out

logs for history

juju-status.txt
juju-debug-log.txt

Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant