System.UnauthorizedAccessException

I am getting “System.UnauthorizedAccessException: (5) Access is denied: [\?\Api.dll]”
System.UnauthorizedAccessException: (5) Access is denied

Hi @krishna.d1982,

Thanks for getting in touch, and sorry to hear that you’re having issues with your deployment. This error can come from a couple of sources:

  1. The user that the Octopus tentacle service is running under does not have permission to access that file.
  2. The app pool is still running, and locking the file. If you are using the “Custom Installation Directory” deployment feature, you may need to shut down the application pool first to free up the file lock. We do have a community step template called “IIS AppPool - Stop” that can handle this for you.
  3. The file could be in use by another process, locking it from being deleted. If this is the case, you might want to look at using something like Process Explorer to see what is holding a lock.
  4. Depending on your Octopus version, we did have a bug with AlphaFS being unable to delete a directory with Junction points. We resolved this in version 2018.9.7.

I hope these solutions help! Please let me know how you go with resolving the problem!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.