diff --git a/NEWS.md b/NEWS.md index a891565..ce2e840 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +## Version 0.13.5 [2023-05-06] + +### Bug Fixes + + * Shorten the path lengths of the RStudio Server `server-data-dir` and + database `directory` folders by 17 characters. + + ## Version 0.13.4 [2023-04-17] ### New Features diff --git a/README.md b/README.md index 07c7c64..577cb32 100644 --- a/README.md +++ b/README.md @@ -333,12 +333,12 @@ As before, the RStudio Server is available at ```sh $ cd /path/to/software -$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.13.4.tar.gz -$ tar xf 0.13.4.tar.gz -$ PATH=/path/to/softwarerstudio-server-controller-0.13.4/bin:$PATH +$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.13.5.tar.gz +$ tar xf 0.13.5.tar.gz +$ PATH=/path/to/softwarerstudio-server-controller-0.13.5/bin:$PATH $ export PATH $ rsc --version -0.13.4 +0.13.5 ``` To verify that the tool can find R and the RStudio Server executables, @@ -346,7 +346,7 @@ call: ```sh $ rsc --version --full -rsc: 0.13.4 +rsc: 0.13.5 RStudio Server: 2023.03.0+386 (Cherry Blossom) for Linux [/path/to/rstudio-server/bin/rstudio-server] R: 4.2.3 (2023-03-15) -- "Shortstop Beagle" [/path/to/R/bin/R] ``` diff --git a/bin/rsc b/bin/rsc index a926070..682f2cc 100755 --- a/bin/rsc +++ b/bin/rsc @@ -63,7 +63,7 @@ ### rsc config --full ### rsc log ### -### Version: 0.13.4 +### Version: 0.13.5 ### Copyright: Henrik Bengtsson (2022-2023) and Harry Putnam (2022) ### License: ISC @@ -95,26 +95,31 @@ source "${incl}/system.sh" # ========================================================================= # Utility functions # ========================================================================= -## If the length of '$HOME/.config' is 40 characters or more, we get an -## 'ERROR Unexpected exception: File name too long [system:36]; LOGGED +## If the length of the default +## '$server_data_dir/rstudio-rserver/session-server-rpc.socket', where +## server_data_="$HOME/.config/rsc/run/a", is 108 symbols or more, we get +## an 'ERROR Unexpected exception: File name too long [system:36]; LOGGED ## FROM: int main(int, char* const*) src/cpp/server/ServerMain.cpp:941'. ## This errors occurs in ## ## when serverRpcSocketPath() returns a FilePath with an absolute path -## longer than 108 characters, e.g. /a/very/long/path/to/home/alice/.config/rsc/var/run/rstudio-server/rstudio-rserver/session-server-rpc.socket +## longer than 107 characters. Thus, if '$server_data_dir' has more than +## 65 characters, we hit this bug. Using the default, this means that +## user with a $HOME folder with more than 47 characters will be affected +## by this bug. ## /HB 2023-04-17 -post_mortem_too_long_config_dir() { +post_mortem_too_long_server_data_dir() { local path - path=$(config_dir) - if [[ ${#path} -ge 40 ]]; then - echo "Post-mortem analysis: The RStudio Server Controller configuration folder ($path) has ${#path} characters. A configuration folder with more than 40 characters will likely not work with RStudio Server version after 2022.02.4-500. Here we are using version $(rserver_version). Try setting 'export _RSC_RSERVER_DATA_DIR_=\"\$(mktemp -d)\"' before calling 'rsc start' as a workaround." + path=$(rserver_data_dir) + if [[ ${#path} -ge 66 ]]; then + echo "Post-mortem analysis: The RStudio Server 'server-data-dir' folder ($path) has ${#path} characters, which is more than 65 and will therefore not work with RStudio Server version after 2022.02.4-500. Try setting 'export _RSC_RSERVER_DATA_DIR_=\"\$(mktemp -d)\"' before calling 'rsc start' as a workaround." fi } function rsc_error { local msg extra msg="$* This happened with rsc $(version), RStudio Server $(rserver_version_string) [$(rserver_path)], and R $(r_version_string) [$(r_path)]." - extra=$(post_mortem_too_long_config_dir) + extra=$(post_mortem_too_long_server_data_dir) if [[ -n ${extra} ]]; then msg="${msg} ${extra}" fi @@ -227,7 +232,7 @@ function make_config_dir { local datadir path=$(config_dir) - mkdir -p "${path}"/{run,tmp,var/lib/rstudio-server} + mkdir -p "${path}"/{lib,run,tmp} secure_dir "${path}" datadir=$(rserver_data_dir) @@ -372,7 +377,8 @@ function make_database_conf { assert_dir_exists "${workdir}" { echo "provider=sqlite" - echo "directory=${workdir}/var/lib/rstudio-server" + ## Default: /var/lib/rstudio-server + echo "directory=${workdir}/lib" } > "${workdir}/database.conf" } @@ -870,7 +876,8 @@ function rserver_data_dir { if [[ -z ${_RSC_RSERVER_DATA_DIR_} ]]; then workdir=$(config_dir) - path="${workdir}/var/run/rstudio-server" + ## Default: /var/run/rstudio-server + path="${workdir}/run" else mdebug "_RSC_RSERVER_DATA_DIR_=${_RSC_RSERVER_DATA_DIR_}" path=${_RSC_RSERVER_DATA_DIR_:?} @@ -878,7 +885,7 @@ function rserver_data_dir { ## WORKAROUND: This is needed to so that ## secure_dir "$(dirname "$(rserver_data_dir)")" ## is guaranteed to work, i.e. we need to append a sub folder - path=${path}/secure + path=${path}/a fi mdebug "rserver_data_dir(): ${path}"