https://www.ory.sh/ logo
#talk-kratos
Title
# talk-kratos
r

rough-energy-65470

12/14/2021, 3:34 AM
@User I've read some place that the webhooks have no retry method and that they don't think kratos should handle that. Just curious as to what would happen if a server that the webhook is sending to is not up, would it just fail silently?
p

purple-airplane-83952

12/14/2021, 9:33 AM
AFAIK there is no retry mechanism.
m

magnificent-energy-493

12/14/2021, 1:51 PM
Failed hook requests should be stored in the database, but I am not sure if it is implemented, if so not documented. Maybe you can confirm quickly @proud-plumber-24205?
p

proud-plumber-24205

12/14/2021, 2:31 PM
No we do not store the failed request in the database. When the webhook fails it does not retry. You can see it here: https://github.com/ory/kratos/blob/51b131177c9e0db018eced939fef43742c9e86cf/selfservice/hook/web_hook.go#L248-L270 Also see this note on the docs
As of today Web-Hooks cannot control the execution of the flow by patching/updating particular properties of flow specific object upon Web-Hook completion. It will however cancel the execution of the flow if the call to the Web-Hook end point fails either due to a network error or if the end point responses with an HTTP code > 300.
The webhook will print the error to the kratos logs and the flow will probably also fail. The request might also then get redirected to the kratos error page with the error message.
I will need to test it to verify my assumptions of the redirect to the error page.
r

rough-energy-65470

12/14/2021, 10:45 PM
appreciate the response guys, so even though we have the after webhook, if it fails it will revert everything, i.e it will revert the registration of the user?
p

proud-plumber-24205

12/15/2021, 8:41 AM
I would have to test that, the user should still be created though, but the session might not