# How to Deal with WinRM CredSSP Read timed out

**URL:** <https://forum.ansible.com/t/how-to-deal-with-winrm-credssp-read-timed-out/29330>\
**Category:** Ansible Developer\
**Tags:** windows, ubuntu, aws\
**Created:** [December 26, 2018, 1:43pm UTC](https://forum.ansible.com/t/how-to-deal-with-winrm-credssp-read-timed-out/29330 "2018-12-26T13:43:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin2](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@Justin2](https://forum.ansible.com/u/Justin2)\
**Post date:** [December 26, 2018, 1:43pm UTC](https://forum.ansible.com/t/how-to-deal-with-winrm-credssp-read-timed-out/29330/1 "2018-12-26T13:43:36Z")

</div>

```auto

TASK [roles/ansible-role-dc : Copy Schema File 2] ****************************** fatal: [10.254.64.5]: UNREACHABLE! => {"changed": false, "msg": "credssp: HTTPSConnectionPool(host='10.254.64.5', port=5986): Read timed out. (read timeout=200)", "unreachable": true} to retry, use: --limit @/home/ubuntu/workspace/sales-demo/demo-idauto-salesdemo-prd-inf/ansible_dc.retry

```

```auto

```

```auto

```

```auto
I have 2 environments in AWS, each environment contains 2 Windows servers that I am running a playbook against. Ansible itself is running in a docker container and connecting to the instances over VPC Peering. So The Docker Server and Ansible Container are in 1 VPC, using winrm/credssp to connect to windows servers in another VPC.

```

```auto

```

```auto
The playbook keeps randomly failing with the above errors. It will happen at different places in the playbook, so I cant narrow it down to any one specific section. That file copy above is for a 1.8K file, so its not like it was too large.

```

```auto

```

```auto
I run this same setup, for thousands of linux servers and have no issue, so I assume its something with winrm, and VPC peering that it just doesnt like.

```

```auto

```

```auto
Here is winrm confg.

```

```auto

```

```auto

ansible_port: 5986 ansible_connection: winrm ansible_winrm_server_cert_validation: ignore ansible_winrm_transport: credssp ansible_winrm_operation_timeout_sec: 150 ansible_winrm_read_timeout_sec: 200

```

I know the best solution would be to run ansible inside the same VPC but its not an option, so is there anything that can be done? These ansible failures are putting a halt to the project, and my fear is that winrm is not going to allow this to work.

---

<div class="post-metadata">

**Author:** ![Justin2](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@Justin2](https://forum.ansible.com/u/Justin2)\
**Post date:** [December 26, 2018, 5:24pm UTC](https://forum.ansible.com/t/how-to-deal-with-winrm-credssp-read-timed-out/29330/2 "2018-12-26T17:24:22Z")

</div>

Same issue happens If I move to Ansible 2.8, and uses PSRP

`ansible_connection: psrp ansible_psrp_auth: credssp ansible_psrp_cert_validation: ignore ansible_psrp_connection_timeout: 120 ansible_psrp_operation_timeout: 80 ansible_psrp_reconnection_retries: 10`

`TASK [roles/ansible-role-dc : configure AD CS certification authority] ********* An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ReadTimeout: HTTPSConnectionPool(host='10.254.64.5', port=5986): Read timed out. (read timeout=30) fatal: [10.254.64.5]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""} to retry, use: --limit @/home/ubuntu/workspace/sales-demo/demo-idauto-salesdemo-prd-inf/ansible_dc.retry`

As you can see it failed at a completely different point in the role.

`

- name: configure AD CS certification authority  
win\_shell: Install-AdcsCertificationAuthority -CAType EnterpriseRootCa -CryptoProviderName “RSA#Microsoft Software Key Storage Provider” -KeyLength 2048 -HashAlgorithmName SHA256 -ValidityPeriod Years -ValidityPeriodUnits 99 -Force  
async: 1000  
poll: 5  
register: pri\_adcs\_enrollment\_config  
changed\_when: pri\_adcs\_enrollment\_config.rc == 0  
failed\_when:
- pri\_adcs\_enrollment\_config.rc != 0
- ‘“The Certification Authority is already installed” not in (pri\_adcs\_enrollment\_config.stderr|regex\_replace(“\r\n”, “”))’  
become: yes  
become\_user: SYSTEM  
become\_method: runas  
`

I also see using PSRP it falls back to a read timeout of 30 seconds, there is no way to increase it that I can see. It also appears with a read failure, it doesn’t attempt to try the connection again.

---

<div class="post-metadata">

**Author:** ![sase\_kumar1](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@sase\_kumar1](https://forum.ansible.com/u/sase_kumar1)\
**Post date:** [January 3, 2019, 6:58am UTC](https://forum.ansible.com/t/how-to-deal-with-winrm-credssp-read-timed-out/29330/3 "2019-01-03T06:58:22Z")

</div>

Just a try!

Can you enable enable-credssp -force on those failed machine and give a try
