12

To run chrome in headless mode, I did

alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"

chrome --remote-debugging-port=9222 --disable-gpu --headless

in console, But, I got this error,

[0305/140111.481537:ERROR:xattr.cc(64)] setxattr org.chromium.crashpad.database.initialized on file /var/folders/m3/92mmh21n0cx4ppf8c3bcns38hd4_kk/T/: Operation not permitted (1) [0305/140111.484254:ERROR:xattr.cc(64)] setxattr org.chromium.crashpad.database.initialized on file /var/folders/m3/92mmh21n0cx4ppf8c3bcns38hd4_kk/T/: Operation not permitted (1) [0305/140111.484254:INFO:crashpad_client_mac.cc(292)] restarting handler in 0.983s [0305/140111.513641:ERROR:gpu_process_transport_factory.cc(1009)] Lost UI shared context. [0305/140111.513709:ERROR:instance.cc(49)] Unable to locate service manifest for metrics [0305/140111.513733:ERROR:service_manager.cc(890)] Failed to resolve service name: metrics [0305/140111.514229:ERROR:socket_posix.cc(142)] bind() returned an error, errno=48: Address already in use (48)

DevTools listening on ws://[::1]:9222/devtools/browser/c46563ca-1891-48bd-bdd6-e6122f3f3b5d [0305/140112.484141:ERROR:xattr.cc(64)] setxattr org.chromium.crashpad.database.initialized on file /var/folders/m3/92mmh21n0cx4ppf8c3bcns38hd4_kk/T/: Operation not permitted (1) [0305/140112.484641:INFO:crashpad_client_mac.cc(292)] restarting handler in 0.985s [0305/140113.489618:ERROR:xattr.cc(64)] setxattr org.chromium.crashpad.database.initialized on file /var/folders/m3/92mmh21n0cx4ppf8c3bcns38hd4_kk/T/: Operation not permitted (1) [0305/140113.490274:INFO:crashpad_client_mac.cc(292)] restarting handler in 0.979s [0305/140114.484881:ERROR:xattr.cc(64)] setxattr org.chromium.crashpad.database.initialized on file /var/folders/m3/92mmh21n0cx4ppf8c3bcns38hd4_kk/T/: Operation not permitted (1) [0305/140114.485349:INFO:crashpad_client_mac.cc(292)] restarting handler in 0.985s [0305/140115.489188:ERROR:xattr.cc(64)] setxattr org.chromium.crashpad.database.initialized on file /var/folders/m3/92mmh21n0cx4ppf8c3bcns38hd4_kk/T/: Operation not permitted (1) [0305/140115.489638:INFO:crashpad_client_mac.cc(292)] restarting handler in 0.985s

I also tried,

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --disable-gpu --headless

but I got same error.

Is there any solution for this?

3 Answers 3

34

I got the answer from Chrome crashpad crashes on xattr

Just provide a different directory for "crash dumps" when starting Chrome, like this:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --disable-gpu --headless --crash-dumps-dir=/tmp 
Sign up to request clarification or add additional context in comments.

1 Comment

For clarity, solved with this extra flag: --crash-dumps-dir=/tmp
4

add the following command flags

--disk-cache-dir=/tmp --user-data-dir=/tmp --crash-dumps-dir=/tmp 

eg.

chrome --headless --disable-gpu --screenshot --disk-cache-dir=/tmp --user-data-dir=/tmp --crash-dumps-dir=/tmp http://m.baidu.com 

For more command-line flags, see here

2 Comments

Or disable crash logging altogether? Using --disable-crash-reporter (found via your link)
I prefer the --disable-crash-reporter way since I don't need crash report in headless mode.
-6

UPDATE 3/6
I checked the solution on my own MacBook and it worked.


I encounter the same issue today, and after searching some document, I suspect it's due to the SIP(System Integrity Protection) feature in MacOS, with that restrict, you can't modify the files under /var folder even you have the root privilege.

So here is the way to disable that feature:

  1. Turn off your Mac (Apple > Shut Down).
  2. Hold down Command-R and press the Power button. Keep holding Command-R until the Apple logo appears.
  3. Wait for OS X to boot into the OS X Utilities window.
  4. Choose Utilities > Terminal.
  5. Enter csrutil disable.
  6. Enter reboot.

3 Comments

You really should not be disabling System Integrity, this is a significant security risk and will cause you some serious problems in the future.
Very bad idea.
Savagry! Be sure and NOT do this if you are on a work computer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.