Determine path causing System.UnauthorizedAccessException:

I have a tentacle setup which has been working to the local drive. I pointed the deployment to a symlink which points to a network location and am now receiving an error. The weird part is that the System.UnauthorizedAccessException error happens after the files are copied to the folder location. So permissions to the network location are okay. According to the log excerpt below the error occurs during “Adding Journal Entry”. I am not sure where that occurs. I am using a domain account on the tentacle for permissions. I added the account to machine administrators group and the error still occurs (So I removed those permissions). How do I determine what cannot be written to?

c:\Pulse.Web is a symbolic link to a network location
Tentacle application is loaded in c:\program files\octopus deploy
Working folder is at d:\octopus
Tentacle version is 3.2.1
Tentacle is running on Windows 2012 R2

Deployment log excerpt:

16:15:28 Info | Purging the directory 'c:\Pulse.Web’
16:15:46 Info | Copying package contents to 'c:\Pulse.Web’
16:16:16 Info | Copied 885 files
16:16:16 Verbose | Adding journal entry:
16:16:16 Verbose |
16:16:16 Verbose | Adding journal entry:
16:16:16 Verbose |
16:16:16 Error | System.UnauthorizedAccessException: Access to the path is denied.
16:16:16 Error | at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
16:16:16 Error | at System.IO.File.InternalReplace(String sourceFileName, String destinationFileName, String destinationBackupFileName, Boolean ignoreMetadataErrors)
16:16:16 Error | at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.OverwriteAndDelete(String originalFile, String temporaryReplacement) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 340

It seems I need to set explicit write rights to the d:\octopus folder for the network account. Not sure why it failed when I added that account to the machine’s administrators group.

Hi Bslaski,

Glad you got it working!