Error in read_cmdstan_csv Assertion on 'files' failed

For some reason my previously written code doesn’t work anymore (it used to work with no problem). Here is my code:

output = readRDS('Fitted_model.rds') #Loading the fitted model

> class(output)
[1] "CmdStanMCMC" "CmdStanFit"  "R6"    

> post_matrix  <- output$draws(c("y_sim")) 
Error in read_cmdstan_csv(files = self$output_files(include_failed = FALSE),  : 
  Assertion on 'files' failed: File does not exist: '/tmp/RtmppHtKLX/k7_VIARCH-202209121104-1-3dd4e0.csv'.

Does anyone know how to fix this?

It sounds like the saved object was still pointing to the (temporary) CSV files, did you originally create Fitted_model.rds with $save_object()?

I simply used saveRDS() function. And the code used to work with no problem. I have no idea what has changed since then.

CmdStanR saves output files from sampling in a temporary directory. Depending on your operating system/settings, these will be deleted every login/every day/at random