Octopus Deploy: The step failed: Activity Run Package on Master-Controller failed with error 'The remote script failed with exit code 255'

0

I'm using Octopus-Deploy and i'm getting an error when running the following powershell script on a tentacle:

cd "C:\Repository\QA - Automation\UnitTestProject\bin\Debug"
.\UnitTestProject.exe

the error is:

Unhandled Exception: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). September 14th 2017 07:56:03Error
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType) September 14th 2017 07:56:03Error
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType) September 14th 2017 07:56:03Error
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj) September 14th 2017 07:56:03Error
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) September 14th 2017 07:56:03Error
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) September 14th 2017 07:56:03Error
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) September 14th 2017 07:56:03Error
at System.Activator.CreateInstance(Type type, Boolean nonPublic) September 14th 2017 07:56:03Error
at System.Activator.CreateInstance(Type type) September 14th 2017 07:56:03Error
at se_builder.PIM_Bicycle.Main(String[] args) in C:\Repository\QA - Automation\UnitTestProject\PIM_Bicycle.cs:line 25 September 14th 2017 07:56:03Fatal The remote script failed with exit code 255 September 14th 2017 07:56:03Fatal Run Package on Master-Controller

I have no clue why it's not working. I'm a novice at Octopus-Deploy and Powershell so help would be greatly appreciated! The application i'm deploying is a Program that uses Selenium to run tests using an Excel spreadsheet included in the package. The file structure is:

C:.
September 14th 2017 07:55:29Info
├───QA - Automation
September 14th 2017 07:55:29Info
│   ├───packages
September 14th 2017 07:55:29Info
│   │   ├───Microsoft.Office.Interop.Excel.15.0.4795.1000
September 14th 2017 07:55:29Info
│   │   │   └───lib
September 14th 2017 07:55:29Info
│   │   │       └───net20
September 14th 2017 07:55:29Info
│   │   ├───Selenium.Chrome.WebDriver.2.31
September 14th 2017 07:55:29Info
│   │   │   ├───build
September 14th 2017 07:55:29Info
│   │   │   └───driver
September 14th 2017 07:55:29Info
│   │   ├───Selenium.Firefox.WebDriver.0.18.0
September 14th 2017 07:55:29Info
│   │   │   ├───build
September 14th 2017 07:55:29Info
│   │   │   └───driver
September 14th 2017 07:55:29Info
│   │   ├───Selenium.PhantomJS.WebDriver.2.1.1
September 14th 2017 07:55:29Info
│   │   │   ├───build
September 14th 2017 07:55:29Info
│   │   │   └───driver
September 14th 2017 07:55:29Info
│   │   ├───Selenium.Support.3.5.2
September 14th 2017 07:55:29Info
│   │   │   └───lib
September 14th 2017 07:55:29Info
│   │   │       ├───net35
September 14th 2017 07:55:29Info
│   │   │       └───net40
September 14th 2017 07:55:29Info
│   │   ├───Selenium.WebDriver.3.5.2
September 14th 2017 07:55:29Info
│   │   │   └───lib
September 14th 2017 07:55:29Info
│   │   │       ├───net35
September 14th 2017 07:55:29Info
│   │   │       └───net40
September 14th 2017 07:55:29Info
│   │   ├───Selenium.WebDriver.ChromeDriver.2.32.0
September 14th 2017 07:55:29Info
│   │   │   ├───build
September 14th 2017 07:55:29Info
│   │   │   └───driver
September 14th 2017 07:55:29Info
│   │   │       ├───linux64
September 14th 2017 07:55:29Info
│   │   │       ├───mac64
September 14th 2017 07:55:29Info
│   │   │       └───win32
September 14th 2017 07:55:29Info
│   │   └───Selenium.WebDriver.IEDriver.3.5.1
September 14th 2017 07:55:29Info
│   │       ├───build
September 14th 2017 07:55:29Info
│   │       └───driver
September 14th 2017 07:55:29Info
│   ├───PIMData
September 14th 2017 07:55:29Info
│   └───UnitTestProject
September 14th 2017 07:55:29Info
│       ├───bin
September 14th 2017 07:55:29Info
│       │   └───Debug
September 14th 2017 07:55:29Info
│       ├───obj
September 14th 2017 07:55:29Info
│       │   └───Debug
September 14th 2017 07:55:29Info
│       │       └───TempPE
September 14th 2017 07:55:29Info
│       └───Properties
September 14th 2017 07:55:29Info
└───UnitTestProject
September 14th 2017 07:55:29Info
    ├───packages
