# Trouble with cmdstan toolchain with RTools42 on Windows 10 Enterprise

**URL:** <https://discourse.mc-stan.org/t/trouble-with-cmdstan-toolchain-with-rtools42-on-windows-10-enterprise/28444>\
**Category:** Interfaces\
**Created:** [August 4, 2022, 6:34pm UTC](https://discourse.mc-stan.org/t/trouble-with-cmdstan-toolchain-with-rtools42-on-windows-10-enterprise/28444 "2022-08-04T18:34:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dalton](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dalton/32/4287_2.png) [@Dalton](https://discourse.mc-stan.org/u/Dalton)\
**Post date:** [August 4, 2022, 6:34pm UTC](https://discourse.mc-stan.org/t/trouble-with-cmdstan-toolchain-with-rtools42-on-windows-10-enterprise/28444/1 "2022-08-04T18:34:56Z")

</div>

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.

```nohighlight
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

---

<div class="post-metadata">

**Author:** ![WardBrian](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/wardbrian/32/12078_2.png) [@WardBrian](https://discourse.mc-stan.org/u/WardBrian)\
**Post date:** [August 4, 2022, 6:36pm UTC](https://discourse.mc-stan.org/t/trouble-with-cmdstan-toolchain-with-rtools42-on-windows-10-enterprise/28444/2 "2022-08-04T18:36:04Z")

</div>

@rok_cesnovar

---

<div class="post-metadata">

**Author:** ![rok\_cesnovar](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rok\_cesnovar](https://discourse.mc-stan.org/u/rok_cesnovar)\
**Post date:** [August 4, 2022, 6:56pm UTC](https://discourse.mc-stan.org/t/trouble-with-cmdstan-toolchain-with-rtools42-on-windows-10-enterprise/28444/3 "2022-08-04T18:56:55Z")

</div>

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](https://stackoverflow.com/questions/69348953/certificate-error-when-trying-to-install-msys2-packages-on-windows-server) should help us in that case.

---

<div class="post-metadata">

**Author:** ![Dalton](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dalton/32/4287_2.png) [@Dalton](https://discourse.mc-stan.org/u/Dalton)\
**Post date:** [August 5, 2022, 4:00pm UTC](https://discourse.mc-stan.org/t/trouble-with-cmdstan-toolchain-with-rtools42-on-windows-10-enterprise/28444/4 "2022-08-05T16:00:40Z")

</div>

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.
