Log:
Extracting package
July 19th 2021 16:55:32Info
..\UpdatePackages\
July 19th 2021 16:55:32Info
July 19th 2021 16:55:32Info
C:\Octopus\Work\20210719225526-157392-112\Scripts..\UpdatePackages\
July 19th 2021 16:55:32Info
July 19th 2021 16:55:32Info
C:\Octopus\Work\20210719225526-157392-112\Scripts
July 19th 2021 16:55:32Error
ObjectNotFound: Cannot find path ‘C:\Octopus\Work\20210719225526-157392-112\U’ because it does not exist.
I have tried to go back to the code before 2020.6.4722 and error is the same.
Please advise what has changed with PSscriptroot from 2020.6.4722 to Octopus 2021.1.
Thanks for getting in touch! Sorry to see you’re hitting this unexpected and inconsistent issue. I’m not aware of any changes with PSscriptroot between these versions. While I’m able to reproduce the Cannot find path error, it’s a bit different in that it’s pointing to a different subdirectory, i.e. 'C:\Octopus\newops\Work\20210720012101-86238-34\â?▌\' which seems to be due to the single ellipsis character (…) in the -ChildPath. I can’t reproduce this in the exact same way, which has me a bit perplexed. Is it possible there could be a copy/paste issue of some sort here?
I’m wondering if you instead use an Octopus populated and supplied system variable, Octopus.Action.Package[PackageID].ExtractedPath, might work and be easier to use. When referencing a package in this way on a script step, this variable will populate to the work dir.
If you’re still hitting this same issue, do you hit this same behavior when taking Octopus out of the equation and run the script directly on the box?
Lastly, I think the most helpful info would be verbose task log with debugging variables enabled. This will give us a more detailed look in the process and context.
We’ll be happy to have a look in that log, and you can email them privately to use at support@octopus.com