Handle edge case where a user triggers an install when the server has no data directory

This commit is contained in:
Dane Everitt 2021-01-21 20:58:52 -08:00
parent 56af6fc1f8
commit 5d070cbdc5
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -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() {