From fe1f6ae5fba97cbb5f841ff2e6196bdbf77fb13d Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Mon, 27 Feb 2023 20:05:06 +0530 Subject: [PATCH] Log item information when we are not able to download an item (#2659) This will help us pin point the file which caused issues and can be used to debug the specific file. --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [x] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [x] :broom: Tech Debt/Cleanup #### Issue(s) * # #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/connector/onedrive/collection.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/internal/connector/onedrive/collection.go b/src/internal/connector/onedrive/collection.go index 4caf0b8bc..7555d391a 100644 --- a/src/internal/connector/onedrive/collection.go +++ b/src/internal/connector/onedrive/collection.go @@ -296,10 +296,10 @@ func (oc *Collection) populateItems(ctx context.Context, errs *fault.Bus) { ) ctx = clues.Add(ctx, - "restore_item_id", itemID, - "restore_item_name", itemName, - "restore_item_size", itemSize, - "restore_item_info", itemInfo) + "backup_item_id", itemID, + "backup_item_name", itemName, + "backup_item_size", itemSize, + ) isFile := item.GetFile() != nil @@ -337,6 +337,8 @@ func (oc *Collection) populateItems(ctx context.Context, errs *fault.Bus) { itemInfo.OneDrive.ParentPath = parentPathString } + ctx = clues.Add(ctx, "backup_item_info", itemInfo) + if isFile { dataSuffix := "" if oc.source == OneDriveSource { @@ -370,6 +372,7 @@ func (oc *Collection) populateItems(ctx context.Context, errs *fault.Bus) { // check for errors following retries if err != nil { + logger.Ctx(ctx).With("error", err.Error()).Error("downloading item") el.AddRecoverable(clues.Stack(err).WithClues(ctx).Label(fault.LabelForceNoBackupCreation)) return nil, err }