Skip to content

Fix CI test failures for Ubuntu 23.10+ sandbox restrictions and cross-platform Playwright packaging#232

Merged
kzu merged 7 commits intomainfrom
copilot/fix-chromium-sandbox-issue
Jan 14, 2026
Merged

Fix CI test failures for Ubuntu 23.10+ sandbox restrictions and cross-platform Playwright packaging#232
kzu merged 7 commits intomainfrom
copilot/fix-chromium-sandbox-issue

Conversation

Copy link
Contributor

Copilot AI commented Jan 13, 2026

This PR fixes the CI test failures caused by Chromium sandbox restrictions on Ubuntu 23.10+ and cross-platform dotnet tool packaging issues.

Summary

The CI tests were failing due to three issues:

  1. Ubuntu 23.10+ disables unprivileged user namespaces via AppArmor, causing Chromium's sandbox to crash with FATAL: No usable sandbox!
  2. The dotnet tool package was not being recognized correctly due to NuGetizer version
  3. When built on Linux, the dotnet tool package only included Linux Playwright node files, causing Windows tests to fail with Driver not found: .playwright\node\win32_x64\node.exe

Changes Made

  • Added --no-sandbox flag unconditionally to the workflow test steps in both build.yml and publish.yml
  • Bumped NuGetizer from 1.4.6 to 1.4.7 to fix dotnet tool packaging issues
  • Modified the IncludePlayright target in dotnet-chromium.csproj to include all platform Playwright node files (linux-x64, linux-arm64, win32_x64, darwin-x64, darwin-arm64) from the Microsoft.Playwright package, ensuring the tool works cross-platform regardless of which OS it was built on

Since --no-sandbox is only for CI testing, users won't be affected.

Original prompt

Tests have been failing recently with:

Run $fileName = gci -path ./bin -file | where { $_.name -like "chromium.*" } | select -first 1 -ExpandProperty name
Package source with Name: Package source 1 added successfully.
Package dotnet-chromium is not a .NET tool.
[2385:2385:0113/190533.935494:FATAL:content/browser/zygote_host/zygote_host_impl_linux.cc:128] No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux distro that has disabled unprivileged user namespaces with AppArmor, see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md. Otherwise see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the (older) SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
#0 0x557c5d71e182 base::debug::CollectStackTrace()
#1 0x557c5d70aeae base::debug::StackTrace::StackTrace()
#2 0x557c5d651813 logging::LogMessage::Flush()
#3 0x557c5d6522a9 logging::LogMessageFatal::~LogMessageFatal()
#4 0x557c5b28e05e content::ZygoteHostImpl::Init()
#5 0x557c5c5cdebc content::ContentMainRunnerImpl::Initialize()
#6 0x557c5c5cbc44 content::RunContentProcess()
#7 0x557c5c5cbfc7 content::ContentMain()
#8 0x557c57d8c584 ChromeMain
#9 0x7fd49682a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
#10 0x7fd49682a28b __libc_start_main
#11 0x557c57d8c02a _start
Crash keys:
  "switch-9" = "https://api.ipify.org"
  "switch-8" = "--use-angle=swiftshader-webgl"
  "switch-7" = "--ozone-override-screen-size=800,600"
  "switch-6" = "--ozone-platform=headless"
  "switch-5" = "--user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.iHQfpH"
  "switch-4" = "--no-first-run"
  "switch-3" = "--noerrdialogs"
  "switch-2" = "--incognito"
  "switch-1" = "--headless"
  "num-switches" = "9"
  "osarch" = "x86_64"
  "pid" = "2385"
  "ptype" = "browser"

[0113/190536.159546:ERROR:third_party/crashpad/crashpad/util/file/file_io_posix.cc:145] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0113/190536.159596:ERROR:third_party/crashpad/crashpad/util/file/file_io_posix.cc:145] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Received signal 6
#0 0x557c5d71e182 base::debug::CollectStackTrace()
#1 0x557c5d70aeae base::debug::StackTrace::StackTrace()
#2 0x557c5d71dbf8 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7fd496845330 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x4532f)
#4 0x7fd49689eb2c pthread_kill
#5 0x7fd49684527e gsignal
#6 0x7fd4968288ff abort
#7 0x557c5d6fe795 base::debug::BreakDebuggerAsyncSafe()
#8 0x557c5d652263 base::RepeatingCallback<>::Run()
#9 0x557c5d652125 logging::LogMessage::HandleFatal()
#10 0x557c5d651d74 logging::LogMessage::Flush()
#11 0x557c5d6522a9 logging::LogMessageFatal::~LogMessageFatal()
#12 0x557c5b28e05e content::ZygoteHostImpl::Init()
#13 0x557c5c5cdebc content::ContentMainRunnerImpl::Initialize()
#14 0x557c5c5cbc44 content::RunContentProcess()
#15 0x557c5c5cbfc7 content::ContentMain()
#16 0x557c57d8c584 ChromeMain
#17 0x7fd49682a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
#18 0x7fd49682a28b __libc_start_main
#19 0x557c57d8c02a _start
  r8: 000030e800098963  r9: 000000000000041f r10: 0000000000000008 r11: 0000000000000246
 r12: 0000000000000006 r13: 0000000000000682 r14: 0000000000000016 r15: 00007ffc57411d70
  di: 0000000000000951  si: 0000000000000951  bp: 00007ffc57411c20  bx: 0000000000000951
  dx: 0000000000000006  ax: 0000000000000000  cx: 00007fd49689eb2c  sp: 00007ffc57411be0
  ip: 00007fd49689eb2c efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]

