Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domain expiration not updating #756

Open
ITechGeek81 opened this issue May 8, 2024 · 4 comments
Open

Domain expiration not updating #756

ITechGeek81 opened this issue May 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ITechGeek81
Copy link

Describe the bug

Gatus doesn't seem to be updating the domain registration every hour as it says it is.,

What do you see?

I had two domains listed as expiring soon (currently I have it set for 3 months out), that I renewed. I renewed one for 2 years last week and one for 1 year over the weekend.

The one last week was a .net registered with Cloudflare and the one over the weekend was a .com also registered with Cloudflare.

I've tried changing the expiration to 2 months and they go green, I change it back to 3 months and they went red again.

What do you expect to see?

Both domains should go green since they've been renewed for 1 or 2 years.

List the steps that must be taken to reproduce this issue

No response

Version

No response

Additional information

No response

@ITechGeek81 ITechGeek81 added the bug Something isn't working label May 8, 2024
@ITechGeek81
Copy link
Author

This seems to have cleared up. Does the system have a delay in checking if the domains are renewed?

@TwiN
Copy link
Owner

TwiN commented May 14, 2024

There is a cache for expiration dates.

gatus/client/client.go

Lines 67 to 72 in 9d151fc

domainExpiration = time.Until(whoisResponse.ExpirationDate)
if domainExpiration > 720*time.Hour {
whoisExpirationDateCache.SetWithTTL(hostname, whoisResponse.ExpirationDate, 240*time.Hour)
} else {
whoisExpirationDateCache.SetWithTTL(hostname, whoisResponse.ExpirationDate, 72*time.Hour)
}

If the domain expiration is more than 30 days away, the TTL is set to 10 days, else, it's set to 3 days (though it tries to refresh the cache entry 24h before either the cache entry or the domain expires just in case the whois server for the domain's TLD is running into issues).

That being said, you mentioned having updated the expiration from 2 months to 3 months, did you restart Gatus when you made those changes, or did you update the configuration and let the hot reload feature reload the configuration? If it's the latter, it could be reusing the existing in-memory cache. Either way, the cache for domain expiration is only in-memory, so restarting Gatus should fix it.

Perhaps the TTL should be lower, I set it pretty high because I wanted to minimize the load on TLD whois servers as I know some occasionally have downtime.

@ITechGeek81
Copy link
Author

The issue eventually cleared and I was having the issue on another domain, but after read this I restarted the docker container and it came up.

Having the high TTL generally isn't a problem for domain expiration, but would it be possible that when the registration check has failed because it's entered the window the person has selected, that maybe the TTL drops as low as 24 hours (or uses the recheck time the person has selected)?

@TwiN
Copy link
Owner

TwiN commented May 19, 2024

@ITechGeek81 It does already try to recheck the domain expiration date if either the expiration date or the TTL is less than 24h away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants