diff --git a/modules/setting/setting.go b/modules/setting/setting.go index bb2281f13b244..5fe4682968b34 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -464,6 +464,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 }