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

Closed
sarunask opened this issue Oct 8, 2018 · 7 comments
Closed

Running from Docker #69

sarunask opened this issue Oct 8, 2018 · 7 comments

Comments

@sarunask
Copy link

sarunask 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
Copy link

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
Copy link

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

@lhridley
Copy link

Unfortunately this fails for version 2.0.0+

@ptmkenny
Copy link

ptmkenny commented Dec 6, 2020

@lhridley As described in @mikkeschiren's link, I was able to get it working in 2.x with this in my .pa11yci:

{
	"defaults": {
		"chromeLaunchConfig": {
			"args": ["--no-sandbox"]
		},
		"timeout": 10000
	},
	"urls": [
		"http://example.com"
	]
}

@josebolos
Copy link
Member

Thanks for creating this issue. It looks like this may be fixed now, feel free to reopen the issue if not.

@smustgrave
Copy link

This is still failing for with pa11y-ci version 2.4.1
And I have
"chromeLaunchConfig": {
"args": ["--no-sandbox"]
},

in my config file

@josebolos
Copy link
Member

Hi @smustgrave

Is this a problem with docker or with pa11y-ci?

We don't offer any official docker images. If it's a problem with pa11y-ci could you please include the necessary steps to reproduce the problem, so we can try to have a look at it?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants