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

Search invalid mapping errors after upgrading to Bitbucket 8.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Highest
    • None
    • 8.0.0
    • Search

    Description

      Issue Summary

      Upgrading to Bitbucket 8.0 with existing search server indexes causes ERROR logging on startup relating to a missing archived field. Search functionality in general is not impacted, but it is recommended to follow the workaround steps outlined below immediately after upgrade.

      This impacts upgrades from either Bitbucket 7.21 when using the bundled search server, or from any Bitbucket version when using an external search server. Upgrading from versions of Bitbucket prior to 7.21 when using the bundled search server, or fresh installs of Bitbucket 8.0, are not impacted.

      Steps to Reproduce

      1. Start Bitbucket 7.21 with the bundled search server, or any Bitbucket version with an external search server
      2. Push a repository and verify code search is working
      3. Stop Bitbucket
      4. Upgrade to Bitbucket 8.0 and start Bitbucket

      Expected Results

      There are no search errors after upgrading.

      Actual Results

      The following errors are logged in the atlassian-bitbucket.log file:

      2022-05-09 18:00:44,906 INFO  [Caesium-1-1]  c.a.b.i.s.i.jobs.StartupChecksJob Running startup jobs for search
      2022-05-09 18:00:44,986 ERROR [Caesium-1-1]  c.a.b.i.s.i.IndexingSynchronizationService The mapping for type 'bitbucke
      t-search/file' in the search server is invalid. Errors: [Field 'archived' is missing]
      2022-05-09 18:00:44,986 ERROR [Caesium-1-1]  c.a.b.i.s.i.IndexingSynchronizationService The mapping for type 'bitbucke
      t-index-state/indexstate' in the search server is invalid. Errors: [Field 'archived' is missing]
      2022-05-09 18:00:44,986 ERROR [Caesium-1-1]  c.a.b.i.s.i.IndexingSynchronizationService The mapping for type 'bitbucke
      t-repository/repository' in the search server is invalid. Errors: [Field 'archived' is missing]
      2022-05-09 18:00:44,986 ERROR [Caesium-1-1]  c.a.b.i.s.i.IndexingSynchronizationService Mapping in the search server i
      s present but not compatible with this version of indexing. Unable to continue, operator intervention is required.
      2022-05-09 18:00:44,987 WARN  [Caesium-1-1]  c.a.b.i.s.c.cluster.ClusterJobRunner Job execution failed. Rescheduling.
      

      These errors will be repeated for every attempt of the StartupChecksJob (which eventually stops being rescheduled until Bitbucket is restarted), until the issue is resolved (see the workaround below).

      Workaround

      Forcing a repository to be indexed by the search server (e.g. pushing a commit to any repository) will cause the missing fields to be created. This can be verified in the search server logs, e.g. for the bundled search server, after pushing to a repository:

      [2022-05-09T18:23:43,646][INFO ][o.o.c.m.MetadataMappingService] [bitbucket_bundled] [bitbucket-repository/Qf8H4Xj8SfyU-IXcjfXeSA] update_mapping [_doc]
      [2022-05-09T18:23:43,835][INFO ][o.o.c.m.MetadataMappingService] [bitbucket_bundled] [bitbucket-index-state/79AXsuWCRoiVjYkd-AiNlA] update_mapping [_doc]
      [2022-05-09T18:23:44,115][INFO ][o.o.c.m.MetadataMappingService] [bitbucket_bundled] [bitbucket-search/LOCabJ-WQLCKr6-tdza3ZQ] update_mapping [_doc] 
      

      It's recommended to then restart Bitbucket to ensure the StartupChecksJob for search runs successfully (none of the missing archived field ERRORs during startup). This will resolve the issue for all repositories, not just the repository pushed to.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              spetrucev Stefan
              Votes:
              8 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated: