Open danefalvo opened 1 year ago
I encounter similar issue. Assuming your Tentacle is running on Windows machine, there is a limit of 260 characters for file name. https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
This limitation can be disabled on Windows 10, Version 1607, and Later. You can find the details in the link above.
I encounter similar issue. Assuming your Tentacle is running on Windows machine, there is a limit of 260 characters for file name. https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
This limitation can be disabled on Windows 10, Version 1607, and Later. You can find the details in the link above.
According to the docs:
Understand that enabling this registry setting will only affect applications that have been modified to take advantage of the new feature.
Can the Octopus team confirm that the tentacle agent is indeed modified to take advantage of the longPathAware
feature, and that the 260 char limit can be bypassed with this workaround when deploying?
Team
Severity
Not Blocking
Version
2023.1 (build 686-hotfix 1630)
Latest Version
No response
What happened?
If you have a Nuget package with a powershell script at the location:
content\App\helloworld.ps1
the script will run as expected however running a script from a location with many characters:content\App\pXpVfbqAQksSSAPXwbTQVtKxOCgxrcdfMtWbqbBFBNpJnYrDKvKVQQNerWfKAcqUovXDmVYcVMCnCpJTHJeUyBpHDEfuYWVokNfH\kBOcwsKGTabUbQjdcACQKtPSaApnzBEWhzjkvKfjQzkxQuAQjysDAkwNnNwRskUFNvDcsWsWMaAefAJjohkyZWAPxtmbNFtwMBtS\AYhbjhguKAbVfVrYegeqQwfCMMhDmJodrJHDKMMrEKAfEVsSSKWKMzGZOaMCHkHubmOEaPNtVbgbfhUYyxfedQmrPfCWFPkgJHjV\helloworld.ps1
will result in an error finding 'Powershell'.
This issue has been ongoing with several
Reproduction
Steps 3 and 4 of https://danefalvo.octopus.app/app#/Spaces-1/projects/deploylongpackage/deployments/process/steps?actionId=d21f920e-9e56-4879-99c7-a815f4f4b177
Step 3 and 4 use the same package, same worker, etc. Step 4's powershell script is located in a long folder path.
Error and Stacktrace
More Information
This issue has been ongoing with various steps to fix this permanently.
To recap: This was one of the first issues - which is easily followable: https://github.com/OctopusDeploy/Issues/issues/4204
Although this rectified part of the issue - there was still an issue with extracting the package and it was chalked down to 'SharpCompress' not handling longfilepaths.
Additionally, all Dynamic Workers had 'LongFilePath compatibility' enabled.
This was rectified recently with a SharpCompress update. On trying the repro again, I have ended up with this error. So hopefully it's the last part of the fix, required to handle long paths correctly.
Workaround
Shorten the folder path.