When trying to run Headless Chrome on both mac and linux, it fails with the following error
Chrome --headless --disable-gpu https://www.yahoo.com
[0505/072239.922334:ERROR:browser_process_sub_thread.cc(217)] Waited 5 ms for network service
I'm testing with version Google Chrome 74.0.3729.131
asked May 5, 2019 at 14:25
Anshul Kai
4,1484 gold badges33 silver badges55 bronze badges
-
1yeah i'm having the same issue but if i add a URL like you did i get Segmentation fault <p> google-chrome --headless google.com <p> [0510/173839.408209:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer. [0510/173839.408083:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1 [0510/173839.648167:ERROR:command_buffer_proxy_impl.cc(106)] ContextResult::kTransientFailure: Shared memory region is not valid <p> Segmentation faultimp– imp2019年05月10日 13:58:56 +00:00Commented May 10, 2019 at 13:58
-
i've tried a myriad of things to get this to work myself, have you gotten it to work?imp– imp2019年05月10日 13:59:39 +00:00Commented May 10, 2019 at 13:59
-
Not really an answer. Had same problem, spent days. Some say downgrading chrome helps, but not for me. Ended up using Puppeteer: github.com/GoogleChrome/puppeteerRimski– Rimski2019年05月14日 15:53:29 +00:00Commented May 14, 2019 at 15:53
-
I get the exact same error as @MistaWizard using cef 79.1.26 chromium embedded framework on ubuntu 19.04; it loads a webpage but none of the callbacks are called; I had this working 3 years ago on ubuntu 16.04 with the cef from then, but now that setup doesn't compile unless I create symlinks, such as /usr/include/gtk pointing to /usr/include/gtk-2.0/gtk and edit system includes; and once it compiled on 19.04, then it gets the above errorjmarina– jmarina2020年01月15日 16:05:44 +00:00Commented Jan 15, 2020 at 16:05
1 Answer 1
Try adding some of the following options:
chromeOptions.addArguments("--headless")
chromeOptions.addArguments("--no-sandbox")
chromeOptions.addArguments("--disable-dev-shm-usage")
chromeOptions.addArguments("--disable-gpu")
chromeOptions.addArguments("--disable-features=NetworkService") ##this did it for me
chromeOptions.addArguments("--window-size=1920x1080")
chromeOptions.addArguments("--disable-features=VizDisplayCompositor")
Sign up to request clarification or add additional context in comments.
2 Comments
KyleMit
Specifically,
--disable-gpu did it for me, but others might be helpful as wellimp
The largest list of (hopefully updated) arguments I can find is here: peter.sh/experiments/chromium-command-line-switches Its exhaustive :)
Explore related questions
See similar questions with these tags.