check_vault_health fails to fetch snap version
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vault-charm |
New
|
Undecided
|
Unassigned |
Bug Description
This is happening on a jammy yoga cloud running:
charm-vault 1.8/stable
root@vault-1:~# snap info snapd | grep installed:
installed: 2.63 (21759) 40MB snapd
when run check_vault_
root@vault-1:~# /usr/lib/
CRITICAL: failed to fetch version of installed vault snap: Expecting value: line 1 column 1 (char 0)
This is because it fails to load the result when querying snapd socket [0]
snapd.recv returrns
['HTTP/1.1 200 OK\r',
'Content-Type: application/
'Date: Mon, 01 Jul 2024 11:29:26 GMT\r',
'Transfer-
'\r',
'8f4\r',
'{"type"
'0\r',
'\r',
'']
and the check takes [-1] which is ''
0. https:/
I can workaround changing
`snapd.recv(1024 * 1024).decode( 'utf-8' ).split( '\n')[- 1])`
with
`snapd.recv(1024 * 1024).decode( 'utf-8' ).split( '\n')[- 4])`