Skip to content
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

Browser crashes when inside docker container with virtual display #15995

Open
engineering-this opened this issue May 20, 2021 · 2 comments
Open
Labels
needs-more-info The report requires more detail before we can decide what to do with this issue. OS/Desktop

Comments

@engineering-this
Copy link

Description

For testing purposes we are running various browsers in docker containers with X Virtual Frame Buffer, headless mode is no go for us. Things got broke in one of recent versions. I assume it's related to adblock-rust. Browser crashes when trying to open any page. Error message appears in console, see Actual result below for details.

Steps to Reproduce

Please note, steps are valid for Ubuntu with docker installed.

  1. Create file Dockerfile:
FROM ubuntu:20.04

ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#essenetials
RUN \
  sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
  apt-get update && \
  apt-get -y upgrade && \
  apt-get install -y apt-transport-https curl gnupg xvfb iptables iproute2 wget && \
  curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add - && \
  echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" >> /etc/apt/sources.list.d/brave-browser-release.list && \
  wget "https://github.com/brave/brave-browser/releases/download/v1.24.85/brave-browser_1.24.85_amd64.deb" && \
  apt-get update -qqy && \
  apt-get -qqy install "./brave-browser_1.24.85_amd64.deb" && \
  rm -rf /var/lib/apt/lists/*

COPY entrypoint.sh .

ENV DBUS_SESSION_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket
EXPOSE 9222

ENTRYPOINT ["./entrypoint.sh"]
  1. Create file entrypoint.sh:
#!/bin/bash

set -x
set -e
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 9222 -j DNAT --to 127.0.0.1:9223
iptables -A POSTROUTING -t nat -p tcp --dport 9223 -j SNAT --to-source 127.0.0.1
sysctl -w net.ipv4.conf.all.route_localnet=1

RESOLUTION="${SCREEN_WIDTH:=1200}"x"${SCREEN_HEIGHT:=1024}"x24
xvfb-run --server-args="-screen 0 $RESOLUTION" brave-browser --disable-dev-shm-usage --no-sandbox --remote-debugging-port=9223
  1. Run command
docker run --privileged -p 9222/tcp -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket brave
  1. On host machine run chromium based browser, can be brave.
  2. Navigate to chrome://inspect#devices.
  3. Add network target 172.17.0.2:9222.
  4. Open google.com on target browser.
    Screenshot from 2021-05-20 10-35-50-1
  5. Check terminal with docker for logs.

Actual result:

thread '' panicked at 'An external domain resolver must be set when the embedded-domain-resolver feature is disabled.', /home/ubuntu/workspace/brave-browser-build-linux-release/src/out/Release/../../brave/build/rustup/0.1.6/git/checkouts/adblock-rust-eabda1d88a9f8023/732994b/src/url_parser/mod.rs:102:49
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
/usr/bin/brave-browser: line 48: 42 Aborted (core dumped) "$HERE/brave" "$@"

Expected result:

Browser works

Reproduces how often:

Every time.

Brave version (brave://version info)

Brave Software Inc
Copyright © 2021 The Brave Authors. All rights reserved.
Brave 1.24.85 Chromium: 90.0.4430.212 (Official Build) (64-bit)
Revision e3cd97fc771b893b7fd1879196d1215b622c2bed-refs/branch-heads/4430@{#1429}
OS Linux
JavaScript V8 9.0.257.29
User Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
Command Line /opt/brave.com/brave/brave --disable-dev-shm-usage --no-sandbox --remote-debugging-port=9223 --enable-dom-distiller --disable-domain-reliability --no-pings --extension-content-verification=enforce_strict --extensions-install-verification=enforce --origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=,fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU= --sync-url=https://sync-v2.brave.com/v2 --lso-url=https://no-thanks.invalid --variations-server-url=https://variations.brave.com/seed --enable-features=WebUIDarkMode,LegacyTLSEnforced,DnsOverHttps,SafetyTip,AutoupgradeMixedContent,PrefetchPrivacyChanges,PasswordImport,ReducedReferrerGranularity --disable-features=AutofillServerCommunication,TabHoverCards,TextFragmentAnchor,SubresourceWebBundles,SignedExchangePrefetchCacheForNavigations,AutofillEnableAccountWalletStorage,LangClientHintHeader,NetworkTimeServiceQuerying,WebOTP,NotificationTriggers,EnableProfilePickerOnStartup,DirectSockets,SharingQRCodeGenerator,SignedExchangeSubresourcePrefetch,SafeBrowsingEnhancedProtection,IdleDetection,SafeBrowsingEnhancedProtectionMessageInInterstitials --flag-switches-begin --flag-switches-end
Executable Path /opt/brave.com/brave/brave
Profile Path /root/.config/BraveSoftware/Brave-Browser/Default

Version/Channel Information:

  • Can you reproduce this issue with the current release?
    Yes
  • Can you reproduce this issue with the beta channel?
    Yes
  • Can you reproduce this issue with the nightly channel?
    Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
    No
  • Does the issue resolve itself when disabling Brave Rewards?
    No
  • Is the issue reproducible on the latest version of Chrome?
    Yes

Miscellaneous Information:

This works for us on older version 1.20.110, I'm not sure if it's the last working version.

I've investigated other approaches.

  • Run xvfb process inside docker container to create virtual display instead of xvfb-run -> same crash error 👎
  • Run xserver-xorg-video-dummy inside docker container to create virutal display -> same crash error 👎
  • Run brave with --headless flag -> browser works 👍, but this is not solution we can accept for our testing purposes.
  • Run docker with DISPLAY flag, passing actual display from host into docker -> browser works 👍, but we can't use it on our CI machine.
  • Run xvfb to create virtual display on host machine instead of docker container and pass it to docker via DISPLAY flag as above -> browser crashes with same error 👎

I know this is not the most obvious use case, but I can't imagine how virtual display could possibly affect domain resolver in adblock-rust component.

@rebron
Copy link
Collaborator

rebron commented Aug 26, 2021

@engineering-this Are you still encountering this issue with our latest 1.28.106 version.

@rebron rebron added the needs-more-info The report requires more detail before we can decide what to do with this issue. label Aug 26, 2021
@engineering-this
Copy link
Author

Tested with 1.28.106 version, it still produces same error:

thread '<unnamed>' panicked at 'An external domain resolver must be set when the `embedded-domain-resolver` feature is disabled.', /home/ubuntu/workspace/brave-browser-build-linux-release/src/out/Release/../../brave/build/rustup/0.1.7/registry/src/github.com-1ecc6299db9ec823/adblock-0.3.15/src/url_parser/mod.rs:105:49
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
/usr/bin/brave-browser: line 48:    43 Aborted                 (core dumped) "$HERE/brave" "$@"

Brave version (brave://version info)

Brave Software Inc
Copyright © 2021 The Brave Authors. All rights reserved.
Brave 1.28.106 Chromium: 92.0.4515.159 (Official Build) (64-bit)
Revision 0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52-refs/branch-heads/4515@{#2052}
OS Linux
JavaScript V8 9.2.230.29
User Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Command Line /opt/brave.com/brave/brave --disable-dev-shm-usage --no-sandbox --remote-debugging-port=9223 --enable-crashpad --enable-dom-distiller --disable-domain-reliability --no-pings --origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=,fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU= --sync-url=https://sync-v2.brave.com/v2 --lso-url=https://no-thanks.invalid --variations-server-url=https://variations.brave.com/seed --enable-features=WebUIDarkMode,SafetyTip,AutoupgradeMixedContent,PrefetchPrivacyChanges,PasswordImport,ReducedReferrerGranularity,LegacyTLSEnforced,DnsOverHttps --disable-features=FledgeInterestGroups,HandwritingRecognitionWebPlatformApi,FlocIdComputedEventLogging,HandwritingRecognitionWebPlatformApiFinch,InterestCohortFeaturePolicy,TrustTokens,DirectSockets,IdleDetection,AutofillEnableAccountWalletStorage,FledgeInterestGroupAPI,NetworkTimeServiceQuerying,SubresourceWebBundles,SignedExchangePrefetchCacheForNavigations,InterestCohortAPIOriginTrial,FirstPartySets,NotificationTriggers,WebOTP,PrivacySandboxSettings,FederatedLearningOfCohorts,AutofillServerCommunication,LiveCaption,LangClientHintHeader,SignedExchangeSubresourcePrefetch,EnablePasswordsAccountStorage,TextFragmentAnchor,EnableProfilePickerOnStartup --flag-switches-begin --flag-switches-end
Executable Path /opt/brave.com/brave/brave
Profile Path /root/.config/BraveSoftware/Brave-Browser/Default

@rebron rebron added this to General May 28, 2024
@rebron rebron moved this to Needs Info in General May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-more-info The report requires more detail before we can decide what to do with this issue. OS/Desktop
Projects
Status: Needs Info
Development

No branches or pull requests

2 participants