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

[UX][GitHub] azcopy cp fails if the destination path is at the root of the file system (i.e. /) #2588

Merged
merged 10 commits into from
Mar 13, 2024

Conversation

siminsavani-msft
Copy link
Contributor

@siminsavani-msft siminsavani-msft commented Feb 22, 2024

While AzCopy is acting as expected (does not transfer to root directory, i.e: "/"), AzCopy crashes with an out of bounds error at line 59 in writeThoughFile.go, especially in Linux.

When AzCopy gets lastIndex by strings.LastIndex(destinationPath, DeterminePathSeparator(destinationPath)), the LastIndex() method will either return a valid index or -1 if last index is not found in the string. In cases that lastIndex is not found (in other words, lastIndex is equal to -1), we should handle this gracefully by a clear error message instead of letting AzCopy crash as seen in this GitHub issue: #2036.

When this occurs, the error message is reported in the log and the console output shows that transfer has failed: Final Job Status: Failed.

FYI: the workaround is to download the file under a valid directory (i.e. "/tmp", "/home", etc.) and then users can move the downloaded file where they desire as we don't plan on supporting root directories.

Resolves #2036

@pranavmalik-msft
Copy link
Contributor

Please sync with main before merging, else looks good to me

@siminsavani-msft siminsavani-msft added this to the 10.24 milestone Mar 13, 2024
@siminsavani-msft siminsavani-msft merged commit 80e292a into main Mar 13, 2024
17 checks passed
@siminsavani-msft siminsavani-msft deleted the siminsavani/usability-error-fix branch March 13, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azcopy cp fails if the destination path is at the root of the file system (i.e. /)
5 participants