Access to the path 'XXXXXXXXX' is denied


When deploying to an environment with octopus for the first time, we are getting the error in the picture attached. We have been able to deploy to other environments with the same configuration. The tentacle is running under the local system account which has full control over wwwroot. I have tested using the script console to add a new file to wwwroot and it works fine. Hazarding a guess that it was a process locking the files, we tried stopping IIS but it didn’t fix the problem. What should I next try?


Hi Warwick,

Thanks for getting in touch! Octopus itself will not lock files. Octopus will extract your files into a new folder, and run all of the transforms and processing it needs to do. As a final step it will copy the files to your Custom Installation Directory.
When it does this it will need to have full access to overwrite files in that folder. So the first thing I would do is check the permissions on those files in this case specifically the file that you have obscured. While the Octopus user may have access to that directory if that file (or others) have different permissions Octopus will not be able to overwrite those files. Generally when files are locked we get a different error message.

My suggestion would be to delete the files and let Octopus write to the folder. Once this has been completed it should not have any further problems. We strongly suggest that no user touches or modifies the files that Octopus will need access to.

Can you give that a try and let me know how you get on?