Failed to run Service Fabric Container(Windows) on Container Host OS (Windows Server 2016)

Bhoite, Vinod SBOBNG-PTIY/BE 6 Reputation points
2021-10-05T12:23:18.98+00:00

Problem Statement: *

Failed to run Service Fabric Container(Windows) on Container Host OS (Windows Server 2016)

  • Steps followed:
    1. I have created .Net Core 3.1 Sample API in Visual Studio 2019
    2. Installed Docker Host on my Windows 10 machine.
    3. Switched docker host to Windows container
    4. Created docker image of my .net Core application.
    5. Pushed that image to private docker registry
    6. Created Service Fabric Container application where I pulled this image
    7. Deployed Service Fabric Container application on local Service Fabric Cluster and Its working fine.
    8. On Azure Cloud, created VM with Windows Server 2016, installed Service Fabric Cluster (Host OS: Windows Server 2016)

Problem Started From Next step

  1. From Visual Studio, I have published my Service Fabric Container application to Service Fabric Cluster which in on VM (Windows Server 2016)
  2. After publishing, application shows below error in Service Fabric Cluster

**Actual Error: **

'System.Hosting' reported Error for property 'Download:1.0:1.0:bdfd5fc8-2749-4e59-9d29-7cd38a1f6557'. There was an error during download. System.Fabric.FabricException (-2147017731) Container image download failed with authorization attempt type=AppManifestCredentials for ImageName=sxxxxx/xxx/tcs:latest with unexpected error. Exception=System.Exception: Container image download failed - ImageName=xxxxx/xxx/tcs:latest. Please check if container image OS is compatible with host OS or if you have sufficient disk space on the machine. Try to pull the image manually on the machine using docker CLI for further er

Tried Below Solutions

  1. Not Worked: Added Below servercore Windows Server 2016 base image in dockerfile in FROM command in very first line

FROM mcr.microsoft.com/windows/servercore:ltsc2016 AS base

  1. Not Worked: Added Below nanocore Windows Server 2016 base image in dockerfile in FROM command in very first line

FROM mcr.microsoft.com/windows/nanoserver:ltsc2016 AS base

  1. Not Worked: Added tab in Application Manifest file to override Container host OS with Container image OS
    Reference Link: https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-containers#windows-server-container-os-and-host-os-compatibility

<ImageOverrides>
<Image Name= "xxxx/xxx/tcs" Os="14393" />
</ImageOverrides>

NOTE: 14393 is the build version for Windows Server 2016

Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
255 questions
Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
423 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,426 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,506 Reputation points
    2021-10-06T14:42:04.7+00:00

    Hello,

    the most common answers are related to the hardrive resources full, so I guess you can check and confirm on that too. You can try to increase the container download timeout:

    Configure container image download time

    https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-containers#configure-container-image-download-time

    But mainly you should make sure you target the correct version of the (base) image:

    Docker images for ASP.NET
    https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/building-net-docker-images?view=aspnetcore-5.0

    Tutorial: Containerize a .NET Core app
    https://learn.microsoft.com/en-us/dotnet/core/docker/build-container?tabs=windows

    The version of the image must be compatible with the version of Windows you're running on the host.

    https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-2022%2Cwindows-10-21H1

    What happens if you log into the nodes and download base image manually with docker pull?

    -----------------------------------------------------------------------------------------------------------------------------

    If the reply is helpful, please Upvote and Accept as answer

    0 comments No comments