TwiN / gatus

⛑ Automated developer-oriented status page

Home Page:https://gatus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Domain expiration not updating

ITechGeek81 opened this issue · comments

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

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

commented

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.

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)?

commented

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