{"record":{"id":"05141e6c7fc771ce","repo":"Jackett/Jackett","slug":"invalid-passkey-configured-expected-length-32-4","errorCode":null,"errorMessage":"invalid passkey configured: expected length: 32, 48, or 56, got ","messagePattern":"invalid passkey configured: expected length: 32, 48, or 56, got ","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Jackett.Common/Indexers/Definitions/AnimeBytes.cs","lineNumber":123,"sourceCode":"            caps.Categories.AddCategoryMapping(\"audio\", TorznabCatType.Audio, \"Music\");\n            caps.Categories.AddCategoryMapping(\"gamec[game]\", TorznabCatType.PCGames, \"Game\");\n            caps.Categories.AddCategoryMapping(\"gamec[visual_novel]\", TorznabCatType.PCGames, \"Game Visual Novel\");\n            caps.Categories.AddCategoryMapping(\"printedtype[manga]\", TorznabCatType.BooksComics, \"Manga\");\n            caps.Categories.AddCategoryMapping(\"printedtype[oneshot]\", TorznabCatType.BooksComics, \"Oneshot\");\n            caps.Categories.AddCategoryMapping(\"printedtype[anthology]\", TorznabCatType.BooksComics, \"Anthology\");\n            caps.Categories.AddCategoryMapping(\"printedtype[manhwa]\", TorznabCatType.BooksComics, \"Manhwa\");\n            caps.Categories.AddCategoryMapping(\"printedtype[light_novel]\", TorznabCatType.BooksComics, \"Light Novel\");\n            caps.Categories.AddCategoryMapping(\"printedtype[artbook]\", TorznabCatType.BooksComics, \"Artbook\");\n\n            return caps;\n        }\n\n        public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)\n        {\n            LoadValuesFromJson(configJson);\n\n            if (ConfigData.Passkey.Value.Length is not 32 and not 48 and not 56)\n                throw new Exception(\"invalid passkey configured: expected length: 32, 48, or 56, got \" + ConfigData.Passkey.Value.Length);\n\n            var results = await PerformQuery(new TorznabQuery());\n            if (!results.Any())\n                throw new Exception(\"no results found, please report this bug\");\n\n            IsConfigured = true;\n            SaveConfig();\n            return IndexerConfigurationStatus.Completed;\n        }\n\n        protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)\n        {\n            var releases = new List<ReleaseInfo>();\n\n            releases.AddRange(await GetResults(query, \"anime\", CleanSearchTerm(query.SanitizedSearchTerm.Trim())));\n\n            if (ContainsMusicCategories(query.Categories))\n            {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/Jackett/Jackett/blob/adff1941476d8057a430cf55360356c1d23e971e/src/Jackett.Common/Indexers/Definitions/AnimeBytes.cs#L105-L141","documentation":"Thrown in AnimeBytes.ApplyConfiguration when the configured passkey length is not exactly 32, 48, or 56 characters. AnimeBytes has shipped passkeys of different lengths over time; this allowlist accepts the known-good ones and rejects everything else, appending the actual length received.","triggerScenarios":"LoadValuesFromJson runs, then the length check fails because ConfigData.Passkey.Value.Length is not in {32, 48, 56}.","commonSituations":"Passkey copied with leading/trailing whitespace; wrong field copied (e.g. username or a hash); passkey truncated by a copy mistake; legacy passkey format after a site-side format change.","solutions":["Re-copy the passkey from the AnimeBytes profile page and trim any whitespace.","Confirm the pasted string is exactly 32, 48, or 56 characters.","If your current valid passkey is a different length, the indexer definition may need updating — report it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var passkey = ConfigData.Passkey.Value?.Trim() ?? \"\";\nif (passkey.Length is not 32 and not 48 and not 56)\n    throw new ArgumentOutOfRangeException(nameof(passkey),\n        $\"Passkey length {passkey.Length} is not one of 32/48/56.\");","typeGuard":"static bool IsValidAnimeBytesPasskey(string key) =>\n    !string.IsNullOrEmpty(key) && key.Length is 32 or 48 or 56;","tryCatchPattern":"if (ConfigData.Passkey.Value?.Trim().Length is not (32 or 48 or 56))\n    return IndexerConfigurationStatus.RequiresTesting; // do not call ApplyConfiguration's PerformQuery\nawait indexer.ApplyConfiguration(configJson);","preventionTips":["Trim the passkey before saving.","Validate length is 32/48/56 before invoking ApplyConfiguration.","Re-copy from the AnimeBytes profile if the length is off."],"tags":["authentication","validation","passkey","animebytes","configuration"],"backgroundTag":null,"analyzedSha":"adff1941476d8057a430cf55360356c1d23e971e","analyzedAt":"2026-08-13T15:06:32.872Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}