al-cheb / configure-pagefile-action

Set PageFileSize on GitHub Windows Hosted Agents
MIT License
28 stars 14 forks source link

Error: Exception calling "SetPageFileSize" with "3" argument(s): "The operation completed successfully" #18

Open exoego opened 11 months ago

exoego commented 11 months ago

Hi. I'd like to increase minimum-size to 16GB ore more, but it appears that 12GB is upper limit. Any idea?

-  uses: al-cheb/configure-pagefile-action@v1.3
    with:
      minimum-size: 12GB
      maximum-size: 16GB

works finely, but

-  uses: al-cheb/configure-pagefile-action@v1.3
    with:
      minimum-size: 13GB
      maximum-size: 16GB

results in:

Error: Exception calling "SetPageFileSize" with "3" argument(s): "The operation completed successfully"
At D:\a\_actions\al-cheb\configure-pagefile-action\v1.3\scripts\SetPageFileSize.ps1:193 char:1
+ [Util.PageFile]::SetPageFileSize($minimumSize, $maximumSize, $diskRoo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : Win32Exception
Command log ``` Run al-cheb/configure-pagefile-action@v1.3 with: minimum-size: 13GB maximum-size: 16GB disk-root: D: env: GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=4 GITHUB_TOKEN: *** GITHUB_USER: exoego CommandPromptType: Native DevEnvDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\ ExtensionSdkDir: C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs EXTERNAL_INCLUDE: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.[3](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:3)7.32822\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\1[4](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:4).37.32822\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um Framework40Version: v4.0 FrameworkDir: C:\Windows\Microsoft.NET\Framework64\ FrameworkDir64: C:\Windows\Microsoft.NET\Framework64\ FrameworkVersion: v4.0.30319 FrameworkVersion64: v4.0.30319 FSHARPINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools HTMLHelpDir: C:\Program Files (x86)\HTML Help Workshop INCLUDE: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um is_x64_arch: true LIB: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64 LIBPATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319 NETFXSDKDir: C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\ Path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\DiagnosticsHub\Collector;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\CodeCoverage.Console;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\;C:\PROGRA~1\MongoDB\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.13.1\x64;C:\cabal\bin;C:\\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.3.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.11\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.6\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.392-8\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\Chocolatey\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\1[5](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:5)0\Tools\Binn\;C:\Program Files (x8[6](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:6))\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.[7](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:7)\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x[8](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:8)6)\sbt\bin;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\vcpkg Platform: x64 UCRTVersion: 10.0.22621.0 UniversalCRTSdkDir: C:\Program Files (x86)\Windows Kits\10\ VCIDEInstallDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\ VCINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\ VCPKG_ROOT: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\vcpkg VCToolsInstallDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\ VCToolsRedistDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.38.33130\ VCToolsVersion: 14.37.32822 VisualStudioVersion: 17.0 VS170COMNTOOLS: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\ VSCMD_ARG_app_plat: Desktop VSCMD_ARG_HOST_ARCH: x64 VSCMD_ARG_TGT_ARCH: x64 VSCMD_VER: 17.8.0 VSINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\ VSSDK150INSTALL: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK VSSDKINSTALL: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK WindowsLibPath: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0 WindowsSdkBinPath: C:\Program Files (x86)\Windows Kits\10\bin\ WindowsSdkDir: C:\Program Files (x86)\Windows Kits\10\ WindowsSDKLibVersion: 10.0.22621.0\ WindowsSdkVerBinPath: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\ WindowsSDKVersion: 10.0.22621.0\ WindowsSDK_ExecutablePath_x64: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\ WindowsSDK_ExecutablePath_x86: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\ __DOTNET_ADD_64BIT: 1 __DOTNET_PREFERRED_BITNESS: 64 __VSCMD_PREINIT_PATH: C:\PROGRA~1\MongoDB\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.13.1\x64;C:\cabal\bin;C:\\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.3.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.11\x64\bin;C:\hostedtoolcache\windows\Python\3.[9](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:9).13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.6\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.392-8\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\Chocolatey\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Windows Kits\[10](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:10)\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\[13](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:13)0\DTS\Binn\;C:\Program Files\Microsoft SQL Server\[14](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:14)0\DTS\Binn\;C:\Program Files\Microsoft SQL Server\[15](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:15)0\DTS\Binn\;C:\Program Files\Microsoft SQL Server\[16](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:16)0\DTS\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps GRAALVM_HOME: C:\hostedtoolcache\windows\graalvm-community-jdk-[17](https://github.com/bw-company/henry-local-app/actions/runs/6957015523/job/18929060153?pr=130#step:4:17).0.9_windows-x64_bin\17.0.9\x64\graalvm-community-openjdk-17.0.9+9.1 JAVA_HOME: C:\hostedtoolcache\windows\graalvm-community-jdk-17.0.9_windows-x64_bin\17.0.9\x64\graalvm-community-openjdk-17.0.9+9.1 NATIVE_IMAGE_CONFIG_FILE: C:\Users\RUNNER~1\AppData\Local\Temp\native-image-options.properties ```

My custom-runner:

image
chrjohn commented 11 months ago

For me this warning also occurs on Windows 2022 server. But to me the parameters look correct:

Current runner version: '2.311.0'
Operating System
  Microsoft Windows Server 2022
  10.0.20348
  Datacenter
Runner Image
  Image: windows-2022
  Version: 20231126.1.0
  Included Software: https://github.com/actions/runner-images/blob/win22/20231126.1/images/windows/Windows2022-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20231126.1
Runner Image Provisioner
  2.0.321.1
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v4' (SHA:b4ffde65f46336ab88eb53be808477a3936bae11)
Download action repository 'al-cheb/configure-pagefile-action@v1.3' (SHA:86589fd789a4de3e62ba628dda2cb10027b66d67)
Download action repository 'actions/setup-java@v4' (SHA:387ac29b308b003ca37ba93a6cab5eb57c8f5f93)
Complete job name: Test JDK 8, windows-latest

...

Run al-cheb/configure-pagefile-action@v1.3
  with:
    minimum-size: 8GB
    maximum-size: 16GB
    disk-root: D:
Pagefile configuration:
- Minimum size: 8GB
- Maximum size: 16GB
- Disk root: D:

Error: Exception calling "SetPageFileSize" with "3" argument(s): "The operation completed successfully"
At D:\a\_actions\al-cheb\configure-pagefile-action\v1.3\scripts\SetPageFileSize.ps1:193 char:1
+ [Util.PageFile]::SetPageFileSize($minimumSize, $maximumSize, $diskRoo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : Win32Exception

Any idea?

al-cheb commented 11 months ago

@exoego, @chrjohn, hey. The disk "D:" has only 12 Gb freespace.Could you please set disk-root to "C:" disk?

- name: configure Pagefile
  uses: al-cheb/configure-pagefile-action@v1.3
  with:
    minimum-size: 16GB
    maximum-size: 16GB
    disk-root: "C:"
- name: swap
  run: |
    (Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize

Screenshot from 2023-12-05 20-51-39

chrjohn commented 11 months ago

Could you please set disk-root to "C:" disk?

Thanks for the pointer. Seems to work. 👍

mdedetrich commented 11 months ago

I can also confirms it works on my end (see https://github.com/sbt/sbt-github-actions/pull/177).