Thank you for reaching out to us with your query about purging directories.
This sounds like the file has been locked for editing. This is a protection mechanism built into Windows (and other operating systems) intended to prevent multiple people or applications from changing the same file at the same time. This means that, as the file is open for editing, Octopus Deploy won’t be able to change or delete it and the task will fail. It is unlikely that anyone else will be able to delete the file either until the editor has been closed and the file lock released.
The ideal solution is to avoid editing files manually and instead use a tool like Octopus Deploy to manage these changes. You may alternatively be able to create a pre-release script using Powershell to force all locks to be released but this does risk overwriting changes or creating conflicts.
I hope this is helpful. Please get back to us if you have any questions.
As I explained in my previous question, files are not locked. If we are trying to delete those files manually, I’m able to delete. So I dont think we can consider those files as locked.
The only thing is, Octopus treating those files as locked when it was open in editing mode whenever the same file I’m able to delete by login in server.
Can we handle this scenario without including any separate script for this.
This does sound like a lock issue, but it’d be good for us to investigate further to make sure. Could you please provide me with a screenshot/attachment of the relevant task log where this fails? In addition, could you please also confirm that my understanding is correct in that the deployment fails if a file in open in an editor but the deployment works if no editors are open at all?
Yes, your understanding is absolutely correct. Deployment get failed if file is open in editor for editing and have updated something in that.
But there is no any issue in deployment if there is no any file open in editor and nothing has changed into that.
Hope, now the scenario is bit clear to you.