Lucretius / vault_raft_snapshot_agent

⛔️ DEPRECATED ⛔️ An agent which provides periodic snapshotting capabilities of Vault's Raft backend
MIT License
78 stars 42 forks source link

Add timeout support for vault client #21

Open luanphantiki opened 2 years ago

luanphantiki commented 2 years ago

ref:

luanphantiki commented 2 years ago

@Lucretius Please review it, thanks!

luanphantiki commented 2 years ago

@devops-42 , please consider to test this feature, it's not harmful for your production, but you should test it at UAT if possible.

devops-42 commented 2 years ago

@luanphantiki

unfortunately it seems not to work. Steps which I've done:

The pod still exits after 60 secs with the well-known error:

2021/10/27 12:35:29 Reading configuration...
2021/10/27 12:36:30 Unable to generate snapshot context deadline exceeded (Client.Timeout or context cancellation while reading body)

I already logged into the pod and can confirm, that the timeout value is present in the mounted config file. I also grepped against the binary of the vault_raft_snapshot_agent to check whether the right image has been pull from our registry:

grep timeout vault_raft_snapshot_agent 
[...]
json:"timeout,ommitempty"
[...]

Maybe I missed something?

luanphantiki commented 2 years ago

@devops-42 : there was a typo on my code, fixed, can you please pull the latest and try again ?

devops-42 commented 2 years ago

@luanphantiki

Tested again. The log file now shows that the timeout parameter could parsed correctly, but the task still aborts after 60s:

2021/10/28 08:13:05 Reading configuration...
2021/10/28 08:13:05 Vault client timeout has been set to 5m0s
2021/10/28 08:14:05 Unable to generate snapshot context deadline exceeded (Client.Timeout or context cancellation while reading body)
luanphantiki commented 2 years ago

@devops-42 thanks, I might be missed somethings, will update it soon.

luanphantiki commented 2 years ago

@devops-42: please test the latest commit once have a chance, thanks!

devops-42 commented 2 years ago

Hey @luanphantiki

finally :) Thumbs up, good work!

2021/10/29 13:58:25 Reading configuration...
2021/10/29 13:58:25 Vault http client timeout has been set to 5m0s
2021/10/29 14:01:43 Successfully created aws snapshot to ....

Thanks

luanphantiki commented 2 years ago

Alright, thanks for the confirmation @devops-42 ;)

@Lucretius The new feature seems to work, please review it, thanks!

kirrmann commented 1 year ago

Can we merge this is? For me snapshot creation didn't work at all. Sometimes got infamous context deadline error, but other times the snapshots were created with only 0 bytes. I just tried this PR to increase the timeout and it does work for me.

druesendieb commented 7 months ago

@Lucretius The repository is stale since 2021 - are you planning on updating or enhancing it with PR's like this at all?

Argelbargel commented 7 months ago

HI @druesendieb: see https://github.com/Lucretius/vault_raft_snapshot_agent/issues/28#issuecomment-1516986172

This repo is not actively maintained any more. There are some forks with added features including the timeout for vault client (e.g. https://github.com/Boostport/vault_raft_snapshot_agent). I've created a fork too (https://github.com/Argelbargel/vault-raft-snapshot-agent) which includes most of the open prs and some further enhancements. Perhaps one of those might work for you?

Lucretius commented 7 months ago

Hello,

No, I built this years ago when I was working at a place that used Vault, which I no longer do. There are others who have forked this repo and have enhanced it. Feel free to do so as well. I will update this repo to reflect its status.