{"record":{"id":"674cfb30cfc39d76","repo":"gohugoio/hugo","slug":"no-site-found-for-matrix-s","errorCode":null,"errorMessage":"no site found for matrix %s","messagePattern":"no site found for matrix (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"hugolib/hugo_sites.go","lineNumber":268,"sourceCode":"func (h *HugoSites) Close() error {\n\treturn h.Deps.Close()\n}\n\nfunc (h *HugoSites) isRebuild() bool {\n\treturn h.BuildState.IsRebuild()\n}\n\nfunc (h *HugoSites) resolveFirstSite(matrix sitesmatrix.VectorStore) *Site {\n\tvar s *Site\n\tvar ok bool\n\tmatrix.ForEachVector(func(v sitesmatrix.Vector) bool {\n\t\tif s, ok = h.sitesVersionsRolesMap[v]; ok {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t})\n\tif s == nil {\n\t\tpanic(fmt.Sprintf(\"no site found for matrix %s\", matrix))\n\t}\n\n\treturn s\n}\n\ntype buildCounters struct {\n\tcontentRenderCounter atomic.Uint64\n\tpageRenderCounter    atomic.Uint64\n}\n\nfunc (c *buildCounters) loggFields() logg.Fields {\n\treturn logg.Fields{\n\t\t{Name: \"pages\", Value: c.pageRenderCounter.Load()},\n\t\t{Name: \"content\", Value: c.contentRenderCounter.Load()},\n\t}\n}\n\ntype fatalErrorHandler struct {","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/hugo_sites.go#L250-L286","documentation":"An internal panic in HugoSites.resolveFirstSite (hugolib/hugo_sites.go:268) when no configured site matches any vector in the given VectorStore. resolveFirstSite iterates every vector and looks it up in sitesVersionsRolesMap; if none match, the content's site dimensions (language/version/role) have no corresponding Site.","triggerScenarios":"Content carries a site vector (language or version) that is not declared in the site matrix during a build or partial rebuild.","commonSituations":"Adding content for a language/version not declared in config; a misconfigured [languages]/versions matrix; an internal bookkeeping error during incremental rebuilds.","solutions":["Declare the language/version in hugo config before adding content for it","Verify [languages] and versions configuration matches content front matter","Report a Hugo bug if all configured languages appear to be present"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Internal: verify a site exists for the matrix before resolving.\nfound := false\nmatrix.ForEachVector(func(v sitesmatrix.Vector) bool {\n    if _, ok := h.sitesVersionsRolesMap[v]; ok {\n        found = true\n        return false\n    }\n    return true\n})\nif !found {\n    return errors.New(\"no site configured for the given matrix\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare every language/version in config before adding content for it","Keep [languages]/versions config in sync with content front matter","Report Hugo bugs if this surfaces with a fully configured matrix"],"tags":["hugolib","sites","matrix","internal","panic"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}