Code & Work Item Search for TFS 2017 – Troubleshooting

The Code Search extension for VSTS/TFS makes it easy to search for information across all your projects, from anywhere and any computer or mobile device, using just a simple web browser. You can narrow down your results and focus in on what you need by using filters.

CodeSearch

For TFS 2017 on-premises, Code Search includes Elasticsearch and will be configured on a server running TFS 2017. Work Item Search is now also relying on this functionality.

For large TFS enterprise environments with a lot of big code repositories the Search service might impact the performance of the TFS Application Tier when the Search service has been installed/configured on the same server.

These type of performance issues have been the case for a specific customer and the IT operations team have seen various huge CPU spikes for the Elasticsearch service on the TFS Application Tier.

Together with an in-place upgrade to TFS 2017 Update 3, I recommended to move the Search service to a dedicated server in order to avoid performance issues on the TFS Application Tier. Compared to the typical straightforward TFS upgrade wizard experience, the move of the Search service to another service contains a number of manual activities.

SearchConfiguration

After completing all actions on the dedicated Search server and making sure that the TFS Application Tier could access the Search service on the Search Server via the default port 9200, I was able to complete the upgrade.

The TFS upgrade was a success, except the Search service was not working anymore.

SNAGHTML42be1913

The TFS Administration Console was showing no errors/warnings about the installed Search component.

SNAGHTML42c07979

Looking into some troubleshooting actions from the documentation didn’t help me to get to the root issue because the Search service seemed to be up-and-running, but wasn’t processing any data.

SNAGHTML42c6ccdc

Time to get in contact with the VSTS/TFS Product Team to log this incident and sharing all possible log files (detailed instructions how to do this) and look for potential solutions.

In the end – after some analysis of the logs – I was requested to perform a cleanup of the Index Data and to restart the indexing process on all Team Project Collections.

After going through this entire process, I was happy to see the ElasticSearch process coming to life again and claiming lots of CPU.

image

Also the TFS Search Data/Index folder on the Search Server was quickly getting flooded with a lot of data.

image

Mission finally accomplished! Upgraded to the lastest version of TFS 2017 and moving the Search Service to another server to avoid performance issues on the TFS Application Tier.

If you don’t want to get bothered with all this infrastructure and configuration, there’s an easy way out … Migrate your TFS on-premises environment to VSTS! 🙂

Leave a comment