{"record":{"id":"75950aaae54b46e1","repo":"gohugoio/hugo","slug":"multihost-change-detected-please-restart-server","errorCode":null,"errorMessage":"multihost change detected, please restart server","messagePattern":"multihost change detected, please restart server","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"commands/hugobuilder.go","lineNumber":1181,"sourceCode":"\n\treturn\n}\n\nfunc (c *hugoBuilder) reloadConfig() error {\n\tc.r.resetLogs()\n\tc.r.configVersionID.Add(1)\n\n\tif err := c.withConfOrOldConfE(func(conf *commonConfig) error {\n\t\toldConf := conf\n\t\tc.conf = nil\n\t\tnewConf, err := c.r.ConfigFromConfig(configKey{counter: c.r.configVersionID.Load()}, conf)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsameLen := len(oldConf.configs.Languages) == len(newConf.configs.Languages)\n\t\tif !sameLen {\n\t\t\tif oldConf.configs.IsMultihost || newConf.configs.IsMultihost {\n\t\t\t\treturn errors.New(\"multihost change detected, please restart server\")\n\t\t\t}\n\t\t}\n\t\tc.conf = newConf\n\t\treturn nil\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\tif c.onConfigLoaded != nil {\n\t\tif err := c.onConfigLoaded(true); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":1163,"sourceCodeEnd":1198,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/commands/hugobuilder.go#L1163-L1198","documentation":"During live config reload (reloadConfig), if the number of languages changes AND either the old or new config is multihost, the server cannot safely hot-swap and asks the user to restart, because multihost requires per-language port/listener reshuffling the running server cannot reconfigure.","triggerScenarios":"Editing config while `hugo server` runs so that the language count changes and IsMultihost is true on either side (hugobuilder.go:1178-1182).","commonSituations":"Adding or removing a language in a multihost setup; switching a multihost config to single-host by editing language blocks; toggling per-language baseURL.","solutions":["Stop and restart `hugo server` after editing languages in a multihost project","Avoid changing the number of languages during a live multihost session","Make language changes in a single edit, then restart"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restart the server when restructuring languages in a multihost project","Keep the language set stable during live editing"],"tags":["config","server","multihost","hugo","live-reload"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}