stan-dev / stan-dev/rstan

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

Open
#1,081 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named. Start with the provided brm calls and Dockerfile, then determine whether the worker failure reproduces in that environment. Done means identifying whether the cause is RStan, Docker dependencies, or memory, with a reproducible project-specific resolution or confirmation that it is environmental.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, r
Domain
data, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.