gohugoio/hugo · warning
multihost change detected, please restart server
Error message
multihost change detected, please restart server
What it means
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.
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
Defensive patterns
Strategy: validation
Prevention
- Restart the server when restructuring languages in a multihost project
- Keep the language set stable during live editing
When it happens
Trigger: Editing config while `hugo server` runs so that the language count changes and IsMultihost is true on either side (hugobuilder.go:1178-1182).
Common situations: Adding or removing a language in a multihost setup; switching a multihost config to single-host by editing language blocks; toggling per-language baseURL.
Related errors
- --appendPort=false not supported when in multihost mode
- cache dir contains unresolved placeholders
- cannot unmarshal CSV into %T: invalid targetType: expected…
- cannot use --renderToMemory with --destination
- config needs a filename
AI-assisted analysis of gohugoio/hugo@52c9bd7908 (2026-08-09).
Data as JSON: /api/errors/75950aaae54b46e1.
Report an issue: GitHub.
Appendix: source
Thrown at commands/hugobuilder.go:1181
return
}
func (c *hugoBuilder) reloadConfig() error {
c.r.resetLogs()
c.r.configVersionID.Add(1)
if err := c.withConfOrOldConfE(func(conf *commonConfig) error {
oldConf := conf
c.conf = nil
newConf, err := c.r.ConfigFromConfig(configKey{counter: c.r.configVersionID.Load()}, conf)
if err != nil {
return err
}
sameLen := len(oldConf.configs.Languages) == len(newConf.configs.Languages)
if !sameLen {
if oldConf.configs.IsMultihost || newConf.configs.IsMultihost {
return errors.New("multihost change detected, please restart server")
}
}
c.conf = newConf
return nil
}); err != nil {
return err
}
if c.onConfigLoaded != nil {
if err := c.onConfigLoaded(true); err != nil {
return err
}
}
return nil
}
View on GitHub (pinned to 52c9bd7908)