diff options
author | zeripath <art27@cantab.net> | 2020-04-22 21:16:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 16:16:58 -0400 |
commit | b51fd30522af31eaf22ab15a826f9ee18fd53969 (patch) | |
tree | 28a67830f755685f37fd3856ab69472c5214ce1f /modules/indexer | |
parent | 316db0fe79a5d0e48c5171c937e56ef6b6b8a3e1 (diff) | |
download | gitea-b51fd30522af31eaf22ab15a826f9ee18fd53969.tar.gz gitea-b51fd30522af31eaf22ab15a826f9ee18fd53969.zip |
Log the indexer path on failure (#11172)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/indexer')
-rw-r--r-- | modules/indexer/code/indexer.go | 2 | ||||
-rw-r--r-- | modules/indexer/issues/indexer.go | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/modules/indexer/code/indexer.go b/modules/indexer/code/indexer.go index 3e90f769df..a0f91ce4b5 100644 --- a/modules/indexer/code/indexer.go +++ b/modules/indexer/code/indexer.go @@ -68,7 +68,7 @@ func Init() { if err := recover(); err != nil { log.Error("PANIC whilst initializing repository indexer: %v\nStacktrace: %s", err, log.Stack(2)) log.Error("The indexer files are likely corrupted and may need to be deleted") - log.Error("You can completely remove the \"%s\" directory to make Gitea recreate the indexes", setting.Indexer.RepoPath) + log.Error("You can completely remove the %q directory to make Gitea recreate the indexes", setting.Indexer.RepoPath) cancel() indexer.Close() close(waitChannel) diff --git a/modules/indexer/issues/indexer.go b/modules/indexer/issues/indexer.go index d2079e9dbf..42f0854576 100644 --- a/modules/indexer/issues/indexer.go +++ b/modules/indexer/issues/indexer.go @@ -147,6 +147,7 @@ func InitIssueIndexer(syncReindex bool) { if err := recover(); err != nil { log.Error("PANIC whilst initializing issue indexer: %v\nStacktrace: %s", err, log.Stack(2)) log.Error("The indexer files are likely corrupted and may need to be deleted") + log.Error("You can completely remove the %q directory to make Gitea recreate the indexes", setting.Indexer.IssuePath) holder.cancel() log.Fatal("PID: %d Unable to initialize the Bleve Issue Indexer at path: %s Error: %v", os.Getpid(), setting.Indexer.IssuePath, err) } @@ -155,7 +156,7 @@ func InitIssueIndexer(syncReindex bool) { exist, err := issueIndexer.Init() if err != nil { holder.cancel() - log.Fatal("Unable to initialize Bleve Issue Indexer: %v", err) + log.Fatal("Unable to initialize Bleve Issue Indexer at path: %s Error: %v", setting.Indexer.IssuePath, err) } populate = !exist holder.set(issueIndexer) @@ -172,11 +173,11 @@ func InitIssueIndexer(syncReindex bool) { graceful.GetManager().RunWithShutdownFns(func(_, atTerminate func(context.Context, func())) { issueIndexer, err := NewElasticSearchIndexer(setting.Indexer.IssueConnStr, "gitea_issues") if err != nil { - log.Fatal("Unable to initialize Elastic Search Issue Indexer: %v", err) + log.Fatal("Unable to initialize Elastic Search Issue Indexer at connection: %s Error: %v", setting.Indexer.IssueConnStr, err) } exist, err := issueIndexer.Init() if err != nil { - log.Fatal("Unable to issueIndexer.Init: %v", err) + log.Fatal("Unable to issueIndexer.Init with connection %s Error: %v", setting.Indexer.IssueConnStr, err) } populate = !exist holder.set(issueIndexer) |