Handle edge case where a user triggers an install when the server has no data directory
This commit is contained in:
parent
56af6fc1f8
commit
5d070cbdc5
|
@ -447,6 +447,14 @@ func (ip *InstallationProcess) Execute() (string, error) {
|
||||||
NetworkMode: container.NetworkMode(config.Get().Docker.Network.Mode),
|
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")
|
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.
|
// Remove the temporary directory when the installation process finishes for this server container.
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user