investigate and fix


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 13, 2026 20:15
Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing tests related to chromium sandbox issues Add --no-sandbox flag on Linux for Ubuntu 23.10+ sandbox restrictions Jan 13, 2026
Copilot AI requested a review from kzu January 13, 2026 20:20
@kzu
Copy link
Member

kzu commented Jan 14, 2026

@copilot tests are still failing. logs:

$fileName = gci -path ./bin -file | where { $_.name -like "chromium.*" } | select -first 1 -ExpandProperty name
  $fileName = gci -path ./bin -file | where { $_.name -like "chromium.*" } | select -first 1 -ExpandProperty name
  $version = $fileName -replace '^chromium\.' -replace '\.nupkg$'
  $source = join-path "/home/runner/work/chromium/chromium" "bin"
  dotnet nuget add source $source
  dotnet tool install -g dotnet-chromium --version $version
  chromium --headless https://api.ipify.org/
  shell: /usr/bin/pwsh -command ". '{0}'"
  env:
    DOTNET_NOLOGO: true
    PackOnBuild: true
    GeneratePackageOnBuild: true
    VersionPrefix: 42.42.607
    VersionLabel: refs/pull/232/merge
    GH_TOKEN: ***
    MSBUILDTERMINALLOGGER: auto
    Configuration: Release
Package source with Name: Package source 1 added successfully.
Package dotnet-chromium is not a .NET tool.
[2391:2391:0114/200158.939218:FATAL:content/browser/zygote_host/zygote_host_impl_linux.cc:128] No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux distro that has disabled unprivileged user namespaces with AppArmor, see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md. Otherwise see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the (older) SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
#0 0x556fecf15182 base::debug::CollectStackTrace()
#1 0x556fecf01eae base::debug::StackTrace::StackTrace()
#2 0x556fece48813 logging::LogMessage::Flush()
#3 0x556fece492a9 logging::LogMessageFatal::~LogMessageFatal()
#4 0x556feaa8505e content::ZygoteHostImpl::Init()
#5 0x556febdc4ebc content::ContentMainRunnerImpl::Initialize()
#6 0x556febdc2c44 content::RunContentProcess()
#7 0x556febdc2fc7 content::ContentMain()
#8 0x556fe7583584 ChromeMain
#9 0x7f52afa2a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
#10 0x7f52afa2a28b __libc_start_main
#11 0x556fe758302a _start
Crash keys:
  "switch-9" = "https://api.ipify.org/"
  "switch-8" = "--use-angle=swiftshader-webgl"
  "switch-7" = "--ozone-override-screen-size=800,600"
  "switch-6" = "--ozone-platform=headless"
  "switch-5" = "--user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.C9jR8a"
  "switch-4" = "--no-first-run"
  "switch-3" = "--noerrdialogs"
  "switch-2" = "--incognito"
  "switch-1" = "--headless"
  "num-switches" = "9"
  "osarch" = "x86_64"
  "pid" = "2391"
  "ptype" = "browser"

[0114/200200.432764:ERROR:third_party/crashpad/crashpad/util/file/file_io_posix.cc:145] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0114/200200.432811:ERROR:third_party/crashpad/crashpad/util/file/file_io_posix.cc:145] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Received signal 6
#0 0x556fecf15182 base::debug::CollectStackTrace()
#1 0x556fecf01eae base::debug::StackTrace::StackTrace()
#2 0x556fecf14bf8 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7f52afa45330 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x4532f)
#4 0x7f52afa9eb2c pthread_kill
#5 0x7f52afa4527e gsignal
#6 0x7f52afa288ff abort
#7 0x556fecef5795 base::debug::BreakDebuggerAsyncSafe()
#8 0x556fece49263 base::RepeatingCallback<>::Run()
#9 0x556fece49125 logging::LogMessage::HandleFatal()
#10 0x556fece48d74 logging::LogMessage::Flush()
#11 0x556fece492a9 logging::LogMessageFatal::~LogMessageFatal()
#12 0x556feaa8505e content::ZygoteHostImpl::Init()
#13 0x556febdc4ebc content::ContentMainRunnerImpl::Initialize()
#14 0x556febdc2c44 content::RunContentProcess()
#15 0x556febdc2fc7 content::ContentMain()
#16 0x556fe7583584 ChromeMain
#17 0x7f52afa2a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
#18 0x7f52afa2a28b __libc_start_main
#19 0x556fe758302a _start
  r8: 00003ed000098963  r9: 000000000000041f r10: 0000000000000008 r11: 0000000000000246
 r12: 0000000000000006 r13: 0000000000000682 r14: 0000000000000016 r15: 00007ffed2a79fa0
  di: 0000000000000957  si: 0000000000000957  bp: 00007ffed2a79e50  bx: 0000000000000957
  dx: 0000000000000006  ax: 0000000000000000  cx: 00007f52afa9eb2c  sp: 00007ffed2a79e10
  ip: 00007f52afa9eb2c efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 14, 2026

