You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When copy file from remote machine via SMB, the Test-Path call will test if the path can be accessed or not.
if (-NOT (Test-Path -Path $remotePath)) {
"Unable to access {0}" -f $remotePath | Trace-Output -Level:Error
}
Test-Path won't throw exception that can be handled by Copy-FileFromRemoteComputer to fallback to WinRM file copy. Logs failed to be copied finally.
Expected behavior
Test-Path to test each subpath, if all path can not be accessed. Throw exception. If any of the path can be accessed don't do that as could be folder level issue instead of machine level issue prevent SMB Copy
Another method might be use any cmdlet that can test SMB access and able to throw exception. For example: Get-Item
Screenshots
If applicable, add screenshots to help explain your problem.
Environment Details (please complete the following information):
Windows Server OS: Server 2019
SdnDiagnostics Version: 2.2202.215.82917
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
@luyaof can you share more details on the actual exception that is being returned? Testing every sub-path on remote location may get resource intensive so it would be interesting to understand the use case that you are encountering.
@luyaof I was able to isolate the root cause of this issue because another background job had purged/deleted the underlying folder structure, resulting in the folder not existing anymore. In either scenario (SMB or WinRM) this would have failed. I updated the logging to indicate that it could not find path to be more clear if we hit it again, however this should be fixed with #113
Describe the bug
When copy file from remote machine via SMB, the Test-Path call will test if the path can be accessed or not.
Test-Path won't throw exception that can be handled by
Copy-FileFromRemoteComputer
to fallback to WinRM file copy. Logs failed to be copied finally.Expected behavior
Test-Path to test each subpath, if all path can not be accessed. Throw exception. If any of the path can be accessed don't do that as could be folder level issue instead of machine level issue prevent SMB Copy
Another method might be use any cmdlet that can test SMB access and able to throw exception. For example:
Get-Item
Screenshots
If applicable, add screenshots to help explain your problem.
Environment Details (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: