{"record":{"id":"c611833ceac63552","repo":"Kareadita/Kavita","slug":"could-not-grab-publisher-image-for-publishername","errorCode":null,"errorMessage":"Could not grab publisher image for {publisherName}","messagePattern":"Could not grab publisher image for (.+?)","errorType":"exception","errorClass":"KavitaException","httpStatus":null,"severity":"info","filePath":"Kavita.Services/Metadata/CoverDbService.cs","lineNumber":209,"sourceCode":"    {\n        try\n        {\n            // Sanitize user input\n            publisherName = publisherName.Replace(Environment.NewLine, string.Empty).Replace(\"\\r\", string.Empty).Replace(\"\\n\", string.Empty);\n            var provider = _cacheFactory.GetCachingProvider(EasyCacheProfiles.Publisher);\n            var res = await provider.GetAsync<string>(publisherName, ct);\n            if (res.HasValue)\n            {\n                _logger.LogDebug(\"Kavita has already tried to fetch Publisher: {PublisherName} and failed. Skipping duplicate check\", publisherName);\n                // Do not throw to prevent duplicate log spam when visiting series\n                return string.Empty;\n            }\n\n            await provider.SetAsync(publisherName, string.Empty, _cacheTime, ct);\n            var publisherLink = await FallbackToKavitaReaderPublisher(publisherName);\n            if (string.IsNullOrEmpty(publisherLink))\n            {\n                throw new KavitaException($\"Could not grab publisher image for {publisherName}\");\n            }\n\n            // Create the destination file path\n            var filename = ImageService.GetPublisherFormat(publisherName, encodeFormat);\n\n            _logger.LogTrace(\"Fetching publisher image from {Url}\", publisherLink.Sanitize());\n            await DownloadImageFromUrl(publisherName, encodeFormat, publisherLink, _directoryService.PublisherDirectory);\n\n            _logger.LogDebug(\"Publisher image for {PublisherName} downloaded and saved successfully\", publisherName.Sanitize());\n\n            return filename;\n        } catch (Exception ex)\n        {\n            _logger.LogError(ex, \"Error downloading image for {PublisherName}\", publisherName.Sanitize());\n            throw;\n        }\n    }\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/Kareadita/Kavita/blob/9c3e5400007f8a0282f7d883f2ad5e71716e514d/Kavita.Services/Metadata/CoverDbService.cs#L191-L227","documentation":"Thrown by DownloadPublisherImageAsync when FallbackToKavitaReaderPublisher(publisherName) returns an empty string — Kavita's curated publisher-override list (publishers.txt, cached or fetched from the NewHost) contains no match for the publisher. Unlike the favicon path, the negative result is cached (SetAsync) so subsequent lookups short-circuit by returning empty rather than rethrowing.","triggerScenarios":"Series metadata references a publisher whose name isn't in the remote publishers.txt override file (and has no alias entry). First call throws this; later calls within TTL return empty (no throw) due to the cached failure marker.","commonSituations":"Obscure/niche publisher not yet curated in Kavita's override list; publisher name in metadata has trailing whitespace or alternate transliteration that doesn't alias-match; upstream override endpoint is unreachable so the list is empty.","solutions":["Normalize the publisher name (trim, consistent casing) in metadata so it can alias-match the override list.","Confirm Kavita can fetch the publishers.txt override file from NewHost (network/DNS check).","If the publisher genuinely has no curated art, accept the empty result and let the UI show a default.","Contribute the publisher to the upstream override list if you maintain it."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"var publisherLink = await FallbackToKavitaReaderPublisher(publisherName);\nif (string.IsNullOrEmpty(publisherLink)) return null; // no art; UI uses default","typeGuard":null,"tryCatchPattern":"try { img = await coverDbService.DownloadPublisherImageAsync(name, fmt, ct); }\ncatch (KavitaException ex) when (ex.Message.Contains(\"Could not grab publisher image\"))\n{ img = null; }","preventionTips":["Normalize publisher names in metadata (trim, consistent casing).","Ensure the publishers.txt override file is reachable.","Accept uncurated publishers have no art; degrade gracefully."],"tags":["publisher","metadata","cover-image","fallback"],"backgroundTag":null,"analyzedSha":"9c3e5400007f8a0282f7d883f2ad5e71716e514d","analyzedAt":"2026-08-13T19:06:05.897Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}