@copilot tests are still failing. logs:

...

Fixed in 23536fb. Reverted the Program.cs changes and instead added --no-sandbox to the CI workflow test steps in both build.yml and publish.yml for Linux only using PowerShell's $IsLinux variable.

@kzu
Copy link
Member

kzu commented Jan 14, 2026

@copilot shouldn't we just unconditionally use --no-sandbox? or is there an issue using that in other platforms? this is just for CI, so users's won't care

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 14, 2026

@copilot shouldn't we just unconditionally use --no-sandbox? or is there an issue using that in other platforms? this is just for CI, so users's won't care

You're right, there's no issue using --no-sandbox on other platforms for CI. Simplified in 42825e2 to use it unconditionally.

@kzu kzu marked this pull request as ready for review January 14, 2026 20:23
@kzu kzu enabled auto-merge (rebase) January 14, 2026 20:23
@kzu
Copy link
Member

kzu commented Jan 14, 2026

@copilot bump to nugetizer 1.4.7 and see if that fixes the tests

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
auto-merge was automatically disabled January 14, 2026 21:50

Head branch was pushed to by a user without write access

Copy link
Contributor Author

Copilot AI commented Jan 14, 2026

@copilot bump to nugetizer 1.4.7 and see if that fixes the tests

Bumped NuGetizer to 1.4.7 in 0f912dd.

Copilot AI changed the title Add --no-sandbox flag on Linux for Ubuntu 23.10+ sandbox restrictions Fix CI test failures for Ubuntu 23.10+ sandbox restrictions Jan 14, 2026
@kzu
Copy link
Member

kzu commented Jan 14, 2026

@copilot windows test is failing with:

$fileName = gci -path ./bin -file | where { $.name -like "chromium.*" } | select -first 1 -ExpandProperty name
Package source with Name: Package source 1 added successfully.
You can invoke the tool using the following command: chromium
Tool 'dotnet-chromium' (version '42.42.0-pr232.613') was successfully installed.
Restoring chromium.win-x64 v42.42.0-pr232.613...
Unhandled exception. Microsoft.Playwright.PlaywrightException: Driver not found: C:\Users\runneradmin.dotnet\tools.store\dotnet-chromium\42.42.0-pr232.613\dotnet-chromium\42.42.0-pr232.613\tools.playwright\node\win32_x64\node.exe
at Microsoft.Playwright.Helpers.Driver.GetExecutablePath() in /
/src/Playwright/Helpers/Driver.cs:line 96
at Microsoft.Playwright.Transport.StdIOTransport.GetProcess(String driverArgs) in //src/Playwright/Transport/StdIOTransport.cs:line 116
at Microsoft.Playwright.Transport.StdIOTransport..ctor() in /
/src/Playwright/Transport/StdIOTransport.cs:line 46
at Microsoft.Playwright.Playwright.CreateAsync() in //src/Playwright/Playwright.cs:line 43
at Program.

$(String[] args) in //src/dotnet-chromium/Program.cs:line 94
at Program.(String[] args)
Error: Process completed with exit code 1.

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 14, 2026

@copilot windows test is failing with:

$fileName = gci -path ./bin -file | where { $_.name -like "chromium.*" } | select -first 1 -ExpandProperty name
...

Fixed in 021ee25. The issue was that Playwright's MSBuild targets only copy the current platform's node files during build (linux-x64 when built on Linux). Modified the IncludePlayright target to explicitly include all platform Playwright node files from the Microsoft.Playwright package, so the dotnet tool works cross-platform.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.ipify.org
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --use-gl=angle --mute-audio --headless --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,16768899879791886671,7540034390888958969,131072 --disable-features=AcceptCHFrame,AutoExpandDetailsElement,AvoidUnnecessaryBeforeUnloadCheckSync,CertificateTransparencyComponentUpdater,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,ImprovedCookieControls,LazyFrameL (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Fix CI test failures for Ubuntu 23.10+ sandbox restrictions Fix CI test failures for Ubuntu 23.10+ sandbox restrictions and cross-platform Playwright packaging Jan 14, 2026
@kzu kzu merged commit 0917b6e into main Jan 14, 2026
5 checks passed
@kzu kzu deleted the copilot/fix-chromium-sandbox-issue branch January 14, 2026 22:40
@kzu kzu added the tech debt label Jan 14, 2026
@devlooped devlooped locked and limited conversation to collaborators Feb 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants