Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19498

Importing projects/repositories via export/import does not trigger search indexing

XMLWordPrintable

      Issue Summary

      When migrating repositories from one DC instance to another using the Export and import projects and repositories method, the imported repositories are not searchable

      This is reproducible on Data Center: (yes) 

      Steps to Reproduce

      1. Export a project using Exporting
      2. Import a project to another instance using Importing -
      3. Search for content in the main branch of one of the imported repositories

      Expected Results

      After the import, search indexing is triggered for the imported repositories, and the content is searchable

      Actual Results

      While the index for searching the project/repository name is indeed created ("bitbucket-project" and "bitbucket-repository", the following index is not: "bitbucket-state-index", and the "bitbucket-search" index is not populated with content from those repositories.

      The repositories are not searchable.

      There is no exception thrown in the atlassian-bitbucket.log file however the IndexFilesResult lines are missing in debug, and only IndexResult is shown after migration

      2024-06-20 14:58:17,908 DEBUG [search-indexing:thread-1]  c.a.b.i.s.i.e.DefaultIndexEventWorker Indexing - Results for project TEST (id: 22) is: IndexResult{created=true, id='22', sequenceNumber='SequenceNumber[sequenceNumber=14, primaryTerm=9]', version=1}
      2024-06-20 14:58:17,908 DEBUG [search-indexing:thread-1]  c.a.b.i.s.i.e.DefaultIndexEventWorker Indexing - Completed indexing for project TEST(id: 22)
      2024-06-20 14:58:18,720 DEBUG [search-indexing:thread-1]  c.a.b.i.s.i.e.DefaultIndexEventWorker Indexing - Results for repository A2251/repo--test (id: 12) is: IndexResult{created=true, id='12', sequenceNumber='SequenceNumber[sequenceNumber=28, primaryTerm=9]', version
      

      When querying the index state using the Search server API

      curl -u <SEARCH_USERNAME>:<SEARCH_PASSWORD> -X GET <search-server>:9200/bitbucket-index-state/_doc/<REPO_ID>
      

      the index is not found

      {"_index":"bitbucket-index-state","_type":"_doc","_id":"<REPO_ID>","found":false}
      

      Workaround

      After the projects/repositories are migrated issue the following API statement to trigger reindexing - only the newly imported repositories will be indexed

      curl -u username:password -X POST -v -H 'Content-Type: application/json' -H 'Accept: application/json' <BITBUCKET_URL>/rest/indexing/latest/sync
      

              01bcfab7c8bf Tom Daffurn
              tathanassiadou Themis
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: