diff --git a/server/install.go b/server/install.go index e72555e..fe0fcea 100644 --- a/server/install.go +++ b/server/install.go @@ -447,6 +447,14 @@ func (ip *InstallationProcess) Execute() (string, error) { NetworkMode: container.NetworkMode(config.Get().Docker.Network.Mode), } + // Ensure the root directory for the server exists properly before attempting + // to trigger the reinstall of the server. It is possible the directory would + // not exist when this runs if Wings boots with a missing directory and a user + // triggers a reinstall before trying to start the server. + if err := ip.Server.EnsureDataDirectoryExists(); err != nil { + return "", err + } + ip.Server.Log().WithField("install_script", ip.tempDir()+"/install.sh").Info("creating install container for server process") // Remove the temporary directory when the installation process finishes for this server container. defer func() {