Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Repair-Search.ps1 does not run for DevOps 2025

Đang mở
#122 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
azure, elasticsearch, powershell
Lĩnh vực
devops, search, tooling

Hướng nghiên cứu

Bắt đầu với ADO_Server_Diagnostics_2025/Troubleshooting/Repair-Search.ps1 và xác minh dependency của nó với Common.psm1 trong Troubleshooting/Utils. Sau đó kiểm tra Analyzers/Test-IndicesHaveUnsupportedMappings.psm1, đặc biệt là đường dẫn Code và các mapping request của nó, rồi tái hiện lỗi trên Elasticsearch 8. Được xem là hoàn tất khi Repair-Search khởi chạy bằng các file được cung cấp và việc re-index Code hoàn tất mà không có mapping error đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Our migration from Azure DevOps 2022 to 2025 is causing issues after the upgrade from Elasticsearch v7 to v8; the installation did not report any errors, but the Elastic instance was showing an error.
The logs indicated that some indices were still on v6, which is surprising as we were already using a version of DevOps that used Elasticsearch v7.

=> We therefore decided to perform a clean reinstallation and repair the Elasticsearch instance (by deleting the directory and running Repair-Search.ps1).
Unfortunately, the scripts in the ADO_Server_Diagnostics_2025 version appear to have some issues:

  1. The recommended script, Troubleshooting\Repair-Search.ps1, crashes on launch because it depends on a module Common.psm1 that is not
    present in the Utils directory (https://github.com/microsoft/Code-Search/blob/d4bad2abd67c5326d94bf8b00a94af1cd25b2954/ADO_Server_Diagnostics_2025/Troubleshooting/Repair-Search.ps1#L121)
    To resolve this, we tried copying the version available in 2022; this works, but we cannot guarantee it. Could you please fix this issue?

  2. Re-indexing of the “Wiki” and “WorkItem” works without any problems; however, it does not work for the “Code” ItemType.

Image Image

The script correctly identifies that the index is missing in Elasticsearch and attempts to create a mapping using the Test-IndicesHaveUnsupportedMappings method; Elasticsearch returns a 400.
Message: GET _mapping/SourceNoDedupeFileContract failed with status code [400] unexpectedly.

[2026-08-19T13:12:03Z][Verbose] Request Uri = [http://localhost:9200/code_sourcenodedupefilecontractv3_1421_shared_94814f29-47cc-46f9-b048-4caa32360ba3]
[2026-08-19T13:12:03Z][Verbose] Response = [{
    "Content":  null,
    "ErrorMessage":  "Invoke-WebRequest : Le serveur distant a retourné une erreur : (404) Introuvable.\r\nAu caractère C:\\temp\\Code-Search-master\\ADO_Server_Diagnostics_2025\\Troubleshooting\\Utils\\Common.psm1:236 : 25\r\n+ ... $response = Invoke-WebRequest -Method $Method -Uri $uri -Credential $ ...\r\n+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : InvalidOperation : (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebEx \r\n   ception\r\n    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand\r\n \r\n",
    "StatusCode":  404
}]
[2026-08-19T13:12:03Z][Error] Indexing index name in SQL [code_sourcenodedupefilecontractv3_1421_shared_94814f29-47cc-46f9-b048-4caa32360ba3] does not exist in Elasticsearch cluster at [http://localhost:9200/]. Re-indexing is required.
[2026-08-19T13:12:03Z][Warn] Actions recommended are [Restart-Indexing].
[2026-08-19T13:12:03Z][Info] ======================================================================================
[2026-08-19T13:12:03Z][Info] Executing analyzer [Test-IndicesHaveUnsupportedMappings]...
[2026-08-19T13:12:03Z][Verbose] ParentPath = [#\Service\ALMSearch\Settings\].
[2026-08-19T13:12:03Z][Verbose] ChildItem = [DefaultCodeDocumentContractType\].
[2026-08-19T13:12:03Z][Verbose] Supported document contract type for entity type [Code] = [SourceNoDedupeFileContractV3].
[2026-08-19T13:12:03Z][Verbose] Request Uri = [http://localhost:9200/_mapping/SourceNoDedupeFileContract]
[2026-08-19T13:12:03Z][Verbose] Response = [{
    "Content":  null,
    "ErrorMessage":  "Invoke-WebRequest : {\"error\":\"no handler found for uri [/_mapping/SourceNoDedupeFileContract] and method [GET]\"}\r\nAu caractère C:\\temp\\Code-Search-master\\ADO_Server_Diagnostics_2025\\Troubleshooting\\Utils\\Common.psm1:236 : 25\r\n+ ... $response = Invoke-WebRequest -Method $Method -Uri $uri -Credential $ ...\r\n+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : InvalidOperation : (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebEx \r\n   ception\r\n    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand\r\n",
    "StatusCode":  400
}]
[2026-08-19T13:12:03Z][Error] Repair-Search failed with following exception:
Message:
GET _mapping/SourceNoDedupeFileContract failed with status code [400] unexpectedly.
Au caractère C:\temp\Code-Search-master\ADO_Server_Diagnostics_2025\Troubleshooting\Analyzers\Test-IndicesHaveUnsupport
edMappings.psm1:78 : 13
+             throw "GET $command failed with status code [$($response. ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (GET _mapping/So...] unexpectedly.:String) [], RuntimeException
    + FullyQualifiedErrorId : GET _mapping/SourceNoDedupeFileContract failed with status code [400] unexpectedly.
 

Stack Trace:
à Test-IndicesHaveUnsupportedMappings, C:\temp\Code-Search-master\ADO_Server_Diagnostics_2025\Troubleshooting\Analyzers\Test-IndicesHaveUnsupportedMappings.psm1 : ligne 78
à <ScriptBlock>, C:\temp\Code-Search-master\ADO_Server_Diagnostics_2025\Troubleshooting\Repair-Search.ps1 : ligne 155
à <ScriptBlock>, <Aucun fichier> : ligne 1

In the Test-IndicesHaveUnsupportedMappings analyser, there is a specific condition that applies only when the entityType is ‘Code’ and which will trigger a call to _mapping/SourceNoDedupeFileContract and _mapping/SourceNoDedupeFileContractV2

https://github.com/microsoft/Code-Search/blob/d4bad2abd67c5326d94bf8b00a94af1cd25b2954/ADO_Server_Diagnostics_2025/Troubleshooting/Analyzers/Test-IndicesHaveUnsupportedMappings.psm1#L37-L61

Repair-Search_2026-08-19T13-11-58Z.log

Ngôn ngữ chính
PowerShell
Star
57
Fork
68
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/Code-Search

Tất cả issue của microsoft/Code-Search

Issue tương tự

Thêm issue về DevOps

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.