The browser appears to have exited before we could connect. The output was: mkdir: cannot create directory

StackOverflow https://stackoverflow.com/questions/17583362

문제

I had a python script running successfully. The .py script would open a headless browser(pyvirtualdisplay & xvfb) and perform a task and then close the browser. I had an issue with xvfb processes being left open after the script is run. After its run many times they would tend to accumulate. Periodically I would run a killall command through ssh shell to kill the stagnant xvfb processes. This didn't seem to cause any problems. Recently I attempted to automate the task by setting up a cron job that executed the following command.
ps -eo pid,etime,comm | egrep '^ *[0-9]+ +([0-9]+-[^ ]*|[0-9]{2}:[0-9]{2}:[0-9]{2})' | grep Xvfb | awk '{print $1}' | xargs kill -9
This command would kill only old Xvfb processes. I assumed 2 hours old? Since I have run this command I have not been able to run the .py script and I receive the following error:

<class 'selenium.common.exceptions.WebDriverException'>: Message: "The browser appears to have exited before we could connect. The output was: mkdir: cannot create directory `/.mozilla': Permission denied\nError: cannot open display: :9866\n" [83] => 
      args = [84] => () [85] => 
      message = [86] => '' [87] => 
      msg = [88] => 'The browser appears to have exited before we cou...mission denied\nError: cannot open display: :9866\n' [89] => 
      screen = [90] => None [91] => 
      stacktrace = [92] => None [93] => [94] => [95] => [113] => ) 
도움이 되었습니까?

해결책

Cleared the Linux cache with the following two commands to resolve the issue:
Entered through putty ssh shell.
/usr/sbin/tmpwatch 1 /tmp
and
/usr/sbin/tmpwatch 1 /var/tmp

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top