Trouble with cmdstan toolchain with RTools42 on Windows 10 Enterprise

I’m trying to get cmdstanr working with R 4.2.1 and Rtools42. I currently have it working on this PC with Rtools40. I was able to install the cmdstanr package, but I’m failing at the check_cmdstan_toolchain() step. I’m pretty sure this a problem more so with Rtools than Stan, but figured I’d post here in case anyone has a solution or if I come up one to post for others.

The error I’m getting is as follows.

Error in `processx::run("pacman", args = c("-Sy", install_pkgs, "--noconfirm"), …`:
! System command 'pacman' failed
---
Exit status: 1
Stderr (last 10 lines, see `$stderr` for more):
error: failed retrieving file 'clang64.db' from repo.casualgamer.ca : OpenSSL SSL_connect: Connection reset by peer in connection to repo.casualgamer.ca:443 
warning: too many errors from repo.casualgamer.ca, skipping for the remainder of this transaction
error: failed retrieving file 'mingw32.db' from mirror.iscas.ac.cn : SSL certificate problem: unable to get local issuer certificate
error: failed retrieving file 'clang64.db' from mirrors.aliyun.com : SSL certificate problem: unable to get local issuer certificate
warning: too many errors from mirrors.aliyun.com, skipping for the remainder of this transaction
error: failed retrieving file 'clang64.db' from mirror.iscas.ac.cn : SSL certificate problem: unable to get local issuer certificate
warning: too many errors from mirror.iscas.ac.cn, skipping for the remainder of this transaction

I opened up the RTools42 Bash and tried pacman -Syuu and was getting similar errors. There’s something going on with SSL certification. But whatever the issue is it’s localized to RTools42. pacman -Syuu works in RTools40 Bash and check_cmdstan_toolchain() works in R 4.0.

Any advice is greatly appreciated.

Operating System: Windows 10 Enterprise
Interface Version: R 4.2.1
Compiler/Toolkit: RTools42

@rok_cesnovar

This is an odd one, it’s definitely related to Rtools42 and not Stan but let’s see if we can help you out. It should help us help others at some point :)

When this error occurs, are you behind a company firewall or something? Something like ruby on rails - Certificate error when trying to install MSYS2 packages on Windows server - Stack Overflow should help us in that case.

Yes, this error occurs when I’m plugged into the company network. I’m beginning to suspect the firewall is the issue. Originally, I thought that wasn’t the case because running pacman -Syuu works with Rtools40 Bash, but not Rtools42. But after looking at the mirrorlists in C:\rtools42\etc\pacman.d these are fairly different from what Rtools40 was using.

I’m going to get it on another network later today and see if that’s the issue. I’ll check back in after.

EDIT: It was indeed the DOI firewall.

1 Like