This charm is mostly a wrapper around the Ubuntu Pro client. The error you got suggests something in the client, so we should be looking at /var/log/ubuntu-advantage.log
Looking at the crashdump you sent, this file shows the following error for multiple machines:
["2024-03-20T21:57:23.912", "DEBUG", "ubuntupro.system", "ensure_file_absent", 576, "Removed file: /var/lib/ubuntu-advantage/lock", {}]
["2024-03-20T21:57:23.912", "ERROR", "ubuntupro.cli", "wrapper", 1768, "Unhandled exception, please file a bug", {"exc_info": "Traceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/uaclient/cli/__init__.py\", line 1705, in wrapper\n return func(*args, **kwargs)\n File \"/usr/lib/python3/dist-packages/uaclient/cli/__init__.py\", line 1838, in main\n return_value = args.action(args, cfg=cfg, extra_args=extra_args)\n File \"/usr/lib/python3/dist-packages/uaclient/cli/__init__.py\", line 257, in new_f\n return f(args, cfg=cfg, **kwargs)\n File \"/usr/lib/python3/dist-packages/uaclient/cli/__init__.py\", line 202, in new_f\n return f(*args, **kwargs)\n File \"/usr/lib/python3/dist-packages/uaclient/cli/__init__.py\", line 186, in new_f\n retval = f(*args, cfg=cfg, **kwargs)\n File \"/usr/lib/python3/dist-packages/uaclient/cli/__init__.py\", line 1305, in action_attach\n actions.attach_with_token(cfg, token=token, allow_enable=allow_enable)\n File \"/usr/lib/python3/dist-packages/uaclient/actions.py\", line 65, in attach_with_token\n new_machine_token = contract_client.add_contract_machine(\n File \"/usr/lib/python3/dist-packages/uaclient/util.py\", line 92, in decorator\n return f(*args, **kwargs)\n File \"/usr/lib/python3/dist-packages/uaclient/contract.py\", line 96, in add_contract_machine\n response = self.request_url(\n File \"/usr/lib/python3/dist-packages/uaclient/http/serviceclient.py\", line 68, in request_url\n return http.readurl(\n File \"/usr/lib/python3/dist-packages/uaclient/http/__init__.py\", line 364, in readurl\n resp = _readurl_urllib(req, timeout=timeout)\n File \"/usr/lib/python3/dist-packages/uaclient/http/__init__.py\", line 167, in _readurl_urllib\n resp = request.urlopen(req, timeout=timeout)\n File \"/usr/lib/python3.10/urllib/request.py\", line 216, in urlopen\n return opener.open(url, data, timeout)\n File \"/usr/lib/python3.10/urllib/request.py\", line 519, in open\n response = self._open(req, data)\n File \"/usr/lib/python3.10/urllib/request.py\", line 536, in _open\n result = self._call_chain(self.handle_open, protocol, protocol +\n File \"/usr/lib/python3.10/urllib/request.py\", line 496, in _call_chain\n result = func(*args)\n File \"/usr/lib/python3.10/urllib/request.py\", line 1391, in https_open\n return self.do_open(http.client.HTTPSConnection, req,\n File \"/usr/lib/python3.10/urllib/request.py\", line 1352, in do_open\n r = h.getresponse()\n File \"/usr/lib/python3.10/http/client.py\", line 1375, in getresponse\n response.begin()\n File \"/usr/lib/python3.10/http/client.py\", line 318, in begin\n version, status, reason = self._read_status()\n File \"/usr/lib/python3.10/http/client.py\", line 287, in _read_status\n raise RemoteDisconnected(\"Remote end closed connection without\"\nhttp.client.RemoteDisconnected: Remote end closed connection without response"}]
Around that time yesterday, there was a big outage affecting the K8s cluster on which the Ubuntu Pro backend is deployed. So this would cause the service to be unreachable by these tests machines. But the Pro client should graciously handle it.
Once the client gracefully handles outages, I believe there might be some things we can do in this charm to better communicate the situation. So I will leave this issue open for when we can fix this.
Hi Alexander,
This charm is mostly a wrapper around the Ubuntu Pro client. The error you got suggests something in the client, so we should be looking at /var/log/ ubuntu- advantage. log
Looking at the crashdump you sent, this file shows the following error for multiple machines:
["2024- 03-20T21: 57:23.912" , "DEBUG", "ubuntupro.system", "ensure_ file_absent" , 576, "Removed file: /var/lib/ ubuntu- advantage/ lock", {}] 03-20T21: 57:23.912" , "ERROR", "ubuntupro.cli", "wrapper", 1768, "Unhandled exception, please file a bug", {"exc_info": "Traceback (most recent call last):\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ cli/__init_ _.py\", line 1705, in wrapper\n return func(*args, **kwargs)\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ cli/__init_ _.py\", line 1838, in main\n return_value = args.action(args, cfg=cfg, extra_args= extra_args) \n File \"/usr/ lib/python3/ dist-packages/ uaclient/ cli/__init_ _.py\", line 257, in new_f\n return f(args, cfg=cfg, **kwargs)\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ cli/__init_ _.py\", line 202, in new_f\n return f(*args, **kwargs)\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ cli/__init_ _.py\", line 186, in new_f\n retval = f(*args, cfg=cfg, **kwargs)\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ cli/__init_ _.py\", line 1305, in action_attach\n actions. attach_ with_token( cfg, token=token, allow_enable= allow_enable) \n File \"/usr/ lib/python3/ dist-packages/ uaclient/ actions. py\", line 65, in attach_with_token\n new_machine_token = contract_ client. add_contract_ machine( \n File \"/usr/ lib/python3/ dist-packages/ uaclient/ util.py\ ", line 92, in decorator\n return f(*args, **kwargs)\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ contract. py\", line 96, in add_contract_ machine\ n response = self.request_url(\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ http/servicecli ent.py\ ", line 68, in request_url\n return http.readurl(\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ http/__ init__. py\", line 364, in readurl\n resp = _readurl_ urllib( req, timeout=timeout)\n File \"/usr/ lib/python3/ dist-packages/ uaclient/ http/__ init__. py\", line 167, in _readurl_urllib\n resp = request. urlopen( req, timeout=timeout)\n File \"/usr/ lib/python3. 10/urllib/ request. py\", line 216, in urlopen\n return opener.open(url, data, timeout)\n File \"/usr/ lib/python3. 10/urllib/ request. py\", line 519, in open\n response = self._open(req, data)\n File \"/usr/ lib/python3. 10/urllib/ request. py\", line 536, in _open\n result = self._call_ chain(self. handle_ open, protocol, protocol +\n File \"/usr/ lib/python3. 10/urllib/ request. py\", line 496, in _call_chain\n result = func(*args)\n File \"/usr/ lib/python3. 10/urllib/ request. py\", line 1391, in https_open\n return self.do_ open(http. client. HTTPSConnection , req,\n File \"/usr/ lib/python3. 10/urllib/ request. py\", line 1352, in do_open\n r = h.getresponse()\n File \"/usr/ lib/python3. 10/http/ client. py\", line 1375, in getresponse\n response.begin()\n File \"/usr/ lib/python3. 10/http/ client. py\", line 318, in begin\n version, status, reason = self._read_ status( )\n File \"/usr/ lib/python3. 10/http/ client. py\", line 287, in _read_status\n raise RemoteDisconnec ted(\"Remote end closed connection without\ "\nhttp. client. RemoteDisconnec ted: Remote end closed connection without response"}]
["2024-
Around that time yesterday, there was a big outage affecting the K8s cluster on which the Ubuntu Pro backend is deployed. So this would cause the service to be unreachable by these tests machines. But the Pro client should graciously handle it.
So this looks like a client bug. Can you please file it at https:/ /github. com/canonical/ ubuntu- pro-client/ issues?
Once the client gracefully handles outages, I believe there might be some things we can do in this charm to better communicate the situation. So I will leave this issue open for when we can fix this.
Thank you,
Allan