Error in unserialize(socklist[[n]]) : error reading from connection Error in serialize(data, node$con, xdr = FALSE) : error writing to connection

I got above-mentioned error while running:

m14.3<-ulam(
alist(
L~binomial(1,p),
logit§<-g[tid]+alpha[actor,tid]+beta[block_id,tid],
transpars>matrix[actor,4]:alpha<-
compose_noncentered(sigma_actor,L_Rho_actor,z_actor),
transpars>matrix[block_id,4]:beta<-
compose_noncentered(sigma_block,L_Rho_block,z_block),
matrix[4,actor]:z_actor~normal(0,1),
matrix[4,block_id]:z_block~normal(0,1),
g[tid]~normal(0,1),
vector[4]:sigma_actor ~dexp(1),
cholesky_factor_corr[4]:L_Rho_actor ~lkj_corr_cholesky(2),
vector[4]:sigma_block ~dexp(1),
cholesky_factor_corr[4]:L_Rho_block ~lkj_corr_cholesky(2),
gq>matrix[4,4]:Rho_actor<<-Chol_to_Corr(L_Rho_actor),
gq>matrix[4,4]:Rho_block<<-Chol_to_Corr(L_Rho_block)),data=dat,chains=4,cores=4,log_lik=TRUE)

Help appreciated!

I am using Window system-10, 64bit, R- 3.6.3, RTools 40, rstan 2.19.3

Hey there! Sorry for the delay! Maybe you have already found a solution (hopefully).

If not, could it be this problem: https://discourse.mc-stan.org/t/rstudio-viewer-with-rstan-running-in-parrallel-with-rstudio-1-3/15615?

Cheers,
Max

This is probably not due to the RStudio Viewer bug. See this thread: Error in unserialize(socklist[[n]]) : error reading from connection Error in serialize(data, node$con, xdr = FALSE) : error writing to connection

Give that @sp977 is using R 3.6.3. I think the place to start is to remove the Makevars.win file. Avoid using -march=native and / or -mtune=native , as suggested in that thread. However, I suspect there is also going to be conflict with using Rtools40 and R 3.6.3 - I believe Rtools40 is only compatible with R 4.0+

Probably the best thing to do is to updated to 4.0.1+ and Rtools40 completely remove your Makevars.win file… see some of the pinned posts on getting rstan to play nice with R 4.0+

Once you get that all sorted out, then you might run into RstudioViewer issues if you’re not using the current preview version of RStudio (1.3.1054 + )

1 Like

Thank you @Dalton! Good points :)