wallix / terraform-provider-wallix-bastion

Terraform provider for Wallix bastion
https://www.wallix.com/privileged-access-management/
Mozilla Public License 2.0
5 stars 2 forks source link

[ BUG ] - Some time to time, API returns Service unavailable #26

Closed mldmld68 closed 2 months ago

mldmld68 commented 4 months ago

Describe the bug From time to time, we get Service unavailable issue from the Wallix API

Error: sending http request: Get "https://xxxxxxxx:443/api/v3.3/devices/xxxxx: Service Unavailable │ │ with wallix-bastion_device_localdomain_account_credential.account_credential-rdp[0], │ on tbr.tf line 525, in resource "wallix-bastion_device_localdomain_account_credential" "account_credential-rdp": │ 525: resource "wallix-bastion_device_localdomain_account_credential" "account_credential-rdp" {

To Reproduce Play terraform multiple time

Expected behavior No Service unavailable error

Desktop (please complete the following information):

bsimonWallix commented 4 months ago

Hi @mldmld68, what version of bastion do you use ? This is not an issue on terraform provider but on the targeted bastion host.

You may want to set the logs as debug on the bastion and check syslog to see what is happening.

mldmld68 commented 4 months ago

Hi, we expericing very high failure rate. The version of Wallix is "wab_complete_version": "8.0 hotfix 15 (build 19; 2022-10-14)" We have many devices and groups.

mldmld68 commented 4 months ago

I made some tests using curl as the url of the failed requests are shown by the wallix terraform provider. I notice such a request can take between 1 and up to 30 seconds. date https://wallixhost/api/v3.3/usergroups/19082ad9fb0de97f42010a90787c date

What is the timeout set in the Wallix terraform provider ? I did not see it.

bsimonWallix commented 4 months ago

This timeout is not linled to to terraform provider but seems linked to the API handling on your bastion. It seems to be an old release. From version 8 we made a lot of change regarding API performance.

bsimonWallix commented 4 months ago

You can change timeout by ressource call on terraform script but this meeans we need to adapt resources endpoints.

timeouts { create = "1h30m" update = "2h" delete = "20m" }

https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts

denis-machard commented 3 months ago

Hi @mldmld68, I observed the same behavior on my side with provider terraform. I believe it's due to the number of parallel connections per IP being enabled (Bastion 10.0 Hotfix 5). I changed the number of connections settings in the menu System > Service Control, and the problem disappeared. Denis

mldmld68 commented 2 months ago

Hello, finally we figured out this issue. It was related to proxy settings. The no_proxy variable was incorrect. Thank all

bsimonWallix commented 2 months ago

Thanks for the info. I was getting nuts trying to reproduce :p