Charm enters error state after trying to run status --all
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-ubuntu-advantage |
Triaged
|
Low
|
Unassigned |
Bug Description
Today SQA had a handful of deployments which failed with ubuntu-advantage charm going into an error state during config-changed hooks shortly after install.
Most of these deployments failed on AWS, and the error from the call is below:
2024-03-20 19:34:32 ERROR unit.ubuntu-
Traceback (most recent call last):
File "./src/charm.py", line 210, in <module>
main(
File "/var/lib/
_emit_
File "/var/lib/
event_
File "/var/lib/
framework.
File "/var/lib/
self.
File "/var/lib/
custom_
File "./src/charm.py", line 105, in config_changed
self.
File "./src/charm.py", line 158, in _handle_
status = get_status_output()
File "./src/charm.py", line 55, in get_status_output
output = subprocess.
File "/usr/lib/
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/
raise CalledProcessEr
subprocess.
it doesnt seem that there has been any recent updates to the ubuntu-advantage charm for these tests.
In the following crashdump ubuntu-advantage one was the offending unit, but they all seem to be in error by the time the crashdump is called.
SQA is attaching the ubuntu-advantage key at the time of deployment, and all instances are running Jammy.
an example testrun can be found at:
https:/
with a crashdump for that deployment at:
https:/
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, i...
["2024-