microsoft/Windows-Containers

Issue with missing DLL in runtime:4.8-windowsservercore-ltsc2022

nitinghaghada opened this issue · 5 comments

I am using mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022 as base image in my docker file to create custom image. After installing this custom image, I am frequently getting missing performance counter DLL error (Win32 error code 126) in the container in the event logs. See below error even log,

EventID : 1023
MachineName : XXXXXXXXX
Data : {}
Index : 4592
Category : (0)
CategoryNumber : 0
EntryType : Error
Message : Windows cannot load the extensible counter DLL "C:\Windows\System32\perfts.dll" (Win32 error code 126).
Source : Microsoft-Windows-Perflib
ReplacementStrings : {C:\Windows\System32\perfts.dll, 126}
InstanceId : 1023

When I looked for perfts.dll, I could not found it in c:\windows\system32 folder. Is it issue or removed this DLL in this version of Windows?

Thanks & regards,
Nitin

The perfts.dll is not available in the servercore image, may I ask what are you trying to do?

Thanks for reply. We are not doing anything with perfts.dll but because of missing DLL file, system frequently register errors. If it is not part of the core image then curious to know why system is trying to load it. Please note that my application running on container do not use performance counter or any processes which use this assembly.
I also found this file entry in system registry.

Regards,
Nitin

Hi, we'll need some more details to understand what's going wrong on your end. I tried to repro a scenario I thought would be similar to yours but I never found a similar perfts.dll error in my event logs.

Info We Need

  • Host OS
  • Output of docker info
  • Output of docker inspect <image ID for mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022> (you can get the imageID by doing a docker images)
  • Repro steps

Steps I Took

  1. Using Windows Server 2022 host and Docker Desktop.
  2. Pull the image.
docker pull mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022
  1. Start up a container with the image to check that it loads normally.
docker run --rm -it  mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022
  1. Create a simple Dockerfile using that as the base image.
# Use .NET as base image
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022

# Set working directory
WORKDIR /app

# Copy application code over (like .exe and .dll)
COPY /MyProgram /app

# Throwaway command for build
RUN echo "done"
  1. Build our custom image.
docker build -t my-dotnet .
  1. Start up a container using the custom image.
docker run --rm -it my-dotnet
  1. While the container is still running, open a new PowerShell window and query the event logs for a similar error.
Get-EventLog -LogName Application | Where-Object {$_.Message -like "*perfts.dll*"}
Get-EventLog -LogName Application | Where-Object {$_.Message -like "*cannot load* *DLL*"}

Note

The first command checks the event logs for any entry that contains the word perfts.dll. The second checks for any entry with the phrases cannot load and DLL. Neither hit a match.

Hello Nicole,

Thank you for detail test and elaborate each steps. I have created another image from same windows server core base image (runtime:4.8-windowsservercore-ltsc2022) and didn't face issue.

Issue is only with our custom docker image, We have enabled some IIS features and also adding .net core runtime and URL rewrite modules etc. It might causing that DLL issue.

Thanks for help. I will investigate it on our repo. We can close this issue.

Thanks & regards,
Nitin

@nitinghaghada Ah good to know! Do open another GitHub Issue if you hit problems using those specific IIS features, .NET core, etc.