diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 9f2f0933d4e..47e0ae2cda1 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -465,6 +465,13 @@ func getAppPath() (string, error) { appPath, err = exec.LookPath(os.Args[0]) } + if err != nil { + // FIXME: Once we switch to go 1.19 use !errors.Is(err, exec.ErrDot) + if !strings.Contains(err.Error(), "cannot run executable found relative to current directory") { + return "", err + } + appPath, err = filepath.Abs(os.Args[0]) + } if err != nil { return "", err }