Skip to content

Commit

Permalink
NAS-132595 / 25.04 / Handle non-JSON progress messages in TrueCloud B…
Browse files Browse the repository at this point in the history
…ackup (#14974)

* handle non-json progress messages

* address @themylogin
  • Loading branch information
creatorcary authored Nov 19, 2024
1 parent a0ba32d commit d4a000e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/middlewared/middlewared/plugins/cloud_backup/restic.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ async def restic_check_progress(job, proc, track_progress=False):
if read == "":
break

read = json.loads(read)
try:
read = json.loads(read)
except json.JSONDecodeError:
# Can happen with some error messages
job.internal_data["messages"] = job.internal_data["messages"][-4:] + [read]
await job.logs_fd_write((read + "\n").encode("utf-8", "ignore"))
continue

msg_type = read["message_type"]
match msg_type:
case "status":
Expand Down

0 comments on commit d4a000e

Please sign in to comment.