{"record":{"id":"b7902d89f9a7f036","repo":"LykosAI/StabilityMatrix","slug":"documentation-repository-or-branch-not-found","errorCode":null,"errorMessage":"Documentation repository or branch not found.","messagePattern":"Documentation repository or branch not found\\.","errorType":"exception","errorClass":"DocumentationNotAvailableException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Services/DocumentationService.cs","lineNumber":168,"sourceCode":"\n    private async Task<List<string>> FetchDocsPathsAsync(CancellationToken cancellationToken)\n    {\n        // Octokit calls don't take a CancellationToken; the tree response is small and\n        // the surrounding cache logic still honors cancellation.\n        TreeResponse tree;\n        try\n        {\n            tree = await gitHubClient\n                .Git.Tree.GetRecursive(\n                    DocumentationConstants.Owner,\n                    DocumentationConstants.Repo,\n                    DocumentationConstants.Branch\n                )\n                .ConfigureAwait(false);\n        }\n        catch (NotFoundException e)\n        {\n            throw new DocumentationNotAvailableException(\"Documentation repository or branch not found.\", e);\n        }\n\n        cancellationToken.ThrowIfCancellationRequested();\n\n        var prefix = DocumentationConstants.DocsRoot + \"/\";\n\n        var paths = tree\n            .Tree.Where(item =>\n                item.Type == TreeType.Blob && item.Path.StartsWith(prefix, StringComparison.Ordinal)\n            )\n            .Select(item => item.Path[prefix.Length..])\n            .Where(IsDocPage)\n            .ToList();\n\n        if (paths.Count == 0)\n            throw new DocumentationNotAvailableException(\n                \"Documentation folder is empty or not available yet.\"\n            );","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Services/DocumentationService.cs#L150-L186","documentation":"FetchDocsPathsAsync lists the documentation repo contents via a git provider; when the repository or the configured branch does not exist the API throws NotFoundException, which is translated into DocumentationNotAvailableException. It means the configured docs source (repo/branch) cannot be found, so documentation cannot be loaded.","triggerScenarios":"Calling GetSectionsAsync (or FetchDocsPathsAsync directly) when DocumentationConstants.RepoName/Owner/Branch point at a repository or branch that no longer exists, the repo is private without credentials, or there is no network access causing the provider to report not-found.","commonSituations":"Docs repo renamed or branch renamed (e.g. 'main' -> 'master'); offline or firewalled environment; stale app version pointing at an archived repo; missing/invalid git credentials for a private docs repo.","solutions":["Verify DocumentationConstants owner/repo/branch match the actual repository and branch names","Check network connectivity and any proxy settings, then retry","Catch DocumentationNotAvailableException around GetSectionsAsync and show a 'documentation unavailable' fallback UI","Pin the app to a current release whose constants point at an existing branch, or update the constants"],"exampleFix":"// before\nvar sections = await documentationService.GetSectionsAsync();\n// after\nReadOnlyCollection<DocsSection> sections;\ntry\n{\n    sections = await documentationService.GetSectionsAsync();\n}\ncatch (DocumentationNotAvailableException)\n{\n    sections = new ReadOnlyCollection<DocsSection>(new List<DocsSection>());\n    // show \"docs unavailable\" state\n}","handlingStrategy":"try-catch","validationCode":"// pre-check remote docs availability\nvar head = await httpClient.GetAsync(\n    $\"https://api.github.com/repos/{DocumentationConstants.Owner}/{DocumentationConstants.RepoName}/branches/{DocumentationConstants.Branch}\",\n    HttpCompletionOption.ResponseHeadersOnly);\nif (!head.IsSuccessStatusCode)\n    throw new DocumentationNotAvailableException(\"Docs repo/branch unreachable\");","typeGuard":"static bool IsDocsRepoConfigured(DocumentationConstants c) =>\n    !string.IsNullOrWhiteSpace(c.Owner) && !string.IsNullOrWhiteSpace(c.RepoName) && !string.IsNullOrWhiteSpace(c.Branch);","tryCatchPattern":"try\n{\n    sections = await docs.GetSectionsAsync();\n}\ncatch (DocumentationNotAvailableException ex)\n{\n    logger.LogWarning(ex, \"Docs repo/branch not found\");\n    ShowDocsUnavailableState();\n}","preventionTips":["Keep DocumentationConstants owner/repo/branch in sync with the live docs repository","Handle renamed branches (main vs master) explicitly","Catch DocumentationNotAvailableException at the UI boundary with a retry/offline state","Check network/proxy availability before fetching docs"],"tags":["network","git","documentation","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}