Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get chromote working? #892

Open
courtiol opened this issue Dec 23, 2024 · 0 comments
Open

How to get chromote working? #892

courtiol opened this issue Dec 23, 2024 · 0 comments
Labels

Comments

@courtiol
Copy link

Container image name

rocker/geospatial

Container image digest

No response

What operating system related to this question?

Linux

System information

podman version 5.2.5, Fedora release 41 (Forty One), kernel 6.11.7-300.fc41.x86_64

Question

I am trying to have the R package chromote working within a container that also include the spatial packages (I did not try to do that in a more simple container but I guess the issue would be the same).

[XX@XX]$ podman pull rocker/geospatial
[XX@XX]$ podman run -ti rocker/geospatial bash                                                                                                                                                                                                
root@5a68e75a1731:/# apt -y update 
root@5a68e75a1731:/# apt install -y chromium-browser                                                                                                                        
root@5a68e75a1731:/# R
> install.packages("chromote")                                                                                                 
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘AsioHeaders’, ‘websocket’

trying URL 'https://p3m.dev/cran/__linux__/noble/latest/src/contrib/AsioHeaders_1.22.1-2.tar.gz'
Content type 'binary/octet-stream' length 649323 bytes (634 KB) 
==================================================
downloaded 634 KB

trying URL 'https://p3m.dev/cran/__linux__/noble/latest/src/contrib/websocket_1.4.2.tar.gz'
Content type 'binary/octet-stream' length 468359 bytes (457 KB) 
==================================================
downloaded 457 KB

trying URL 'https://p3m.dev/cran/__linux__/noble/latest/src/contrib/chromote_0.3.1.tar.gz'
Content type 'binary/octet-stream' length 391789 bytes (382 KB) 
==================================================
downloaded 382 KB

* installing *binary* package ‘AsioHeaders’ ...
* DONE (AsioHeaders)
* installing *binary* package ‘websocket’ ...
* DONE (websocket)
* installing *binary* package ‘chromote’ ...
* DONE (chromote)

The downloaded source packages are in
        ‘/tmp/RtmpCwBzky/downloaded_packages’

As you can see, the R package chromote does seem to install fine within rocker/geospatial, but the package does not work once loaded:

> chromote::ChromoteSession$new()
Error in `with_random_port()`:
! Cannot find an available port. Please try again.
Caused by error in `startup()`:
! Failed to start chrome. Error:

Command '/usr/bin/chromium-browser' requires the chromium snap to be installed.
Please install it with:

snap install chromium
Run `rlang::last_trace()` to see where the error occurred.

> sessionInfo()
R version 4.4.2 (2024-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3  
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] websocket_1.4.2 processx_3.8.4  compiler_4.4.2  fastmap_1.2.0  
 [5] magrittr_2.0.3  R6_2.5.1        cli_3.6.3       promises_1.3.2 
 [9] later_1.4.1     tools_4.4.2     Rcpp_1.0.13-1   chromote_0.3.1 
[13] jsonlite_1.8.9  ps_1.8.1        rlang_1.1.4

I did try to use snap but it would not install:

**root@5a68e75a1731:/# snap install chromium
error: cannot communicate with server: Post "http://localhost/v2/snaps/chromium": dial unix /run/snapd.socket: connect: no such file or directory
**

I also tried installing chrome:

[XX@XX]$ podman run -ti rocker/geospatial bash                                                                                                                                                                                                
root@4d28f26b22b2:/# apt -y update 
root@4d28f26b22b2:/# cd home
root@4d28f26b22b2:/home# wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
root@4d28f26b22b2:/home# apt install -y ./google-chrome-stable_current_amd64.deb     

This time I get the following error message in R:

> install.packages("chromote")
Installing package into/usr/local/lib/R/site-library’
(aslibis unspecified)
also installing the dependenciesAsioHeaders’, ‘websockettrying URL 'https://p3m.dev/cran/__linux__/noble/latest/src/contrib/AsioHeaders_1.22.1-2.tar.gz'
Content type 'binary/octet-stream' length 649323 bytes (634 KB)
==================================================
downloaded 634 KB

trying URL 'https://p3m.dev/cran/__linux__/noble/latest/src/contrib/websocket_1.4.2.tar.gz'
Content type 'binary/octet-stream' length 468359 bytes (457 KB)
==================================================
downloaded 457 KB

trying URL 'https://p3m.dev/cran/__linux__/noble/latest/src/contrib/chromote_0.3.1.tar.gz'
Content type 'binary/octet-stream' length 391789 bytes (382 KB)
==================================================
downloaded 382 KB

* installing *binary* packageAsioHeaders...
* DONE (AsioHeaders)
* installing *binary* packagewebsocket...
* DONE (websocket)
* installing *binary* packagechromote...
* DONE (chromote)

The downloaded source packages are in/tmp/Rtmp3MUOSz/downloaded_packages> chromote::ChromoteSession$new()
Error in `with_random_port()`:
! Cannot find an available port. Please try again.
Caused by error in `startup()`:
! Failed to start chrome. Error:
Old Headless mode will be removed from the Chrome binary soon. Please use the new Headless mode (https://developer.chrome.com/docs/chromium/new-headless) or the chrome-headless-shell which is a standalone implementation of the old Headless mode (https://developer.chrome.com/blog/chrome-headless-shell).

[1223/104524.696601:ERROR:zygote_host_impl_linux.cc(101)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Run `rlang::last_trace()` to see where the error occurred.

I tried to install headless chrome but did not go very far on that path either...
Please let me know if that should be an issue for chromote instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant