Kareadita/Kavita · warning · KavitaException
Kavita has already tried to fetch from {sanitizedBaseUrl} an
Error message
Kavita has already tried to fetch from {sanitizedBaseUrl} and failed. Skipping duplicate check What it means
Thrown by CoverDbService.DownloadFaviconAsync when the favicon cache (EasyCache Favicon profile) already holds an entry for the baseUrl — meaning a prior attempt for that exact scheme://host failed and was recorded to avoid hammering the remote. The cache acts as a negative-lookup marker: presence == 'we already failed, don't retry until TTL'. The message is logged at Trace and rethrown as a KavitaException.
Source
Thrown at Kavita.Services/Metadata/CoverDbService.cs:114
/// falls back to an internal fallback method if needed. Valid results are saved to disk.
/// </remarks>
public async Task<string> DownloadFaviconAsync(string url, EncodeFormat encodeFormat, CancellationToken ct = default)
{
await _urlValidationService.ValidateUrlAsync(url);
// Parse the URL to get the domain (including subdomain)
var uri = new Uri(url);
var domain = uri.Host.Replace(Environment.NewLine, string.Empty);
var baseUrl = uri.Scheme + "://" + uri.Host;
var provider = _cacheFactory.GetCachingProvider(EasyCacheProfiles.Favicon);
var res = await provider.GetAsync<string>(baseUrl, ct);
if (res.HasValue)
{
var sanitizedBaseUrl = baseUrl.Sanitize();
_logger.LogTrace("Kavita has already tried to fetch from {BaseUrl} and failed. Skipping duplicate check", sanitizedBaseUrl);
throw new KavitaException($"Kavita has already tried to fetch from {sanitizedBaseUrl} and failed. Skipping duplicate check");
}
await provider.SetAsync(baseUrl, string.Empty, _cacheTime, ct);
if (FaviconUrlMapper.TryGetValue(baseUrl, out var value))
{
url = value;
}
var correctSizeLink = string.Empty;
try
{
var htmlContent = await FlurlConfiguration.CreateSafeRequest(url)
.GetStringAsync(cancellationToken: ct);
var htmlDocument = new HtmlDocument();
htmlDocument.LoadHtml(htmlContent);
var pngLinks = htmlDocument.DocumentNode.Descendants("link")View on GitHub (pinned to 9c3e540000)
Solutions
- Wait for the favicon cache TTL to expire (or clear the EasyCache Favicon profile) then retry.
- Fix the underlying fetch failure first — confirm the host is reachable and serves a valid favicon link tag.
- If the host is legitimately down, suppress rather than retry to avoid log spam.
- As a caller, treat this KavitaException as 'transient, already handled' and degrade gracefully (e.g. show default icon).
Defensive patterns
Strategy: fallback
Validate before calling
var cached = await provider.GetAsync<string>(baseUrl, ct); if (cached.HasValue) return string.Empty; // already failed recently; degrade silently
Try / catch
try { favicon = await coverDbService.DownloadFaviconAsync(url, fmt, ct); }
catch (KavitaException ex) when (ex.Message.Contains("already tried to fetch"))
{ /* negative cache hit: use default icon, do not retry within TTL */ } Prevention
- Treat the negative-cache message as 'transient, already handled' — don't retry immediately.
- To force a retry, clear the EasyCache Favicon profile or wait for TTL expiry.
- Fix the underlying network failure so the next window succeeds.
When it happens
Trigger: Two favicon fetches for the same baseUrl within the cache TTL window where the first one failed (network error, no link tags, bad fallback). The second call hits the cached failure marker and throws immediately without re-attempting the network.
Common situations: Metadata refresh job and a manual series-detail load both request the same publisher/external-link favicon back-to-back; a transient outage earlier cached a failure and now every retry within TTL short-circuits; misconfigured/blocked external host that consistently fails.
Related errors
- Could not grab favicon from {baseUrl}
- Could not grab favicon from {baseUrl.Sanitize()}
- url-blocked-address
- invalid-metadata-provider
- file-doesnt-exist
AI-assisted analysis of Kareadita/Kavita@9c3e540000 (2026-08-13).
Data as JSON: /api/errors/7566af2cd32fe66c.
Report an issue: GitHub.