-
Notifications
You must be signed in to change notification settings - Fork 27
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
Unclear error message when unzipping paths > 260 characters #78
Comments
Seems like you would want to emit to stderr @tyler-ball. Wouldn't the run fail anyway if the file fails to extract? |
Except that it can fail the first |
Another thought would be changing:
to
Here we always call Does that make sense? |
For this issue, a workaround has been used to enable long paths in certain versions of Windows. However, that will not work for 2012/2012R2, and also will break some 32-bit apps. I suggest that we try to reduce the lengths of the paths we are using rather than trying to fix it here (or in addition to some fixes here that make it clear that the path length is exceeded) -- the base path of the files being extracted is pretty long and the filename is too, and when added to long paths within a cookbook we are pushed over the limit. I am sure we can find ways to make the directory and filename Test Kitchen is extracting, a lot shorter. |
Description
By default Windows does not support paths > 260 characters. When trying to converge a cookbook that contains an embedded DSC resource, using policyfiles for dependency management, and testing using Test Kitchen an error occurs:
This exception is being thrown by the
extract_files.ps1
script. This COM call is hidden beneath layers of try/catch blocks and is hiding the actual error. After troubleshooting we found the underlying error:That path is longer than 260 characters and cannot be unzipped in standard Windows.
Environment
Test Kitchen target: Windows Server 2016 Core running in vcenter
Suggested fix
For current customers: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later
Enhancement to winrm-fs: echo to stdout any caught exceptions in the try/catch logic of
extract_files.ps1
. Cannot echo to stderr because that would cause the run to fail viawinrm-fs/lib/winrm-fs/core/file_transporter.rb
Line 401 in 2ecb6e8
The text was updated successfully, but these errors were encountered: