File System - Clean directory returns could not locate path

Hello,

When using this community step template, I get the error:

Could not locate path “Octopus.Action[Remove Plugins].Output.Package.InstallationDirectoryPath”

Ignore:
September 21st 2017 13:06:57Info
Paths To Clean: Octopus.Action[Remove Plugins].Output.Package.InstallationDirectoryPath
September 21st 2017 13:06:57Warning
Could not locate path “Octopus.Action[Remove Plugins].Output.Package.InstallationDirectoryPath”

I used the StepName, as suggested by the help message:
Usually you would set this to Octopus.Action[StepName].Output.Package.InstallationDirectoryPath.

I’ve also tried to use the previous step name (as suggested here: https://help.octopusdeploy.com/discussions/questions/1816-how-to-get-package-install-directory-from-powershell-steps), even if I didn’t understand why the previous step name would be needed.

Would it be possible to log/display in the console the exact folder path in which Octopus tries to remove files?

Best Regards,
Nicolas

Hi Nicolas,

Thanks for getting in touch! I think the confusion here is to do with variables and when they are available during deployments.
The step template you are running needs a path from a package step that is run in the process before clean step is run.
The installation directory is populated during a package step, and any output variables can be used in subsequent steps.

So the clean step needs you to use the step name of your package step that was deployed to know where to clean up from and grab that output variable.

We have some documentation pages that may help explain these events to you, and even some special variables that will output to the logs all available variables so you can troubleshoot issues like this:
https://octopus.com/docs/deploying-applications/variables/output-variables
https://octopus.com/docs/how-to/debug-problems-with-octopus-variables

Hope that helps!
Vanessa