Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-132595 / 24.10.1 / Handle non-JSON progress messages in TrueCloud Backup (by creatorcary) #14984

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading