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

Running from Docker #69

Open
sarunask opened this issue Oct 8, 2018 · 2 comments

Comments

@sarunask
Copy link

commented Oct 8, 2018

I have created Docker image base on mode:10-jessie and installed all pre-requisites for Chrome. This should be used to run in Concourse CI.

Now when I run:

/node_modules/.bin/pa11y-ci --json

I get:

(node:3142) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
[1008/134337.709535:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/node_modules/puppeteer/lib/Launcher.js:339:14)
    at Interface.helper.addEventListener (/node_modules/puppeteer/lib/Launcher.js:328:50)
    at Interface.emit (events.js:187:15)
    at Interface.close (readline.js:379:8)
    at Socket.onend (readline.js:157:10)
    at Socket.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:3142) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3142) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

If I run with unprivileged node user:

su -l node -c "/node_modules/.bin/pa11y-ci --json"

I get this output:

(node:3156) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
[1008/134509.521725:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chro
mium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developi
ng with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-
sandbox.
#0 0x55eb1afcecac base::debug::StackTrace::StackTrace()
#1 0x55eb1af48670 logging::LogMessage::~LogMessage()
#2 0x55eb1c44c050 service_manager::ZygoteHostImpl::Init()
#3 0x55eb1ac11d7e content::ContentMainRunnerImpl::Initialize()
#4 0x55eb1ac453e8 service_manager::Main()
#5 0x55eb1ac105c1 content::ContentMain()
#6 0x55eb1f0e9ae8 headless::(anonymous namespace)::RunContentMain()
#7 0x55eb1f0e9b78 headless::HeadlessBrowserMain()
#8 0x55eb1ac429db headless::HeadlessShellMain()
#9 0x55eb18f501ac ChromeMain
#10 0x7f2a1bc69b45 __libc_start_main
#11 0x55eb18f5002a _start

Received signal 6                                                                                         [15/7885]
#0 0x55eb1afcecac base::debug::StackTrace::StackTrace()
#1 0x55eb1afce821 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x7f2a21d1b890 <unknown>
#3 0x7f2a1bc7d067 gsignal
#4 0x7f2a1bc7e448 abort
#5 0x55eb1afcd645 base::debug::BreakDebugger()
#6 0x55eb1af48ae8 logging::LogMessage::~LogMessage()
#7 0x55eb1c44c050 service_manager::ZygoteHostImpl::Init()
#8 0x55eb1ac11d7e content::ContentMainRunnerImpl::Initialize()
#9 0x55eb1ac453e8 service_manager::Main()
#10 0x55eb1ac105c1 content::ContentMain()
#11 0x55eb1f0e9ae8 headless::(anonymous namespace)::RunContentMain()
#12 0x55eb1f0e9b78 headless::HeadlessBrowserMain()
#13 0x55eb1ac429db headless::HeadlessShellMain()
#14 0x55eb18f501ac ChromeMain
#15 0x7f2a1bc69b45 __libc_start_main
#16 0x55eb18f5002a _start
  r8: 00007f2a2231ca00  r9: 00001b0a2297a000 r10: 0000000000000008 r11: 0000000000000202
 r12: 00007fffc0c061c8 r13: 0000000000000161 r14: 00007fffc0c061d0 r15: 00007fffc0c061d8
  di: 0000000000000c61  si: 0000000000000c61  bp: 00007fffc0c05bf0  bx: 00007fffc0c05c50
  dx: 0000000000000006  ax: 0000000000000000  cx: 00007f2a1bc7d067  sp: 00007fffc0c05ab8
  ip: 00007f2a1bc7d067 efl: 0000000000000202 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/node_modules/puppeteer/lib/Launcher.js:339:14)
    at Interface.helper.addEventListener (/node_modules/puppeteer/lib/Launcher.js:328:50)
    at Interface.emit (events.js:187:15)
    at Interface.close (readline.js:379:8)
    at Socket.onend (readline.js:157:10)
    at Socket.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:3156) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3156) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@hristo-tanev

This comment has been minimized.

Copy link

commented Oct 17, 2018

In your pa11y config file you need to have something of the sort:

"chromeLaunchConfig": {
      "args": ["--no-sandbox"]
}

After that if you run it again it should work. If it doesn't then check if you do have chrome installed in your docker container. If not do it and add the config above. Hope this helps :)!

@mikkeschiren

This comment has been minimized.

Copy link

commented Nov 14, 2018

I created https://hub.docker.com/r/digitalist/pa11y-ci/ - with some examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.