Google-chrome --headless --screenshot crashes with the message “Download directory failed to load” on Centos 7

I am trying to get a screenshot from the command line using the new features of Google Chrome 59 (Google Chrome 59.0.3071.86) in the Centos 7 window, and I get an error message that the download directory could not be obtained. I tried to create a directory in my home folder, but did not succeed! Any suggestions?

[ root@vm _1 ~]# google-chrome-stable --headless --disable-gpu --enable-logging -v=5 --screenshot=out.png http://www.google.com [0613/154943.103775:VERBOSE1:zygote_main_linux.cc(626)] ZygoteMain: initializing 0 fork delegates [0613/154943.104006:INFO:cpu_info.cc(50)] Available number of cores: 1 [0613/154943.108816:VERBOSE1:audio_manager_pulse.cc(273)] Failed to connect to the context. Error: Connection refused [0613/154943.108868:WARNING:audio_manager.cc(293)] Multiple instances of AudioManager detected [0613/154943.108875:WARNING:audio_manager.cc(254)] Multiple instances of AudioManager detected [0613/154943.109345:VERBOSE1:webrtc_internals.cc(106)] Could not get the download directory. Trace/breakpoint trap [ root@vm _1 ~]# google-chrome-stable --version [ root@vm _1 ~]# Google Chrome 59.0.3071.86 

Here is my folder structure:

  [ root@vm _1 ~]# ls -la total 56 dr-xr-x---. 12 root root 4096 Jun 13 15:23 . dr-xr-xr-x. 17 root root 4096 Jun 13 13:42 .. -rw-------. 1 root root 1116 Dec 24 2015 anaconda-ks.cfg drwx------. 3 root root 16 Jan 22 10:10 .ansible -rw-------. 1 root root 18800 Jun 13 14:59 .bash_history -rw-r--r--. 1 root root 18 Dec 28 2013 .bash_logout -rw-r--r--. 1 root root 176 Dec 28 2013 .bash_profile -rw-r--r--. 1 root root 176 Dec 28 2013 .bashrc drwx------. 3 root root 16 Oct 24 2016 .cache drwx------. 3 root root 26 Jun 13 2017 .config -rw-r--r--. 1 root root 100 Dec 28 2013 .cshrc drwxr-xr-x. 2 root root 6 Jun 13 2017 download drwxr-xr-x. 2 root root 6 Jun 13 2017 Download drwxr-xr-x. 2 root root 6 Jun 13 2017 downloads drwxr-xr-x. 2 root root 6 Jun 13 2017 Downloads drwxr-xr-x. 3 root root 18 Jun 13 2017 .local drwxr-----. 3 root root 18 Dec 24 2015 .pki drwx------. 2 root root 28 Jan 22 10:09 .ssh -rw-r--r--. 1 root root 129 Dec 28 2013 .tcshrc -rw-r--r-- 1 root root 228 Jun 13 15:23 test.py [ root@vm _1 ~]# 
+5
source share
1 answer

I found the answer to this here: https://bugs.chromium.org/p/chromium/issues/detail?id=695212

The fix is ​​to install the google font package:

 $ sudo yum install gnu-free-sans-fonts 

Then this should work:

 $ google-chrome --headless --disable-gpu --enable-logging -v=10 --screenshot=out.png http://www.chromestatus.com 
+2
source

Source: https://habr.com/ru/post/1268818/


All Articles