stan-dev / stan-dev/rstan

Error in sampler$call_sampler

Open
#994 3 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

When running rstan::sampling() I have just started getting the following error message:

[1] "Error in sampler$call_sampler(args_list[[i]]) : "
error occurred during calling the sampler; sampling not done

Please see the comment below for more details

Our stan code hasn't changed in the last 6 months so assume this is related to an updated version of stan / rstan / local compiler change ? The following below is a minimal example code that I was able to use to create the problem, that being said it is super inconsistant, 80% of the time it works fine and 20% of the time it kicks up the above error. Once its kicked up the error it won't fix itself until I restart R. The issue seems to be related to loading our R package via rstantools but I've not been able to consistently reproduce the problem nor diagnose whats triggering it.

Any help / advice would be appreciated.

Version Information

  • OS Version: Mac OS Big Sur 11.6.2
  • RStan Version: 2.21.3
  • No Makevars file exists
  • Output of devtools::session_info("rstan"):
> devtools::session_info("rstan")
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       macOS Big Sur 10.16
 system   x86_64, darwin17.0
 ui       X11
 language (EN)
 collate  en_GB.UTF-8
 ctype    en_GB.UTF-8
 tz       Europe/London
 date     2022-03-10
 pandoc   2.17.1.1 @ /usr/local/bin/pandoc

─ Packages ───────────────────────────────────────────────────────────────────
 package      * version   date (UTC) lib source
 backports      1.4.1     2021-12-13 [1] CRAN (R 4.1.0)
 BH             1.78.0-0  2021-12-15 [1] CRAN (R 4.1.0)
 callr          3.7.0     2021-04-20 [1] CRAN (R 4.1.0)
 checkmate      2.0.0     2020-02-06 [1] CRAN (R 4.1.0)
 cli            3.2.0     2022-02-14 [1] CRAN (R 4.1.2)
 colorspace     2.0-3     2022-02-21 [1] CRAN (R 4.1.2)
 crayon         1.5.0     2022-02-14 [1] CRAN (R 4.1.2)
 desc           1.4.1     2022-03-06 [1] CRAN (R 4.1.2)
 digest         0.6.29    2021-12-01 [1] CRAN (R 4.1.0)
 ellipsis       0.3.2     2021-04-29 [1] CRAN (R 4.1.0)
 fansi          1.0.2     2022-01-14 [1] CRAN (R 4.1.2)
 farver         2.1.0     2021-02-28 [1] CRAN (R 4.1.0)
 ggplot2        3.3.5     2021-06-25 [1] CRAN (R 4.1.0)
 glue           1.6.2     2022-02-24 [1] CRAN (R 4.1.2)
 gridExtra      2.3       2017-09-09 [1] CRAN (R 4.1.0)
 gtable         0.3.0     2019-03-25 [1] CRAN (R 4.1.0)
 inline         0.3.19    2021-05-31 [1] CRAN (R 4.1.0)
 isoband        0.2.5     2021-07-13 [1] CRAN (R 4.1.0)
 labeling       0.4.2     2020-10-20 [1] CRAN (R 4.1.0)
 lattice        0.20-45   2021-09-22 [1] CRAN (R 4.1.2)
 lifecycle      1.0.1     2021-09-24 [1] CRAN (R 4.1.0)
 loo            2.4.1     2020-12-09 [1] CRAN (R 4.1.0)
 magrittr       2.0.2     2022-01-26 [1] CRAN (R 4.1.2)
 MASS           7.3-54    2021-05-03 [1] CRAN (R 4.1.2)
 Matrix         1.3-4     2021-06-01 [1] CRAN (R 4.1.2)
 matrixStats    0.61.0    2021-09-17 [1] CRAN (R 4.1.0)
 mgcv           1.8-38    2021-10-06 [1] CRAN (R 4.1.2)
 munsell        0.5.0     2018-06-12 [1] CRAN (R 4.1.0)
 nlme           3.1-153   2021-09-07 [1] CRAN (R 4.1.2)
 pillar         1.7.0     2022-02-01 [1] CRAN (R 4.1.2)
 pkgbuild       1.3.1     2021-12-20 [1] CRAN (R 4.1.0)
 pkgconfig      2.0.3     2019-09-22 [1] CRAN (R 4.1.0)
 prettyunits    1.1.1     2020-01-24 [1] CRAN (R 4.1.0)
 processx       3.5.2     2021-04-30 [1] CRAN (R 4.1.0)
 ps             1.6.0     2021-02-28 [1] CRAN (R 4.1.0)
 R6             2.5.1     2021-08-19 [1] CRAN (R 4.1.0)
 RColorBrewer   1.1-2     2014-12-07 [1] CRAN (R 4.1.0)
 Rcpp           1.0.8     2022-01-13 [1] CRAN (R 4.1.2)
 RcppEigen      0.3.3.9.1 2020-12-17 [1] CRAN (R 4.1.0)
 RcppParallel   5.1.5     2022-01-05 [1] CRAN (R 4.1.2)
 rlang          1.0.2     2022-03-04 [1] CRAN (R 4.1.2)
 rprojroot      2.0.2     2020-11-15 [1] CRAN (R 4.1.0)
 rstan          2.21.3    2021-12-19 [1] CRAN (R 4.1.0)
 scales         1.1.1     2020-05-11 [1] CRAN (R 4.1.0)
 StanHeaders    2.21.0-7  2020-12-17 [1] CRAN (R 4.1.0)
 tibble       * 3.1.6     2021-11-07 [1] CRAN (R 4.1.0)
 utf8           1.2.2     2021-07-24 [1] CRAN (R 4.1.0)
 vctrs          0.3.8     2021-04-29 [1] CRAN (R 4.1.0)
 viridisLite    0.4.0     2021-04-13 [1] CRAN (R 4.1.0)
 withr          2.5.0     2022-03-03 [1] CRAN (R 4.1.2)

 [1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library

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

Start with the minimal example using rstan::sampling() and the supplied devtools::session_info("rstan") output, then compare successful and failing runs across R restarts. No repository file or test is named; done would require a reproducible cause and a verified resolution for the intermittent sampler error.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
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.