September 14th 2017 07:55:29Info
    │   ├───Selenium.Chrome.WebDriver.2.31
September 14th 2017 07:55:29Info
    │   │   ├───build
September 14th 2017 07:55:29Info
    │   │   └───driver
September 14th 2017 07:55:29Info
    │   ├───Selenium.Firefox.WebDriver.0.18.0
September 14th 2017 07:55:29Info
    │   │   ├───build
September 14th 2017 07:55:29Info
    │   │   └───driver
September 14th 2017 07:55:29Info
    │   ├───Selenium.PhantomJS.WebDriver.2.1.1
September 14th 2017 07:55:29Info
    │   │   ├───build
September 14th 2017 07:55:29Info
    │   │   └───driver
September 14th 2017 07:55:29Info
    │   ├───Selenium.Support.3.5.2
September 14th 2017 07:55:29Info
    │   │   └───lib
September 14th 2017 07:55:29Info
    │   │       ├───net35
September 14th 2017 07:55:29Info
    │   │       └───net40
September 14th 2017 07:55:29Info
    │   ├───Selenium.WebDriver.3.5.2
September 14th 2017 07:55:29Info
    │   │   └───lib
September 14th 2017 07:55:29Info
    │   │       ├───net35
September 14th 2017 07:55:29Info
    │   │       └───net40
September 14th 2017 07:55:29Info
    │   ├───Selenium.WebDriver.ChromeDriver.2.32.0
September 14th 2017 07:55:29Info
    │   │   ├───build
September 14th 2017 07:55:29Info
    │   │   └───driver
September 14th 2017 07:55:29Info
    │   │       ├───linux64
September 14th 2017 07:55:29Info
    │   │       ├───mac64
September 14th 2017 07:55:29Info
    │   │       └───win32
September 14th 2017 07:55:29Info
    │   └───Selenium.WebDriver.IEDriver.3.5.1
September 14th 2017 07:55:29Info
    │       ├───build
September 14th 2017 07:55:29Info
    │       └───driver
September 14th 2017 07:55:29Info
    └───UnitTestProject
September 14th 2017 07:55:29Info
        ├───bin
September 14th 2017 07:55:29Info
        │   └───Debug
September 14th 2017 07:55:29Info
        ├───obj
September 14th 2017 07:55:29Info
        │   └───Debug
September 14th 2017 07:55:29Info
        │       └───TempPE
September 14th 2017 07:55:29Info
        └───Properties

Also, note that this Application runs perfectly in Visual Studio and that I package the application in Visual Studio Team Services and push it to my Octopus-Deploy server. These are the steps I use on Visual Studio Team Services:

Image of Steps in VSTS

Thanks for the help!

c#
automation
powershell-2.0
octopus-deploy
asked on Stack Overflow Sep 14, 2017 by Ostrava • edited Nov 21, 2018 by Timo

1 Answer

0

Alright, so I figured out the solution to this problem. The issue was that Microsoft Excel wasn't allowing a network service to have control of it. In order to fix the issue, all I needed to do was the following:

1) Go to C:\Program Files (x86)\Microsoft Office\Office14 and open up EXCEL.EXE's properties window.

2) Open up the security tab and then click Edit... and then click add..

3) type in: "network service" without quotes in the "Enter the object names to select" and then click "Check Names" and click OK.

4) Under "Group or user names" you then need to select what you just added to the groups (network services) and then under "Permission for SYSTEM" put a check mark in the "Full Control" check box under "Allow" then hit "Apply" and then "OK".

Then that will solve your problem!

Thanks!

Zach

answered on Stack Overflow Sep 15, 2017 by Ostrava

User contributions licensed under CC BY-SA 3.0