diff --git a/src/internal/kopia/wrapper.go b/src/internal/kopia/wrapper.go index fc363d3a2..45203a9ca 100644 --- a/src/internal/kopia/wrapper.go +++ b/src/internal/kopia/wrapper.go @@ -333,11 +333,10 @@ func getItemStream( e, err := snapshotfs.GetNestedEntry( ctx, snapshotRoot, - encodeElements(itemPath.PopFront().Elements()...), - ) + encodeElements(itemPath.PopFront().Elements()...)) if err != nil { if isErrEntryNotFound(err) { - err = clues.Stack(data.ErrNotFound, err).WithClues(ctx) + err = clues.Stack(data.ErrNotFound, err) } return nil, clues.Wrap(err, "getting nested object handle").WithClues(ctx) @@ -413,7 +412,9 @@ func (w Wrapper) RestoreMultipleItems( return nil, el.Failure() } - ds, err := getItemStream(ctx, itemPath, snapshotRoot, bcounter) + ictx := clues.Add(ctx, "item_path", itemPath.String) + + ds, err := getItemStream(ictx, itemPath, snapshotRoot, bcounter) if err != nil { el.AddRecoverable(clues.Stack(err).Label(fault.LabelForceNoBackupCreation)) continue @@ -422,7 +423,7 @@ func (w Wrapper) RestoreMultipleItems( parentPath, err := itemPath.Dir() if err != nil { el.AddRecoverable(clues.Wrap(err, "making directory collection"). - WithClues(ctx). + WithClues(ictx). Label(fault.LabelForceNoBackupCreation)) continue diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 2b885ccf2..f0d4d0f4f 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -525,7 +525,7 @@ func mergeDetails( mctx = clues.Add(mctx, "manifest_backup_id", bID) _, baseDeets, err := getBackupAndDetailsFromID( - ctx, + mctx, model.StableID(bID), ms, detailsStore, diff --git a/src/internal/operations/manifests.go b/src/internal/operations/manifests.go index 36824840f..14d009024 100644 --- a/src/internal/operations/manifests.go +++ b/src/internal/operations/manifests.go @@ -97,7 +97,7 @@ func produceManifestsAndMetadata( // if no backup exists for any of the complete manifests, we want // to fall back to a complete backup. if errors.Is(err, data.ErrNotFound) { - logger.Ctx(ctx).Infow("backup missing, falling back to full backup", clues.In(mctx).Slice()...) + logger.Ctx(mctx).Infow("backup missing, falling back to full backup", clues.In(mctx).Slice()...) return ms, nil, false, nil } diff --git a/src/internal/operations/restore.go b/src/internal/operations/restore.go index 45c7a7300..3593176a7 100644 --- a/src/internal/operations/restore.go +++ b/src/internal/operations/restore.go @@ -196,7 +196,8 @@ func (op *RestoreOperation) do( ctx = clues.Add( ctx, "resource_owner", bup.Selector.DiscreteOwner, - "details_paths", len(paths)) + "details_paths", len(paths), + "backup_snapshot_id", bup.SnapshotID) op.bus.Event( ctx, diff --git a/src/internal/streamstore/streamstore.go b/src/internal/streamstore/streamstore.go index 5de33998c..a9dab4810 100644 --- a/src/internal/streamstore/streamstore.go +++ b/src/internal/streamstore/streamstore.go @@ -284,6 +284,8 @@ func read( return clues.Stack(err).WithClues(ctx) } + ctx = clues.Add(ctx, "snapshot_id", snapshotID) + cs, err := rer.RestoreMultipleItems( ctx, snapshotID,