RLesur / crrri

A Chrome Remote Interface written in R
https://rlesur.github.io/crrri/
Other
157 stars 12 forks source link

Can't create chromium instance on debian linux 10 #104

Closed lisovyk closed 3 years ago

lisovyk commented 3 years ago

I'm trying to run some scraping with crrri. Had no problem working with it on macOS. Later I installed chromium inside docker container on debian linux 10. Installed chromium with apt-get install chromium

When I run R and try to create new chromium instance, I'm getting this error:

> library(crrri)
> chrome <- Chrome$new(bin = find_chrome_binary())
Running /usr/bin/chromium --no-first-run --headless \
  '--user-data-dir=/root/.local/share/r-crrri/chrome-data-dir-hqbhzgeo' \
  '--remote-debugging-port=9222'
Warning messages:
1: In super$initialize(host = "localhost", debug_port = debug_port,  :
  Cannot access to remote host...
2: In .subset2(public_bind_env, "initialize")(...) : ...closing Chrome.

Please help me figure it out!

lisovyk commented 3 years ago

After further investigation I realised Chromium can't be run as root, and I couldn't figure out how to make it work under root on debian. Instead I installed google-chrome, and run it with '--no-sandbox'. Seems to work like that. If anyone has further comments, please provide them :)