From 9805053086d9fa0fb0cbc265c44ce2305a9d3f0d Mon Sep 17 00:00:00 2001 From: Adele Reed Date: Tue, 19 Oct 2021 15:05:18 -0700 Subject: [PATCH 1/2] Log the failure to scan local files to help debugging --- cmd/zc_traverser_local.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/zc_traverser_local.go b/cmd/zc_traverser_local.go index 543125539..e846f336a 100644 --- a/cmd/zc_traverser_local.go +++ b/cmd/zc_traverser_local.go @@ -29,6 +29,7 @@ import ( "path/filepath" "strings" + "github.com/Azure/azure-pipeline-go/pipeline" "github.com/Azure/azure-storage-azcopy/v10/common" "github.com/Azure/azure-storage-azcopy/v10/common/parallel" ) @@ -305,6 +306,7 @@ func (t *localTraverser) Traverse(preprocessor objectMorpher, processor objectPr singleFileInfo, isSingleFile, err := t.getInfoIfSingleFile() if err != nil { + azcopyScanningLogger.Log(pipeline.LogError, fmt.Sprintf("Failed to scan path %s: %s", t.fullPath, err.Error())) return fmt.Errorf("cannot scan the path %s, please verify that it is a valid", t.fullPath) } From c0d7079d209676c473da8a5863aa7bdb554fa155 Mon Sep 17 00:00:00 2001 From: Mohit Sharma <65536214+mohsha-msft@users.noreply.github.com> Date: Wed, 16 Mar 2022 12:22:31 +0530 Subject: [PATCH 2/2] return error trace as well. --- cmd/zc_traverser_local.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/zc_traverser_local.go b/cmd/zc_traverser_local.go index e846f336a..f7968d8dc 100644 --- a/cmd/zc_traverser_local.go +++ b/cmd/zc_traverser_local.go @@ -307,7 +307,7 @@ func (t *localTraverser) Traverse(preprocessor objectMorpher, processor objectPr if err != nil { azcopyScanningLogger.Log(pipeline.LogError, fmt.Sprintf("Failed to scan path %s: %s", t.fullPath, err.Error())) - return fmt.Errorf("cannot scan the path %s, please verify that it is a valid", t.fullPath) + return fmt.Errorf("failed to scan path %s due to %s", t.fullPath, err.Error()) } // if the path is a single file, then pass it through the filters and send to processor