Hello,
I am getting the following error when I am trying to deploy a windows service. I have a pre-deployment and post deployment script that are run but the pre-deployment one is erroring out due to permissions. I have granted the local service account for the tentacle permissions to the directory that it is deploying to as well as the octopus folder where the configuration files are and still no dice.
Did not overwrite ‘C:\Services\TaskEngine\Octopus.Features.WindowsService_BeforePostDeploy.ps1’, it was already on disk
10:41:14Error
System.UnauthorizedAccessException: Access to the path ‘C:\Services\TaskEngine\Bootstrap.Octopus.Features.WindowsService_BeforePostDeploy.ps1’ is denied.
10:41:14Error
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
10:41:14Error
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
10:41:14Error
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
10:41:14Error
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
10:41:14Error
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
10:41:14Error
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding)
10:41:14Error
at Calamari.Integration.Scripting.WindowsPowerShell.PowerShellBootstrapper.PrepareBootstrapFile(String targetScriptFile, VariableDictionary variables) in y:\work\b1fd300731d5f2fc\source\Calamari\Integration\Scripting\WindowsPowerShell\PowerShellBootstrapper.cs:line 68
10:41:14Error
at Calamari.Integration.Scripting.WindowsPowerShell.PowerShellScriptEngine.Execute(String scriptFile, VariableDictionary variables, ICommandLineRunner commandLineRunner) in y:\work\b1fd300731d5f2fc\source\Calamari\Integration\Scripting\WindowsPowerShell\PowerShellScriptEngine.cs:line 20
10:41:14Error
at Calamari.Integration.Scripting.CombinedScriptEngine.Execute(String scriptFile, VariableDictionary variables, ICommandLineRunner commandLineRunner) in y:\work\b1fd300731d5f2fc\source\Calamari\Integration\Scripting\CombinedScriptEngine.cs:line 46
10:41:14Error
at Calamari.Deployment.Conventions.FeatureScriptConvention.Install(RunningDeployment deployment) in y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\Conventions\FeatureScriptConvention.cs:line 66
10:41:14Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\ConventionProcessor.cs:line 60
10:41:14Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\ConventionProcessor.cs:line 28
10:41:14Error
Running rollback conventions…
10:41:14Error
System.UnauthorizedAccessException: Access to the path ‘C:\Services\TaskEngine\Bootstrap.Octopus.Features.WindowsService_BeforePostDeploy.ps1’ is denied.
10:41:14Error
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
10:41:14Error
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
10:41:14Error
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
10:41:14Error
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
10:41:14Error
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
10:41:14Error
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding)
10:41:14Error
at Calamari.Integration.Scripting.WindowsPowerShell.PowerShellBootstrapper.PrepareBootstrapFile(String targetScriptFile, VariableDictionary variables) in y:\work\b1fd300731d5f2fc\source\Calamari\Integration\Scripting\WindowsPowerShell\PowerShellBootstrapper.cs:line 68
10:41:14Error
at Calamari.Integration.Scripting.WindowsPowerShell.PowerShellScriptEngine.Execute(String scriptFile, VariableDictionary variables, ICommandLineRunner commandLineRunner) in y:\work\b1fd300731d5f2fc\source\Calamari\Integration\Scripting\WindowsPowerShell\PowerShellScriptEngine.cs:line 20
10:41:14Error
at Calamari.Integration.Scripting.CombinedScriptEngine.Execute(String scriptFile, VariableDictionary variables, ICommandLineRunner commandLineRunner) in y:\work\b1fd300731d5f2fc\source\Calamari\Integration\Scripting\CombinedScriptEngine.cs:line 46
10:41:14Error
at Calamari.Deployment.Conventions.FeatureScriptConvention.Install(RunningDeployment deployment) in y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\Conventions\FeatureScriptConvention.cs:line 66
10:41:14Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\ConventionProcessor.cs:line 60
10:41:14Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\ConventionProcessor.cs:line 50
10:41:14Error
at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments) in y:\work\b1fd300731d5f2fc\source\Calamari\Commands\DeployPackageCommand.cs:line 107
10:41:14Error
at Calamari.Program.Main(String[] args) in y:\work\b1fd300731d5f2fc\source\Calamari\Program.cs:line 21