Permissions failing when running tentacle as a domain user

I’m trying to run the tentacle as a domain user. It has read, write, execute, and modify access to D:\Octopus. It also has access to the AutomatedTesting folder. Could you all help explain what the cause of this issue is?

12:00:25 Verbose | Octopus Server version: 3.2.17+Branch.master.Sha.b0960a9cfd4291888532067011a3a1d87f849827
12:00:25 Info | Deploying package ‘D:\Octopus\Files\AutomatedTesting.0.1.25.nupkg-2d3433d9-6290-4f78-8345-01cb712eb571’ to machine 'https://ho-orasipoc:10933/'
12:00:26 Verbose | Octopus Deploy: Calamari version 3.1.29+Branch.master.Sha.8e5ace804897f2cdc3273d114ea529c8a5f4145f
12:00:26 Info | Deploying package: D:\Octopus\Files\AutomatedTesting.0.1.25.nupkg-2d3433d9-6290-4f78-8345-01cb712eb571
12:00:26 Verbose | Extracting package to: D:\Octopus\Applications\ORASI POC\AutomatedTesting\0.1.25_6
12:00:26 Verbose | Extracted 11 files
12:00:26 Info | Purging the directory 'D:\AutomatedTesting’
12:00:26 Info | Copying package contents to 'D:\AutomatedTesting’
12:00:26 Info | Copied 11 files
12:00:26 Verbose | Adding journal entry:
12:00:26 Verbose |
12:00:26 Verbose | Adding journal entry:
12:00:26 Verbose |
12:00:26 Error | System.UnauthorizedAccessException: Access to the path is denied.
12:00:26 Error | at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
12:00:26 Error | at System.IO.File.InternalReplace(String sourceFileName, String destinationFileName, String destinationBackupFileName, Boolean ignoreMetadataErrors)
12:00:26 Error | at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.OverwriteAndDelete(String originalFile, String temporaryReplacement) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 340
12:00:26 Error | at Calamari.Deployment.Journal.DeploymentJournal.Write(IEnumerable`1 elements) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Journal\DeploymentJournal.cs:line 108
12:00:26 Error | at Calamari.Deployment.Journal.DeploymentJournal.AddJournalEntry(JournalEntry entry) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Journal\DeploymentJournal.cs:line 37
12:00:26 Error | at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments) in Y:\work\14ffc968155e4956\source\Calamari\Commands\DeployPackageCommand.cs:line 106
12:00:26 Error | at Calamari.Program.Execute(String[] args) in Y:\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
12:00:26 Fatal | The remote script failed with exit code 100

Hi,

Thanks for getting in touch! The error is happening when Octopus is trying to write to the deployment journal on the Tentacle. While you can give folder permissions because that file is created on the first deployment for that Tentacle that user would have the correct permissions.
The easiest way to fix this is to rename the deployment journal file to a temporary name and run a deployment under the new user. It will recreate the file. You will need to add the current deployment journal contents to the new file otherwise your retention policies will not run for your existing deployments. Move everything inside the <Deployments> tags.

The deployment journal should be found in C:\Octopus\ on standard installations.

Please let me know if that resolves the problem for you.
Vanessa

Vanessa,

Thank you for your answer. What is the name of the deployment journal? Do you have the full path to that file?

Vanessa,

I’m guessing the file is found at C:\Octopus\Applications.Tentacle for standard installations?

Vanessa,

We removed the DeploymentJournal found at D:\Octopus\DeploymentJournal.xml after making a backup of it. After removing it, we ran the problem job to have the file regenerated and our job failed with an “Access is denied” issue. Does this require a restart of the octopus service? I’m attaching the log.

10:20:20 Verbose | Adding journal entry:
10:20:20 Verbose |
10:20:20 Verbose | Adding journal entry:
10:20:20 Verbose |
10:20:20 Error | System.UnauthorizedAccessException: Access to the path is denied.
10:20:20 Error | at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
10:20:20 Error | at System.IO.File.InternalReplace(String sourceFileName, String destinationFileName, String destinationBackupFileName, Boolean ignoreMetadataErrors)
10:20:20 Error | at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.OverwriteAndDelete(String originalFile, String temporaryReplacement) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 340
10:20:20 Error | at Calamari.Deployment.Journal.DeploymentJournal.Write(IEnumerable`1 elements) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Journal\DeploymentJournal.cs:line 108
10:20:20 Error | at Calamari.Deployment.Journal.DeploymentJournal.AddJournalEntry(JournalEntry entry) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Journal\DeploymentJournal.cs:line 37
10:20:20 Error | at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments) in Y:\work\14ffc968155e4956\source\Calamari\Commands\DeployPackageCommand.cs:line 106
10:20:20 Error | at Calamari.Program.Execute(String[] args) in Y:\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
10:20:20 Fatal | The remote script failed with exit code 100
|

Vanessa,

Please disregard my previous posts. What you originally suggested resolved the issue. It was a mistake on my part. We were on the wrong server. thanks for your help.

Hi,

Great to hear it :slight_smile:

Vanessa