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

MultisessionFuture (<none>) failed to receive results from cluster RichSOCKnode #1081

Open
mohmdsh opened this issue Jul 7, 2023 · 0 comments

Comments

@mohmdsh
Copy link

mohmdsh commented Jul 7, 2023

Summary:

I have an error from compiling stan.

Description:

I made a Docker image of Rstudio with Rstan packages and dependencies. I used a When I run my model, it returns an error as shown below:

Sys.setenv(R_FUTURE_RNG_ONMISUSE = "ignore") 
MODEL1.nae <- brm(depfactor ~ factor1 + factor2 +
 Factor3 + factor4 + factor5 +
  (1 | labid) + (1 | subid_unique),
data = data.nae,
family = gaussian,
prior = prior_nae_1,
iter = 4000,
warmup = 2000,
chains = 4,
save_pars = save_pars(all = T),
control = list(adapt_delta = .95),
seed = 456
)

summary(MODEL1.nae)

MODEL2.nae <- brm(depfactor~ factor1 + factor2 +
  Factor3 + factor4 +
  (1 | labid) + (1 | subid_unique),
data = data.nae,
family = gaussian,
prior = prior_nae_null_1,
iter = 4000,
warmup = 2000,
chains = 4,
save_pars = save_pars(all = T),
control = list(adapt_delta = .95),
seed = 123
)

summary(MODEL2.nae)
Chain 1: 
Chain 1:  Elapsed Time: 4.1159 seconds (Warm-up)
Chain 1:                1.85004 seconds (Sampling)
Chain 1:                5.96594 seconds (Total)
Chain 1: 
Error in unserialize(node$con) : 
  MultisessionFuture (<none>) failed to receive results from cluster RichSOCKnode #2 (PID 4567 on localhost 'localhost'). The reason reported was 'error reading from connection'. Post-mortem diagnostic: No process exists with this PID, i.e. the localhost worker is no longer alive. Detected a non-exportable reference ('externalptr' of class 'DLLHandle') in one of the globals ('args' of class 'list') used in the future expression. The total size of the 1 globals exported is 158.91 KiB. There is one global: 'args' (158.91 KiB of class 'list')

A snap of my Dockerfile:

FROM rocker/tidyverse:latest

# customizing RStudio
COPY build_imports/.config /home/rstudio/.config
COPY build_imports/.Rprofile /home/rstudio/

# copying the .R folder with Makevars
COPY build_imports/.R /home/rstudio/.R

# rstudio owns ~
RUN chown -R rstudio:rstudio /home/rstudio/

# installing libs
RUN apt-get update \
	&& apt-get install -y --no-install-recommends \
	clang \
    libv8-dev \
    libudunits2-dev \
    libgdal-dev \
    libgeos-dev \
    libproj-dev \
    libxml2 \
    libxml2-dev \
    libglpk-dev

# installing rstan
RUN install2.r --error --deps TRUE \
    BH\
    StanHeaders\
    Rcpp \
    RcppEigen \
    RcppParallel \
    inline \
    loo \
    pkgbuild \
    rstan \
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds

# need to get graph as a dep for igraph
RUN R -e "BiocManager::install('graph')"

# direct installs of a few more deps
RUN install2.r --error --deps TRUE \
    igraph \
    posterior \
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds

# cmdstanr as a dep for brms
RUN install2.r --error --deps TRUE -r "https://mc-stan.org/r-packages/" \
    cmdstanr \
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds

RUN install2.r --error --deps TRUE \
    brms \
    tidybayes \
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds

RUN install2.r --error --deps TRUE \
    janitor \
    renv \
    here \
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds

I am not sure of the bug is related to Rstan, or Docker image dependencies or due to memory issue.

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

No branches or pull requests

1 participant