rstudio / chromote

Chrome Remote Interface for R
https://rstudio.github.io/chromote/
156 stars 20 forks source link

The platform failed to initialize. Exiting. #143

Open Patrikios opened 9 months ago

Patrikios commented 9 months ago

If I try to run the command

library(chromote)
b <- ChromoteSession$new()
b$view()

the code exists with:

> library(chromote)
> b <- ChromoteSession$new()
Error in `startup()`:
! Chrome debugging port not open after 10 seconds.
Run `rlang::last_trace()` to see where the error occurred.
> rlang::last_trace()
<error/error_stop_port_search>
Error in `startup()`:
! Chrome debugging port not open after 10 seconds.
---
Backtrace:
     ▆
  1. └─ChromoteSession$new()
  2.   └─chromote (local) initialize(...)
  3.     └─chromote::default_chromote_object()
  4.       ├─chromote::set_default_chromote_object(Chromote$new())
  5.       └─Chromote$new()
  6.         └─chromote (local) initialize(...)
  7.           └─Chrome$new()
  8.             └─chromote (local) initialize(...)
  9.               └─chromote:::launch_chrome(path, args)
 10.                 └─chromote:::with_random_port(...)
 11.                   ├─base::tryCatch(...)
 12.                   │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 13.                   │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 14.                   │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 15.                   └─chromote (local) startup(port = port, ...)
Run rlang::last_trace(drop = FALSE) to see 1 hidden frame.

If I do:

library(chromote)
Sys.unsetenv("HTTP_PROXY")
Sys.unsetenv("http_proxy")
b <- ChromoteSession$new()
b$view()

The error is:

[14298:14298:0209/154520.332445:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
[14298:14298:0209/154520.332485:ERROR:env.cc(257)] The platform failed to initialize.  Exiting.

System: R version 4.3.2 (2023-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 10 (buster)

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

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

time zone: Europe/Berlin tzcode source: system (glibc)

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

other attached packages: [1] chromote_0.1.2

loaded via a namespace (and not attached): [1] websocket_1.4.1 processx_3.8.3 compiler_4.3.2 fastmap_1.1.1 magrittr_2.0.3 R6_2.5.1 cli_3.6.2 promises_1.2.1 later_1.3.2
[10] tools_4.3.2 rstudioapi_0.15.0 crayon_1.5.2 Rcpp_1.0.12 jsonlite_1.8.8 ps_1.7.5 rlang_1.1.3