Skip to content

Conversation

wolfgang-desalvador
Copy link

@wolfgang-desalvador wolfgang-desalvador commented Aug 4, 2025

Description

This Pull Request adds the creation/existence check flow when creating a symlink in a Blob to local scenario. This

Related Links:

Type of Change

  • Bug fix
  • New feature
  • Documentation update required
  • Code quality improvement
  • Other (describe):

How Has This Been Tested?

This has been tested reproducing the same flow described in the issue and confirming job didn't present failed entries

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where AzCopy fails to create symlinks from blob to local storage when parent directories don't exist, particularly when using wildcards in URLs. The fix ensures parent directories are created before attempting to create the symlink.

  • Adds parent directory creation check before symlink creation
  • Uses existing CreateParentDirectoryIfNotExist function with folder creation tracking
  • Includes proper error handling and reporting for directory creation failures

err = common.CreateParentDirectoryIfNotExist(jptm.Info().Destination, jptm.GetFolderCreationTracker())

if err != nil {
jptm.FailActiveSend("creating destination folder for symlink", err)
Copy link
Preview

Copilot AI Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable err is being reused without checking if it was previously set. Consider using a new variable name like dirErr to avoid potential confusion and make the error handling more explicit.

Suggested change
jptm.FailActiveSend("creating destination folder for symlink", err)
dirErr := common.CreateParentDirectoryIfNotExist(jptm.Info().Destination, jptm.GetFolderCreationTracker())
if dirErr != nil {
jptm.FailActiveSend("creating destination folder for symlink", dirErr)

Copilot uses AI. Check for mistakes.

@gapra-msft
Copy link
Member

@wolfgang-desalvador could you please add a test in e2etest with your use case?

@gapra-msft gapra-msft marked this pull request as draft August 14, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants