Activity log for bug #2060173

Date Who What changed Old value New value Message
2024-04-04 04:10:21 Wong Hong Han bug added bug
2024-04-04 04:12:15 Wong Hong Han description We have hit the issue where snap socket return more information in the result, causing vault version check break. The function only get information from the last element in the returned information. ``` info = json.loads( snapd.recv(1024 * 1024).decode('utf-8').split('\n')[-1]) ``` However I have hit some different response on the following version: ``` snap 2.61.2 snapd 2.61.2 ``` Where the response become ``` ['HTTP/1.1 200 OK\r', 'Content-Type: application/json\r', 'Date: Thu, 04 Apr 2024 03:38:20 GMT\r', 'Transfer-Encoding: chunked\r', '\r', '946\r', '{"type":"sync","status-code":200,"status":"OK","result":{"id": ... }]}}\r', '0\r', '\r', ''] ``` Noticed there is 3 more elements in the end of the array, resulting the check failed. A better approach is to check if the element has `vault` in it and parse accordingly. ``` original_info = snapd.recv(1024 * 1024).decode('utf-8').split('\n') info = [ele for ele in original_info if "vault" in ele] info = json.loads(info[0]) ``` We have hit the issue where snap socket return more information in the result, causing vault version check break. The function only get information from the last element in the returned information. ``` info = json.loads(     snapd.recv(1024 * 1024).decode('utf-8').split('\n')[-1]) ``` However I have hit some different response on the following version: ``` snap 2.61.2 snapd 2.61.2 ``` Where the response become ``` ['HTTP/1.1 200 OK\r', 'Content-Type: application/json\r', 'Date: Thu, 04 Apr 2024 03:38:20 GMT\r', 'Transfer-Encoding: chunked\r', '\r', '946\r', '{"type":"sync","status-code":200,"status":"OK","result":{"id": ... }]}}\r', '0\r', '\r', ''] ``` Noticed there is 3 more elements in the end of the array, resulting the check failed. A better approach is to check if the element has `vault` in it and parse accordingly. ``` original_response = snapd.recv(1024 * 1024).decode('utf-8').split('\n') result = [ele for ele in original_response if "vault" in ele] info = json.loads(result[0]) ```
2024-04-09 19:51:17 Jadon Naas vault-charm: status New Confirmed
2024-04-10 07:25:39 Nobuto Murata bug added subscriber Nobuto Murata
2024-04-10 07:27:26 DUFOUR Olivier attachment added snapd-api-output-change.txt https://bugs.launchpad.net/vault-charm/+bug/2060173/+attachment/5763205/+files/snapd-api-output-change.txt
2024-04-10 07:46:13 Nobuto Murata bug added subscriber Canonical Field High
2024-04-10 08:25:56 DUFOUR Olivier bug added subscriber DUFOUR Olivier
2024-04-15 11:26:10 Alex Kavanagh vault-charm: status Confirmed Triaged
2024-04-15 11:26:12 Alex Kavanagh vault-charm: importance Undecided High
2024-04-15 11:26:17 Alex Kavanagh vault-charm: importance High Critical
2024-04-15 11:26:48 Alex Kavanagh vault-charm: assignee Jadon Naas (jadonn)
2024-04-15 12:18:51 Alex Kavanagh vault-charm: importance Critical High
2024-05-14 15:36:05 Gaetan Gouzi bug added subscriber Gaetan Gouzi