Overview
If you experience issues with your search results, the root cause might be related to the ElasticSearch (ES) indexes being outdated. The best way to fix this issue is to reset the ElasticSearch Backfill Index, as a result, ElasticSearch will rebuild all its internal indexes providing up-to-date search results.
Diagnosis
Several situations would require rebuilding the Elastic Search indexes:
- Cases are not listed correctly by a filter or search;
- Deleted or spam cases still showing in the case list
- Search is not showing the cases or showing incorrect case data;
- Cases are showing on a particular type of device and not on others;
- Server-side event causes the ElasticSearch data to be inconsistent (ex: incomplete regular Indexer Backfill);
- The ES Indexer Backfill being stuck on 99.9% after migrating from FogBugz On Demand to On-Premises;
- ElasticSearch data is corrupted.
In most of these cases having an ElasticSearch Indexer Backfill solves the issue.
This article provides information on how to forcefully reset the ElasticSearch Indexer Backfill.
Prerequisites
- Administrator access to the FogBugz site.
- The process described below can only be executed from the same server that is hosting the FogBugz IIS instance and by using an Administrator account.
Solution
ElasticSearch (ES) is the search engine that indexes all FogBugz data to provide quick search results for the users.
Backfills are the process by which entities (cases, emails, etc) are progressively indexed by ElasticSearch from newest to oldest until every entity has been indexed. This process usually runs in the background.
WARNING: ElasticSearch Backfill process affects the product experience (FogBugz might become slower, search results might be outdated during the backfill process). Thus it is recommended to have it done outside business hours to reduce the impact on the users.
Please execute the methods listed below in their order. If the first method does not fix your search issues, proceed to the next one.
Method 1: Restart FogBugz ElasticSearch service
- Log in to the FogBugz server that is hosting the FogBugz IIS, aka the webserver.
- Restart the FogBugz ElasticSearch service.
- If this does not resolve the issue, proceed to the next step.
Method 2: Using the Start Indexer Backfill from the ES Debug Page
Please note: this process is an easy and quicker backfill ElasticSearch task compared to the process described under Method 3, because this only overwrites the current data and does not remove data from ElasticSearch. As such it does not fix the errors caused by the deleted, lost, or corrupted cases (when cases show up in the case list, but when clicked the message Case #XXXX does not exist is displayed.
- Connect to the ES Debug page link:
https://[your_fogbugz_server]/f/debug/es
- Choose the entity type that for which you would like to start the indexer backfill
- bug document type - for cases
- wikipage document type - for wiki pages
- discusstopic document type - for discussion topics
-
Click on Start Indexer Backfill button.
- Monitor the Backfill Progress:
Method 3: Reset ElasticSearch Backfill
Note: This method causes incomplete search and filter results until backfill completes.
This method is a more thorough method compared to Method 2, because it removes the existing data from ElasticSearch and re-writes it based on the data stored in FogBugz database tables. Due to this process, it also takes more time.
- From the FogBugz server, go to the following URL by using a web browser (preferably Chrome).
https://[your_fogbugz_site]/f/tasks/indexer/{entity}/reset-backfill
- In the URL, replace
[your_fogbugz_site]
with the webserver FQDN that hosts the FogBugz installation. - Note: The
{account}
is the name of the FogBugz account for which you want to get the index to be reset. The{entity}
is eithercases
,wikipages
, ordiscusstopics
- If you are not running FogBugz over a secure channel, replace HTTPS in the URL with HTTP.
- In the URL, replace
- The link will return a similar result as in the screenshot below. Note the Backfill ID.
- You will use this Backfill ID on the progress monitoring page at the next step to confirm that you are verifying the progress of the backfill reset process started by yourself.
- If you have access to the
fbhosted
configuration database (not the case for On-Demand accounts), you can use this ID to retrieve the status from thetblESBackfillTask
table if needed.
- Monitor the Backfill Progress by using the ES Debug page link as described under Method 2 - Step 4:
https://[your_fogbugz_server]/f/debug/es
Method 4: Full ElasticSearch Backfill reset (for the whole Account)
Note: This method causes incomplete search and filter results until backfills complete.
This method can be executed in two ways:
- using the link:
https://[your_fogbugz_server]/f/tasks/indexer/reset-account
- using the Reset Account button from the debug page
The result in both cases will be the same: ElasticSearch backfill reset will be executed for all three entity types: cases, wikis, discussion topics (Method 3 initiated in one step for all three entity types).
Method 5: Restart the stuck Backfill process
- If the progress of the Backfill gets stuck for a long period of time and the Indexing Backfill is not completed, insert the Backfill ID that you acquired using Method 3 - Step 2 into the following link and press Enter.
https://your_fogbugz_server/f/tasks/indexer/backfill?ixESBackfillTask={ID returned at Method 2 - Step 2}
- Go to ES Debug page link presented in Method 2 - Step 4 and monitor the progress until the Backfill Indexing is completed.
- Repeat Step 1 maximum three times until the Backfill Indexing is completed. If the backfill indexing is not completed three consecutive times than you might be having issues with the FogBugz database tables indexes. In this case, proceed to the next method.
Method 6: Rebuild FogBugz Database Table Indexes
If you need to restart the backfill process several times to get the Backfill Indexing task to be completed then there might be issues with the data retrieval from the FogBugz databases. In this case, as the first step, we recommend you check the index fragmentation of the database tables and rebuild the database table indexes if needed. Note: After the DB index rebuild, restart the Backfill reset process again.
Testing
When the backfill is completed the ES Debug page shows that the process is 100.00% complete.
After completing the backfill reset process, the cases should list correctly in the case list or filter views.
If none of the methods listed above resolve your issue, please contact us.