-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different build issues #896
Comments
Can you share your Dockerfile? |
Here is the Dockerfile: # escape=`
FROM registry:5003/node:16.13.1-nanoserver as node
FROM library/openjdk:11-jdk-windowsservercore-1809 AS openjdk
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS installer
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# SDK image
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
# In order to set system PATH, ContainerAdministrator must be used
USER ContainerAdministrator
# enabled ms-dtc
RUN Stop-Service MSDTC ; `
Uninstall-Dtc -Confirm:$false ; `
Install-Dtc ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC\Security' -Name LuTransactions -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC\Security' -Name NetworkDtcAccess -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC\Security' -Name NetworkDtcAccessInbound -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC\Security' -Name NetworkDtcAccessOutbound -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC\Security' -Name NetworkDtcClients -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC\Security' -Name NetworkDtcAccessTransactions -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC\Security' -Name NetworkDtcAccessAdmin -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC\Security' -Name NetworkDtcAccessClients -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC' -Name AllowOnlySecureRpcCalls -Value 1 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC' -Name FallbackToUnsecureRPCIfNecessary -Value 0 ; `
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\MSDTC' -Name TurnOffRpcSecurity -Value 0 ; `
Set-Service MSDTC -StartupType Automatic ; `
Restart-Service MSDTC -Force ;
RUN sc.exe config NetTcpPortSharing start=demand
WORKDIR TEMP
#get git and set it up
ENV GIT_VERSION=2.25.1
ENV GIT_DOWNLOAD_URL=https://github.com/git-for-windows/git/releases/download/v$GIT_VERSION.windows.1/Git-$GIT_VERSION-64-bit.exe
RUN Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile git.exe; `
Start-Process git.exe -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS /DIR=C:\git\' -Wait; `
Remove-Item -Force git.exe; `
$env:PATH = 'C:\git\bin;C:\git\cmd;{0}' -f $env:PATH; `
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH; `
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name GIT_ASKPASS -Value "C:\git\mingw64\libexec\git-core\git-askpass.exe"; `
# configure git to use ssl and the plano cert within the cert-store (could not be here til this line, but needs to be there in this image)
git config --system http.sslVerify 'false'; `
git config --system core.longpaths 'true' ; `
#git config --system http.sslCAInfo 'Cert:/LocalMachine/CA/rootca.cer'; `
git config --global user.email "buildy@planopunkt.de"; `
git config --global user.name "Buildy"
WORKDIR /
# install sonar scanner for msbuild. this installs also the standard sonar qube scanner but it needs java to run (the image is later installed)
ENV SONAR_QUBE_VERSION=3.3.0.1492
ENV SONAR_QUBE_FOLDER=sonar-scanner-$SONAR_QUBE_VERSION `
SONAR_MSBUILD_VERSION=4.8.0.12008 `
SONAR_MSBUILD_ENV=netcoreapp2.0
ENV SONAR_MSBUILD_DOWNLOAD_URL=https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/$SONAR_MSBUILD_VERSION/sonar-scanner-msbuild-$SONAR_MSBUILD_VERSION-$SONAR_MSBUILD_ENV.zip
RUN Invoke-WebRequest $env:SONAR_MSBUILD_DOWNLOAD_URL -OutFile sonar-msbuild.zip; `
Expand-Archive sonar-msbuild.zip -DestinationPath SonarQubeScanner; `
Remove-Item -Force sonar-msbuild.zip
# define common environment variables
# registering the SonarQube.MSBuild.dll as a variable to be able to call it more simply from a cake/yml file
ENV SonarQubeMSBuildDll=C:\SonarQubeScanner\SonarScanner.MSBuild.dll `
JAVA_HOME=C:\\openjdk-11
# workaround for gitlab runner: https://gitlab.com/gitlab-org/gitlab-runner/issues/2550
RUN net accounts /MaxPWAge:unlimited; `
net user build_user /add; `
net localgroup Administrators /add build_user
USER build_user
# the New-Item under the build_user needs to run BEFORE a copy into this path (maybe it is not created when the user is created)
# setting ALL path related directories at once
RUN New-Item $($env:APPDATA + '\npm'); `
$env:PATH = 'C:\nodejs;C:\SonarQubeScanner\{0}\bin;C:\SonarQubeScanner;{1}\npm;{2}\dotnet;{3}\bin;{4}' -f $env:SONAR_QUBE_FOLDER, $env:APPDATA, $env:ProgramFiles, $env:JAVA_HOME, $env:PATH; `
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH; `
# workaround im Roming Ordner Datei npm löschen
if (Test-Path $env:USERPROFILE/AppData/Roaming/npm) { `
Remove-Item -Force $env:USERPROFILE/AppData/Roaming/npm `
};
#Enable Long Paths in Windows 10, Version 1607, and Later
RUN Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value '1' -Type DWord
# install chocolatey, docker client and docker-compose
ENV chocolateyUseWindowsCompression false
RUN Invoke-WebRequest -Uri 'https://chocolatey.org/install.ps1' -OutFile 'install.ps1' -UseBasicParsing; `
.\install.ps1; `
choco install docker -y; `
choco install docker-compose -y; `
choco install octopustools -y;
VOLUME c:/certificates/
COPY --from=node /nodejs /nodejs
COPY --from=node /yarn /yarn
COPY --from=openjdk $JAVA_HOME $JAVA_HOME
COPY .npmrc 'C:\Users\build_user\.npmrc'
COPY sonar-scanner.properties /SonarQubeScanner/$SONAR_QUBE_FOLDER/conf/
COPY SonarQube.Analysis.xml /SonarQubeScanner/
### Set an environment variable using the System.Environment .NET class
ENV DOCKER_HOST='\\.\pipe\docker_engine'
# JENKINS Install
ENV JENKINS_SWARM_VERSION 3.25
ENV HOME /jenkins-slave
RUN mkdir \jenkins-slave
RUN Invoke-WebRequest $('https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/{0}/swarm-client-{0}.jar' -f $env:JENKINS_SWARM_VERSION) -OutFile 'swarm-client.jar' -UseBasicParsing
COPY jenkins-slave.cmd /jenkins-slave.cmd
VOLUME C:\jenkins-slave
ENTRYPOINT [ "cmd", "/C", "C:\\jenkins-slave.cmd" ]
|
We tested again, this time only with the "mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019" . DockerHost with AMD Ryzen 7, 8 cores and 32 GB Ram The command:
The main memory is full and will not be released again. Oh, that was my laptop running Docker Desktop. |
Now the rigth server AMD EPYC 7502P 32-Core with 512gb Ram
The process never needed more than 8gb of ram. |
I'm just guessing here but the memory issues only seems like a symptom of there being an infinite loop due to the stack overflow messages I see. Can we narrow this down to just one project/solution? In the initial post you were building |
I always build the same thing. This is due to dotnet msbuild in which order.is built. What I find strange is OutOfMemmory Exception, "paging file to small" but it was never used more like 8 of 15gb Ram. There are currently 250 projects being build. That has always built up to inclusive.net 5 sdk. The problem is only in the container, on virtual machines and physical machines there is no problem. The build command is:
The log is coming. |
Jeder Build schlägt mit einer anderen Fehlermeldung fehl. |
Now i have a new error: e.App.Ref\6.0.2\ref\net6.0\System.Xml.Linq.dll" /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0\System.Xml.ReaderWriter.dll" /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0\System.Xml.Serialization.dll" /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0\System.Xml.XDocument.dll" /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0\System.Xml.XmlDocument.dll" /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0\System.Xml.XmlSerializer.dll" /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0\System.Xml.XPath.dll" /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0\System.Xml.XPath.XDocument.dll" /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0\WindowsBase.dll" /delaysign- /keyfile:C:\dev\Backend\Buildtools\Key.snk /optimize- /out:obj\Debug\net6.0\nl\plano.Calendar.Service.resources.dll /resource:obj\Debug\net6.0\plano.Calendar.Service.Resources.Calendar.nl.resources /target:library /deterministic+ obj\Debug\net6.0\nl\plano.Calendar.Service.resources.cs /warnaserror+:NU1605 Process is terminated due to StackOverflowException. |
Yeah, I saw the |
We had similar issues with the dotnet 5 sdk and older. |
The containers have a memory limit of 25GB Ram. |
With isolationmode hyper only worked once. Now have similar errors. |
Have you tried providing more memory to the container? |
Yes, I tested with 50 gb, the same. |
[Triage]: @rainersigwald - can you help investigate this issue? It seems specific to MSBuild. It looks to be only happening in a container environment and not on physical or virtual machine. Not sure if it's resource-limited or not. |
Hello, I haven't had the error on physical or virtual computers yet. |
Hi, my colleague sent me the post. This shows exactly the same behavior as when I build it. |
Closing this as a duplicate of dotnet/runtime#58974. |
Describe the Bug
We use a Docker container as Jenkins Slave based on mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019, it worked with .net core 2.0,2.1,3.1 and .net 5 Sdk. We have many over 250 projects being built.
Each container has 16 cores and 25gb of ram.
We had various errors during the trials.
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4181: The "Csc" task returned false but did not log an error. [C:\jenkins-slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: The "Csc" task failed unexpectedly. [C:\jenkins-slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: System.AggregateException: One or more errors occurred. (One or more errors occurred. (Cannot access a closed pipe.)) [C:\jenkins-slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: ---> System.AggregateException: One or more errors occurred. (Cannot access a closed pipe.) [C:\jenkins-slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: ---> System.ObjectDisposedException: Cannot access a closed pipe. [C:\jenkins-slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: at System.IO.Pipes.PipeStream.get_SafePipeHandle() [C:\jenkins- slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: at System.IO.Pipes.PipeStream.PipeValueTaskSource.<>c. b__17_0(Object s, CancellationToken token) [C:\jenkins-slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source) [C:\jenkins-slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback() [C:\jenkins- slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB4018: at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException) [C:\jenkins- slave\workspace\test_develop\Backend\FrameworkLegacy\LibBase\src\LibBase.csproj]
currently it is:
C:\Program Files\dotnet\sdk\6.0.102\Roslyn\Microsoft.CSharp.Core.targets(75,5): error : Failed to create CoreCLR, HRESULT: 0x8007000E
Steps to Reproduce
Other Information
This works fine on physical or virtual machines
Output of
docker version
Client: Mirantis Container Runtime
Version: 20.10.7
API version: 1.41
Go version: go1.13.15
Git commit: 40ef3b6
Built: 08/19/2021 18:54:26
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Mirantis Container Runtime
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.24)
Go version: go1.13.15
Git commit: e1bf5b9c13
Built: 08/19/2021 18:53:20
OS/Arch: windows/amd64
Experimental: true
Output of
docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker Application (Docker Inc., v0.8.0)
cluster: Manage Mirantis Container Cloud clusters (Mirantis Inc., v1.9.0)
registry: Manage Docker registries (Docker Inc., 0.1.0)
Server:
Containers: 19
Running: 19
Paused: 0
Stopped: 0
Images: 3497
Server Version: 20.10.7
Storage Driver: windowsfilter (windows) lcow (linux)
Windows:
LCOW:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics internal l2bridge l2tunnel nat null overlay private transparent
Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)
Operating System: Windows Server 2019 Standard Version 1809 (OS Build 17763.2452)
OSType: windows
Architecture: x86_64
CPUs: 64
Total Memory: 511.9GiB
Name: buildserv1
ID: TPMC:243Q:XE5U:DZYD:RXXN:NC3O:6WBG:WU5Q:OJDA:YGS6:5G4M:NXAS
Docker Root Dir: D:\dockerdata
Debug Mode: true
File Descriptors: -1
Goroutines: 180
System Time: 2022-02-18T15:24:06.9936252+01:00
EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
registry:5001
registry:5003
127.0.0.0/8
Registry Mirrors:
https://registry:5002/
Live Restore Enabled: false
WARNING: API is accessible on http://0.0.0.0:2375 without encryption.
Access to the remote API is equivalent to root access on the host. Refer
to the 'Docker daemon attack surface' section in the documentation for
more information: https://docs.docker.com/go/attack-surface/
The text was updated successfully, but these errors were encountered: