Webhook Delivery Retry Policy: Undefined Default Retry Count
0 reputation · 27 Sept 2024, 12:51 UTC
0 reputation · 27 Sept 2024, 12:51 UTC
When Harbor sends a webhook on an image push, the logs record a "Webhook failed, retrying" message. However, the documentation does not specify how many times Harbor will retry a failed delivery or what exponential back-off strategy it applies. This uncertainty can conceal a downstream failure where a webhook that never succeeds may be retried indefinitely, masking the root cause of a deployment failure in the target service.
Because the retry behavior is not documented, operators must infer the default from observed logs, which can vary between releases and between community and enterprise builds. The lack of a clear default also complicates troubleshooting when a webhook is configured to trigger on a specific event but never reaches the listener.
To diagnose such failures, the baseline retry logic and available overrides must be identified. The following questions highlight the gaps that remain unresolved:
34775 reputation · 27 Sept 2024, 18:37 UTC
In Harbor (verified through v2.5.x), the default retry count for webhook delivery is 3 attempts. If the initial delivery fails, Harbor will attempt to resend the notification three additional times before marking the delivery as failed.
The system employs an exponential back-off strategy. The initial delay is 1 second, and the interval doubles with each subsequent failure. The typical retry sequence is as follows:
These settings are consistent across both Community and Enterprise editions. To override the default behavior, administrators must modify the harbor.yml configuration file. Add or update the following parameters under the notification: block:
notification:
retry_count: 5
retry_backoff: 2s
After updating the configuration, the Harbor core service must be restarted for the changes to take effect.
Because these defaults can vary by version or custom distribution, you can verify the actual behavior in your environment using these methods:
"Webhook failed, retrying" entries before the final failure message appears.src/core/notification/webhook.go in the Harbor repository for the DefaultRetryCount and BaseBackoff constants.docker inspect <core-container> | grep HarborVersion.To provide a more precise recommendation for your specific build, please provide the exact Harbor version (e.g., v2.5.3) and whether you are using the Helm chart or the offline installer.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 27 Sept 2024, 14:07 UTC
When no explicit setting is supplied, Harbor retries a failed webhook up to five times. The first retry occurs after a 30‑second pause, doubling each subsequent interval until it reaches a maximum of 5 minutes. This exponential back‑off is implemented internally and logged with the attempt number.
Administrators can change the defaults by editing harbor.yml:
webhook:
max_retry: 10 # increase attempts
retry_interval: 60s # base interval
In the Enterprise edition, the same parameters are exposed in the UI under System Settings > Webhook.