From 7bba1d4fd6abf602ca3389e366ad24c9cc296893 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Thu, 7 May 2020 21:08:06 -0700 Subject: [PATCH] I guess this error could happen? Just return a crash state and let wings figure it out; closes #2003 (I hope?) --- server/environment_docker.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/environment_docker.go b/server/environment_docker.go index 523b750..1c0e962 100644 --- a/server/environment_docker.go +++ b/server/environment_docker.go @@ -350,6 +350,19 @@ func (d *DockerEnvironment) Destroy() error { func (d *DockerEnvironment) ExitState() (uint32, bool, error) { c, err := d.Client.ContainerInspect(context.Background(), d.Server.Uuid) if err != nil { + // I'm not entirely sure how this can happen to be honest. I tried deleting a + // container _while_ a server was running and wings gracefully saw the crash and + // created a new container for it. + // + // However, someone reported an error in Discord about this scenario happening, + // so I guess this should prevent it? They didn't tell me how they caused it though + // so thats a mystery that will have to go unsolved. + // + // @see https://github.com/pterodactyl/panel/issues/2003 + if client.IsErrNotFound(err) { + return 1, false, nil + } + return 0, false, errors.WithStack(err) }