Subset error with new cmdstanr version

I downloaded cmdstanr today to get the latest version, 0.0.0.9008.

I tried a basic model

parameters {
  real phi;
}

model {
  phi ~ normal(0, 1);
}

I then run it as follows

sim <- mod$sample()

and get the following message

All 4 chains finished successfully.
Mean chain execution time: 0.1 seconds.
Total execution time: 0.5 seconds.
Error: Can't subset columns that don't exist.
x The columns `lp__`, `treedepth__`, and `divergent__` don't exist.
Run `rlang::last_error()` to see where the error occurred.

What is going on? This is as standard a use of cmdstanr as it gets…

EDIT: the error also occurs when running the example model in this vignette: https://mc-stan.org/cmdstanr/articles/cmdstanr.html

This is similar to https://github.com/stan-dev/cmdstanr/issues/243 which we were unable to reproduce when it was reported.

Cmdstan 2.23 or are you using the release candidate?

Let’s see… I actually got the error with cmdstan 2.22. I’ll try out some of the solutions proposed on the link you shared.

Edit: I’ll save the package version that cause the error if we need to investigate the issue.

I am unable to reproduce this on Ubuntu 20.04 :/ As well as Windows. Also no complaints from our CI where we run a bunch of tests on Win/Ubuntu/Mac.

If you get any additional info, that would be appreciated.

What are the relevant packages? I can give you their versions.

jsonlite
posterior,
processx,
vroom

And possibly any of the posterior packages

abind,
rlang,
stats,
tibble

My bet is on vroom or rlang.

Though Breck had the last version of vroom and the same error. Maybe its a version + mac combination.

  • jsonlite 1.6

  • posterior 0.1.0

  • processx (nothing prompted)

  • vroom version 1.2.1

  • abind 1.4-5

  • rlang (nothing prompted)

  • stats 3.6.1

  • tibble 1.2.1

Mac OS catalina, R version 3.6.1

I got a warning message for vroom or rlang that they were built using R version 3.6.2. Maybe the R version is part of the problem.

1 Like

Thanks!
R 3.6 does seem to be the case for both yes. Good call.

Sooooo… I updated R and all the packages (which is a rather tedious process) and found out posterior is not available for R v4.0.2. Is there a workaround this?

@charlesm93 this is unfortunate, sorry! I don’t have any idea why vroom would have an issue with R 3.6 and mac (I haven’t seen that reported anywhere related to vroom and it was definitely working for me with R 3.6 and Mac last week before I updated to R 4.0).

When it says

Run `rlang::last_error()` to see where the error occurred.

can you share what rlang::last_error() tells you?

It just says that because it’s not on CRAN yet. Installing posterior from GitHub should work fine.

1 Like

You can install from Github:

remotes::install_github("stan-dev/posterior")

1 Like

@rok_cesnovar @jonah You guys are gentlemen and scholars. Thank you very much for all your help! cmdstanr works again.

3 Likes

Glad it’s working. Sorry for the hassle!