Deploying Service Fabric project locally: "FABRIC_E_IMAGEBUILDER_UNEXPECTED_ERROR"

1

Our company is starting with Service Fabric Microservices.

We install the Azure Service Fabric SDK as the MS documentation says (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started). We install it from de WebPI, open the powershell as admin, and run the "Set-ExecutionPolicy" comand. Later we install the Azure tools in Visual Studio and with that we could create an example project, an Stateless project.

Inmediatly after the project loaded all the dependencies, we "start" the project. (VS ran as admin) The VS sets the local cluster with 1 node and deploy the microservice. Until this point everythings was OK.

Then we create another Stateless project and we did the same things. But, this time we got and error in the output console of VS and in Service Fabric Explorer.

    2>Started executing script 'Deploy-FabricApplication.ps1'.
    2>powershell -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command ". 'C:\Users\xxxxx\source\repos\Application2\Application2\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 
    'C:\Users\xxxxx\source\repos\Application2\Application2\pkg\Debug' -PublishProfileFile 
    'C:\Users\xxxx\source\repos\Application2\Application2\PublishProfiles\Local.1Node.xml' -DeployOnly:$true -ApplicationParameter:@{_WFDebugParams_='[{"""CodePackageName""":"""Code""","""CodePackageLinkFolder""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1\\bin\\Debug\\netcoreapp3.0\\win7-
    x64""","""ConfigPackageName""":"""Config""","""ConfigPackageLinkFolder""":"""C:\\Users\\xxx\\source\\repos\\Application2\\Actor1\\PackageRoot\\Config""","""DataPackageName""":null,"""DataPackageLinkFolder""":null,"""LockFile""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1\\bin\\Debug\\netcoreapp3.0\\win7-x64\\_VS_ServiceFabric_lock.txt""","""WorkingFolder""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1""","""ServiceManifestName""":"""Actor1Pkg""",
    """EntryPointType""":"""Main""","""DebugExePath""":null,"""DebugArguments""":null,"""DebugParametersFile""":"""C:\\Users\\xxx\\source\\repos\\Application2\\
    Actor1\\bin\\Debug\\netcoreapp3.0\\win7-x64\\_VS_ServiceFabric_debug.txt"""}]'} -
    UnregisterUnusedApplicationVersionsAfterUpgrade $false -
    OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -
    SkipPackageValidation:$true -ErrorAction Stop"
    2>Copying application to image store...
    2>Upload to Image Store succeeded
    2>Registering application type...
    2>Register application type started. Use Get-ServiceFabricApplicationType to query for status.
    2>Running Image Builder process ...
    2>Downloading application package from 'Application2Type' ...
    2>Validating package and computing checksums ...
    2>FABRIC_E_IMAGEBUILDER_UNEXPECTED_ERROR: Se han producido uno o varios errores. --> AggregateException: Se han producido uno o varios errores. --> FileLoadException: El proceso no tiene acceso al archivo porque est  siendo utilizado por otro proceso. (Excepci¢n de HRESULT: 0x80070020)
    2>Registration of application type failed.
    2>En C:\Program Files\Microsoft SDKs\Service 
    2>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1: 308 Car cter: 17
    2>+                 throw "Registration of application type failed."
    2>+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2>    + CategoryInfo          : OperationStopped: (Registration of application type failed.:String) [], RuntimeException
    2>    + FullyQualifiedErrorId : Registration of application type failed.
    2> 
    2>Finished executing script 'Deploy-FabricApplication.ps1'.
    2>Time elapsed: 00:00:13.0719235
    2>The PowerShell script failed to execute.
    ========== Build: 1 succeeded, 0 failed, 2 up-to-date, 0 skipped ==========
    ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

We reseted the cluster and tried to deploy the 2 examples again, but we got the same error for the two microservices.

I was looking for a solution in Google, MS Docs and here, but no one has a solution.

c#
deployment
visual-studio-2017
azure-service-fabric
asked on Stack Overflow Oct 18, 2019 by Jbrenesbl

1 Answer

1

According to your log powershel can't get access to some process. As a very wide guess it could be a problem with an antivirus or your first debug session.

Have you tried not to debug(start vs), but to publish solution (Deploy project->right click-> publish) after cluster reset\restart?

answered on Stack Overflow Oct 22, 2019 by Victor Fialkin

User contributions licensed under CC BY-SA 3.0